News
What Is PHP2Shell? The AI-Found PHP Flaws, Explained
PHP2Shell is a pair of critical PHP flaws (CVE-2026-109618 and CVE-2026-109619) patched October 21, 2026, one found with OpenAI’s GPT-5.6 Sol. What to do.
PHP2Shell is the nickname for two critical security holes in PHP, the programming language behind a huge share of the web. PHP shipped emergency fixes on October 21, 2026, after details leaked online a day early. If you run a website, a store, or a blog on WordPress, Drupal or Magento, this one is worth five minutes of your time.
It is also an AI story. One of the two bugs was found by a security firm using OpenAI’s GPT-5.6 Sol model, and OpenAI published a post the same day about how it coordinated the response. Here is what PHP2Shell is, who is at risk, how to fix it, and what it says about AI agents doing security work.
What is PHP2Shell?
"Shell" is hacker slang for control of a computer. "PHP2Shell" means: send something to a PHP website, get control of the server. The name spread from a researcher’s blog post, according to SecurityWeek, and stuck once the bugs became public.
Both bugs live in PHP itself, not in any plugin or app. That is why they are so serious. When a web request ends in an unusual way, PHP can leave bits of memory in a broken state. A later step, or even the next visitor’s request, can then use that broken memory as if it were fine. A skilled attacker can turn that mistake into running their own commands on the machine.
- CVE-2026-109618 is triggered when PHP runs out of memory at the wrong moment, while request data is only half set up. Cleanup then treats the unfinished data as real.
- CVE-2026-109619 involves "stale" state: data from one request survives after its memory is freed, and the next request on the same worker uses it.
Help Net Security says the flaws rank among the most severe ever found in PHP.
PHP2Shell at a glance
| Question | Answer |
|---|---|
| CVE IDs | CVE-2026-109618 and CVE-2026-109619 |
| Severity | 9.2 (CVSS 4.0) for both, per PHP |
| What an attacker gets | Code running on the server, with no account and no user click |
| Affected | PHP 5.4 and later serving web requests: PHP-FPM, Apache mod_php, php-cgi, FrankenPHP, LiteSpeed |
| Fixed versions | PHP 8.5.12, 8.4.27, 8.3.36, 8.2.35 |
| Older versions | 8.1 and below are out of support; PHP posted source backports for 7.4, 8.0 and 8.1 |
| Patch released | October 21, 2026, 14:00 UTC |
| Found by | Ryan Austin of Calif (using GPT-5.6 Sol), Wiz Research, and OpenAI |
Am I affected by PHP2Shell?
If your site runs on PHP and you have not updated since October 21, assume yes. Sansec says the buggy code dates back to PHP 5.4.0 from 2012, and default setups are vulnerable. Calif showed working attacks against default installs of WordPress 7.1.2, Drupal 11.4.3, Magento 2.4.9, Joomla, Nextcloud, phpMyAdmin and more. Updating WordPress or a plugin does not help here, because the flaw is in PHP underneath.
If you only visit websites, you do not need to do anything on your phone or computer. The risk is to the servers.
How to fix PHP2Shell
- Update PHP to 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or the patched package from your Linux distribution or host. Distributions got the fixes before the public release.
- On a managed host? Ask support if PHP has been patched. Many hosts patch for you, but check.
- Can’t update yet? PHP’s team suggests setting
memory_limit=-1as a stopgap for CVE-2026-109618, and Calif also suggests turning offsession.upload_progress.enabled. Sansec warns these are only partial fixes, and removing the memory limit lets one request eat all your server memory. The UK’s NCSC goes further: consider taking unpatchable systems offline. - Behind Cloudflare? Its firewall has blocked known attack patterns for all plans, including free, since 3:02 UTC on October 21. That buys time. It is not a fix.
How AI found PHP2Shell
This is the part that makes PHP2Shell different. On August 11, 2026, Calif researcher Ryan Austin reported a remote code execution path to PHP. OpenAI says Calif "identified a critical flaw using GPT‑5.6 Sol" as part of its Patch the Planet program, which launched in June with Trail of Bits to fix bugs in widely used open-source software. Wiz Research separately found and reported both bugs on its own.
OfficeChai reports that a PHP core developer had spotted early signs of the memory bug back in 2024, during an audit by Quarkslab. No one could prove it was exploitable, so it sat for about two years. The AI-assisted research found working attack paths.
OpenAI’s October 21 post, titled "Patch the Planet: global response coordination as agents uncover critical vulnerabilities," describes a two-month coalition with PHP’s maintainers, Wiz, Cloudflare and others. It calls the gap between AI finding a bug and attackers finding it a "Defender’s Window." That window closed early this time: details leaked on October 20, and Sansec, citing Cloudflare, says the first attacks came hours before the official patch.
OpenAI is also blunt about the risk. The same skills, it says, "can also help attackers rapidly develop offensive tools and exploits," and it expects similar findings to "increase sharply in the coming months."
PHP2Shell vs wp2shell
Do not mix the two up. wp2shell was an earlier, separate bug chain inside WordPress core itself. PHP2Shell sits one layer lower, in PHP itself, so it reaches far more software: almost 70% of websites use PHP, per Cloudflare.
What this means for you
PHP2Shell is a clear sign of where agentic AI is going. Models are now good enough to dig through old, trusted code and find holes humans missed for years. That cuts both ways, so the winners will be people and teams who act fast on what the agents find.
Most small site owners do not have a security team. That is the gap a personal agent can fill. With Agentic AI on iPhone, you can hand a task like "explain this advisory and write the steps for my WordPress host" to one agent, or put up to 4 agents on it so one drafts and another checks. You get 3 free tasks, with no account to create. For ready-made wording, see our copy-paste prompts for AI agents.
Quick answers
What is PHP2Shell? PHP2Shell is the nickname for two critical PHP engine flaws, CVE-2026-109618 and CVE-2026-109619, that let an attacker run code on a web server without logging in. PHP patched them on October 21, 2026.
What is the PHP2Shell CVE? There are two: CVE-2026-109618 (out-of-memory corruption) and CVE-2026-109619 (stale global state). Both are rated 9.2 under CVSS 4.0.
Is there a PHP2Shell patch? Yes. Update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or your distribution’s patched package.
Is PHP2Shell being exploited? Yes, reports say so. Details leaked before the patch, and Cloudflare saw attack traffic and attackers changing payloads to get past its rules. Patch now.
Did AI find PHP2Shell? Partly. OpenAI says Calif found one critical flaw using GPT-5.6 Sol. Wiz found both independently. Read more about the model in What is GPT-5.6?
Does PHP2Shell affect WordPress? Yes. Calif demonstrated attacks on WordPress 7.1.2, plus Drupal, Magento and others, because the bug is in PHP underneath them.
Sources: OpenAI: Patch the Planet · OpenAI on X · Help Net Security · Cloudflare · Sansec · SecurityWeek · BleepingComputer · OfficeChai