The PHP project shipped PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 on 21 October to fix two critical bugs, together nicknamed PHP2Shell, that can let an unauthenticated attacker run code on a server. The reports that showed how dangerous they were came from researchers using frontier AI models. And according to Amazon, someone was already trying to exploit them four days earlier.
The two bugs
- CVE-2026-109618, “RCE via OOM corruption” (GHSA-w8hw-w9fx-j79w). If a request hits PHP’s memory limit at the wrong moment, PHP can leave half-initialized internal data behind and later treat it as valid. On Apache with mod_php, the PHP Foundation says, an unauthenticated request can trigger it before any application code runs, and full code execution was shown with default settings.
- CVE-2026-109619, “RCE via stale global state” (GHSA-6wmf-4rv5-p3rp). A fatal error at the wrong point can leave state pointing at memory from a previous request, which a later request on the same worker then uses.
php.net lists PHP-FPM, Apache mod_php, php-cgi, FrankenPHP and LiteSpeed as at risk, with mod_php highest. The PHP Foundation gives the CVSS score as 9.2. Wiz says every PHP version from the last decade is hit by at least one of the two, back to 5.4. PHP 8.1 and older get no official releases, though the security team posted minimal source backports for 7.4, 8.0 and 8.1.
Where AI came in
The Foundation’s own timeline is the clearest. Its developers saw the first signs of the memory-limit problem in 2024 but found no concrete attack and could not agree on a fix. On 11 August Calif, auditing PHP under OpenAI’s Patch the Planet program, reported an unconditional code-execution path, and OpenAI reported the same root cause that day. Wiz followed on 24 August. OpenAI says Calif used GPT-5.6 Sol, and that “to our knowledge, frontier AI found these vulnerabilities before attackers did”. Wiz says frontier models made the exploit chain practical “in hours”.
The embargo did not hold
The Foundation says the CVE IDs started circulating on 20 October with a wrong 10.0 score, so it moved the release forward a day. Calif then mistakenly posted a video of its proof of concept, and at 07:41 UTC on 21 October Chainguard published patched images more than six hours before the coordinated release, which the Foundation says “broke the embargo”. AWS says its honeypots logged an attempt on 17 October from an anonymizing network, more attempts in the hours before release, and that PHP2Shell “is now being broadly exploited in the wild”. AWS adds that it is unclear whether those early attempts would have worked.
What to do
- Update to 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or your distribution’s patched package. OpenAI also published a PHP version checker as a Codex skill.
- If you cannot update yet, php.net lists stopgaps such as
memory_limit=-1set where apps cannot override it, a lowpost_max_size, andsession.upload_progress.enabled=0. It says none of them makes a server safe. - AWS advises starting any investigation from 17 October and checking web servers for unexpected processes or file changes.
Update, 22 October 2026: Cloudflare’s WAF blocks PHP2Shell by default
Cloudflare says it was part of the coordinated response with the PHP Foundation, OpenAI and Wiz, built WAF rules from early October, and switched them on at 03:02 UTC on 21 October, about nine hours before public disclosure. Cloudflare says the bugs leaked before the release date, that it saw attack traffic against its customers, and that attackers changed their payloads to try to slip past the rules.
The rules look at the server’s response as well as the request, so a response that shows a successful exploit can be blocked before it reaches the attacker. What to check:
- Free plan: the rules are in the Cloudflare Managed Free Ruleset and are on with no action needed.
- Pro, Business and Enterprise: confirm the Cloudflare Managed Ruleset is deployed in block mode.
Cloudflare calls this defense in depth and says you still need to update PHP. Smaller upload limits help, but do not replace the fix.
Update, 23 October 2026: PHP flags a third, unlikely RCE path and repeats one mitigation
PHP published an informational advisory on 23 October for CVE-2026-115560, a separate remote code execution path in session upload progress. It suggests setting session.upload_progress.enabled=0 until the next regular bugfix release. That is the same mitigation already listed in the CVE-2026-109619 advisory (GHSA-6wmf-4rv5-p3rp) on 21 October, so if you applied it then, PHP says no further action is needed.
PHP says the bug needs an unusual setup: the configuration sets session.serialize_handler to php_binary or php_serialize, the application switches it to php at runtime with ini_set() before calling session_start(), and upload progress is still enabled. Applications that never change the serialize handler at runtime can leave the feature on. Because PHP calls this setup unlikely in practice, it is handling the fix in the regular release cycle and will publish a full advisory with the next release. It has not said which versions are affected or given a severity score.
The Hacker News reports no exploitation of CVE-2026-115560 so far; the attack traffic since 21 October targets the two flaws fixed that day. The advice in this post stands: install 8.5.12, 8.4.27, 8.3.36 or 8.2.35 first, then decide on upload progress.
Update, 19 November 2026: PHP fixes CVE-2026-115560 and three more critical RCE bugs
PHP released 8.5.13, 8.4.28, 8.3.37 and 8.2.36 on 19 November as security releases for every supported branch. The session upload progress bug from our 23 October update, CVE-2026-115560, is now fixed and rated critical in its full advisory. PHP’s pre-announcement said the critical issues need non-default configuration or uncommon setups. Four advisories are rated critical, each scored 9.2:
- CVE-2026-115560, session serializer mismatch (GHSA-658j-r8rw-q6mx): upload progress data written in one session format and read in another can become attacker-controlled objects. It needs upload progress enabled and an app that mixes serializers, plus a usable gadget chain.
- CVE-2026-126714, partially overwritten session files (GHSA-fm2m-fjf5-v3cp): an interrupted write in the default
filessession handler can leave a file that mixes two sessions, which PHP may then deserialize. It also needs a gadget chain to reach code execution. - CVE-2026-129496, timezone cache use-after-free (GHSA-gr4f-wgx5-jpfv): on non-thread-safe builds that log errors to a file, an early-startup diagnostic can leave a stale pointer that a remote request can hit.
- CVE-2026-129474, use-after-free in
__call()backtraces (GHSA-8mjj-2r7p-4hg2), PHP 8.5 only: it needs fatal error backtraces (on by default in 8.5) andzend.exception_ignore_args=0. PHP notes thatphp.ini-productionsetszend.exception_ignore_args=1, which blocks this path.
The 8.5.13 changelog lists more than a dozen other security fixes, including PHP-FPM request smuggling and a PHAR signature bypass. PHP 8.6.0 also went GA the same day.
What to do: install the release for your branch, or your distribution’s patched package. If you run 8.5 with a development-style php.ini, check zend.exception_ignore_args. The PHP2Shell advice above still stands for anyone not yet on the 21 October releases.

The Campfire
CommentsThanks. Your comment is waiting for the desk. Once it is approved it appears here within about a minute.
Add a comment