Bridges AI Consulting Logo
    Back to Blog
    Tech|October 23, 2026|8 min read

    Why PHP Keeps Getting Hacked -- and What AI Found That Humans Missed

    B

    Bridges AI

    AI Strategy & Engineering

    If your organization has a public website, a client portal, a property-record lookup, or a learning management system, there is a strong chance PHP is running underneath it. That is not an insult to your IT vendor. It is arithmetic. According to W3Techs, PHP is the server-side language on roughly three out of four websites where the language can be identified, and WordPress alone -- which is PHP -- accounts for more than 40 percent of all websites. Drupal, which powers a great many municipal and county sites, is PHP. Moodle, which powers a great many school districts, is PHP. Laravel, the framework behind a large share of custom small-business software built in the last decade, is PHP.

    So when PHP has a bad week, New Jersey has a bad week. This post explains the specific problem that keeps getting exploited, why it survived a patch for twelve years, and the genuinely interesting part: this class of bug is now being found by machines, including bugs that attackers already knew about and defenders did not.

    PHP in Thirty Years, Briefly

    PHP started in 1994 as a set of C programs Rasmus Lerdorf wrote to track visits to his online resume. He called them Personal Home Page Tools. It was never designed as a programming language; it was designed as glue for sticking dynamic values into HTML pages.

    That origin matters, because it never fully went away. In 1997 and 1998, Andi Gutmans and Zeev Suraski rewrote the parser and shipped PHP 3, then built the Zend Engine for PHP 4 in 2000. PHP 5 (2004) added real object orientation. PHP 6 was abandoned entirely after years of work on Unicode support. PHP 7 (2015) was a serious engineering achievement -- roughly a doubling of performance over PHP 5 on typical workloads. PHP 8 (2020) added a JIT compiler, named arguments, and a type system that a modern developer would recognize.

    Modern PHP is a legitimately good language. The problem is that the internet is not running modern PHP. It is running a thirty-year sediment of code: CGI interfaces from 1995 still shipping for compatibility, serialization formats that execute code when you unpack them, and millions of installations whose owners have no idea what version they are on.

    The Specific Problem: One Invisible Character

    The PHP flaw that has driven the most real-world damage is CVE-2024-4577, an argument injection bug in PHP-CGI on Windows, disclosed in June 2024 by Orange Tsai of the Taiwanese security firm DEVCORE. Understanding it takes about ninety seconds and is worth your time, because it teaches you something about how security actually fails.

    PHP-CGI is an old way of running PHP where the web server launches the PHP binary as a separate program for each request. Because of how CGI works, a query string without an equals sign in it gets handed to that program as command-line arguments. PHP's command line accepts a

    -d
    flag that overrides configuration settings. Chain those two facts and a URL becomes a configuration override -- and then arbitrary code execution.

    This was discovered and patched in 2012, as CVE-2012-1823. The fix was reasonable: reject input that starts with a hyphen.

    Here is what Tsai found. On Windows, when PHP passes strings to the operating system, Windows performs what Microsoft calls a Best-Fit character mapping -- it substitutes visually similar ASCII characters for characters that do not exist in the target code page. The soft hyphen, byte

    0xAD
    , maps to a plain ASCII hyphen. So an attacker sends
    %AD
    instead of
    -
    . PHP's validation check looks at the bytes, sees no hyphen, and allows the request. Windows then converts the soft hyphen into a real hyphen after the check has passed. The guard and the conversion disagreed about what a hyphen was, and the disagreement was worth full remote code execution.

    The consequences were immediate. CISA added it to the Known Exploited Vulnerabilities catalog within days. TellYouThePass ransomware operators were deploying it in under 48 hours. Symantec documented a custom backdoor delivered through it in August 2024. Cisco Talos reported campaigns using it against Japanese organizations into 2025. It is a 2012 bug wearing a 2024 costume, and it is still being scanned for constantly.

    Where AI Actually Changed the Picture

    CVE-2024-4577 was found by a human. What has changed since is that bugs of exactly this shape are now being found by AI systems -- and that is the development that should reframe how you think about your own software.

    Traditional automated scanners are pattern matchers. They are good at finding a known-bad function call in a single file. They are structurally incapable of finding the PHP bug above, because nothing in that code is wrong on its own. The validation function is correct. The Windows encoding behavior is documented and correct. The vulnerability exists only in the gap between two correct layers, and seeing it requires holding both in mind at once and asking what happens in between.

    That turns out to be something large language models are unusually suited to. The public record is now substantial:

    • Google's Big Sleep project, a collaboration between Project Zero and DeepMind, reported its first real-world find in November 2024: a memory-safety bug in SQLite, caught before release. In July 2025, Big Sleep found CVE-2025-6965 in SQLite -- a critical flaw Google stated was known to threat actors. Google characterized it as the first time an AI agent had been used to directly cut off an exploitation attempt in progress. By August 2025, Big Sleep had reported roughly twenty additional flaws across widely used open-source libraries including FFmpeg and ImageMagick.
    • At DARPA's AI Cyber Challenge finals at DEF CON in August 2025, competing autonomous systems found the large majority of deliberately injected vulnerabilities in real open-source codebases -- and, more tellingly, turned up previously unknown genuine bugs that nobody had planted.
    • Google's CodeMender, announced in October 2025, went further and upstreamed dozens of security fixes to open-source projects automatically.

    The shift is not that AI is smarter than a researcher like Tsai. It is that AI does not get bored. Reviewing the interaction between a 2012 input filter and a platform encoding quirk is tedious work that nobody is assigned to do. Machines will do it across your entire codebase, every commit, forever.

    The Honest Caveat

    This is also an area with an enormous amount of nonsense in it, and you should know the counter-evidence. Daniel Stenberg, who maintains curl, has publicly documented a flood of AI-generated vulnerability reports that were confidently written and entirely fictional -- and in 2025 said curl would begin banning submitters of what he called AI slop. A chatbot asked "is this code safe?" produces plausible prose, not findings.

    The difference between the two outcomes is reproduction. Systems that find real bugs do not stop at a hypothesis; they build a proof-of-concept, run it, and discard anything that does not trigger. If someone sells you AI security review that does not include a reproduction step, you are buying prose.

    Your Thirty-Minute Check

    Concrete, in order:

    1. Find your PHP version. Run
      php -v
      on the server, or ask your host. Compare against php.net/supported-versions. If you are on PHP 8.1 or earlier, you are receiving no security patches at all -- that is the finding, and it is more urgent than any single CVE.
    2. Find out whether you run PHP-CGI. The dangerous configuration for CVE-2024-4577 is Windows plus PHP-CGI, and XAMPP's Windows defaults were exposed out of the box. Most Linux hosting uses PHP-FPM and was not vulnerable in the default case. Knowing which you are takes one question.
    3. Put three questions to your software vendor in writing. What PHP version does our instance run? What is your patch cadence for critical CVEs? What will you tell us, and how fast, if you are breached? Get answers in email, not on a call. For New Jersey entities this is not academic: the state's breach notification statute (N.J.S.A. 56:8-163) requires notifying the Division of State Police before notifying affected residents, and you cannot meet that clock if your vendor goes quiet.
    4. Check CISA's Known Exploited Vulnerabilities catalog yourself. It is free, public, and updated continuously. If something in your stack is on that list, it is not theoretical -- somebody is already using it.
    5. Read your access logs once. Look for query strings containing
      %AD
      , or stray single-letter arguments. Scanning traffic for this bug has never stopped.

    None of this requires a security consultant. It requires forty minutes and someone willing to ask uncomfortable questions of a vendor.

    When You Want a Second Set of Eyes

    If you want someone to actually run that inventory -- figure out what PHP your assessment portal, case management system, or district website is running, confirm whether you are exposed, and set up AI-assisted review that produces reproducible findings instead of plausible paragraphs -- that is the work we do, and we do it for New Jersey organizations specifically. Book a conversation at /bookings and bring whatever you know about your stack, even if that is very little. Knowing very little is the normal starting point, and it is a fixable one.

    Related posts

    Want this working in your business?

    Book a free 30-minute consultation. We map your workflows, find the automation wins, and you leave with clear next steps — no obligation.

    Book a Free Consultation