Technology reviews & practical guides
PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 fix CVE-2026-109618 and CVE-2026-109619, unauthenticated RCE bugs dating to PHP 5.4. What to update, and what to do if you can't.

PHP shipped emergency releases on 21 October 2026 - PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 - to fix two critical vulnerabilities that can let an unauthenticated attacker run code on a web server. The bugs, tracked as CVE-2026-109618 and CVE-2026-109619 and nicknamed PHP2Shell, reach back to PHP 5.4.0 from 2012, and the PHP project says every installation that serves web requests is at risk.
The release came a day early. The CVE IDs leaked online the afternoon before, Chainguard published patched images more than six hours ahead of the coordinated release, and Cloudflare reported early attack traffic before the fix was out. If you run WordPress, Drupal, Joomla, Magento, Laravel or any other PHP application, update today.
php.net says the new releases "fix two critical vulnerabilities that can allow unauthenticated remote code execution" and that "all PHP users are strongly encouraged to update immediately." Both CVEs are rated CVSS v4.0 9.2. A score of 10.0 circulated while the bugs were leaking; the PHP Foundation says that figure was wrong.
Sansec describes both as use-after-free bugs. A fatal error, typically running out of memory, interrupts native code before cleanup, and later requests reuse the freed memory as if it were live data. Sansec adds that CVE-2026-109618 can also leak memory in a way "similar to Heartbleed": the upload-progress handler can return freed worker memory inside PHPSESSID cookies, potentially exposing passwords, session tokens, API keys and TLS private keys. Every known attack vector uses multipart/form-data requests, and default configurations are vulnerable.
Wiz Research, which chained the bugs into a single exploit script it calls php2shell, counts four exploitable bugs under the two CVEs: a use-after-free in the upload-progress unserializer, remote process-memory disclosure, a use-after-free in fatal-error backtraces, and an OPcache type confusion.
According to php.net, the risk covers "all PHP installations serving web requests, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed." The project rates mod_php highest, with "a demonstrated exploit where an unauthenticated request can trigger the attack before any application code runs."
Because the flaws sit in the engine, the application on top offers little protection. Wiz demonstrated unauthenticated code execution against the official wordpress:latest, drupal:latest and joomla:latest container images. Sansec lists these applications as confirmed affected:
Sansec and Wiz both say every PHP version released in the last decade is affected by at least one of the bugs. Wiz's headline puts the reach at "70% of the Internet".

Given the severity, the PHP security team also published minimal source backports for PHP 7.4, 8.0 and 8.1 in the php-src repository on GitHub (branches PHP-7.4-CVE-2026-109618-109619, PHP-8.0-CVE-2026-109618-109619 and PHP-8.1-CVE-2026-109618-109619) for anyone who builds PHP from source.
Linux distributions and LTS vendors received the patches in advance. The exception is the volunteer-run rpms.remirepo.net repository: PHP told its users to switch to distribution packages or build from source, because "The repo will not have updates today." After updating, restart PHP-FPM pools or Apache so no worker keeps running the old code.
php.net published interim mitigations, with a clear warning that they reduce exposure but "do not make an installation safe".

php.net says lowering error_reporting, turning off display_errors or using the @ operator does nothing against these bugs.
CISA's alert, "Critical Vulnerabilities in PHP Require Immediate Patching", asks organizations to inventory every PHP system, patch internet-facing ones first, take PHP systems offline if they cannot be patched (especially PHP 8.1 or earlier), put a web application firewall in front for interim protection, and monitor PHP worker processes for suspicious activity.
Wiz suggests watching for unusual multipart requests, memory-limit errors, HTTP 500 responses, malformed PHPSESSID cookies and PHP worker churn.

PHP had planned to ship the fix on 22 October at 14:00 UTC. Around 15:00 UTC on Tuesday 20 October, the PHP Foundation says, the two CVE IDs began circulating online. PHP posted a pre-announcement at 19:30 UTC, reserving the right to release early if details went public or exploitation appeared, and sent mitigation advice to critical-infrastructure operators at 23:00 UTC.
The next morning the embargo fell apart. In the Foundation's words: "On October 21st at 07:41 UTC, more than six hours before the coordinated release, Chainguard unilaterally broke the embargo and published built images containing the fix." PHP moved the release forward a full day, to 21 October at 14:00 UTC.

Cloudflare says customers on its free and paid WAF were "protected by default against php2shell" from 03:02 UTC on 21 October, roughly nine hours before public disclosure. It saw attackers mutating payloads to slip past the rules and still recommends patching PHP. Alongside the rules it launched "full transaction detection", which combines request and response signals from the same HTTP transaction.
Reports on exploitation differ. Sansec's timeline records "Cloudflare reports early attacks" at 07:43 UTC on 21 October, before the release, and says watchTowr confirmed code execution on 20 October after the leak. CISA, in its 21 October alert, said it "has not observed exploitation of these vulnerabilities as of the time of publication."
Wiz says it used Wiz Atlas, Gemini 4 Argon and GPT-5.6 Sol throughout the research, and that "frontier models substantially reduced that barrier, turning a longstanding flaw into an exploit." By its account, one researcher did in a week what would previously have taken "a world-class team months of work".

AI did not find the bugs on its own, though. The PHP Foundation says the out-of-memory weakness was known in some form since 2024, when a Foundation developer saw signs of it while fixing issues from an external audit by Quarkslab, funded by the Sovereign Tech Agency through OSTIF. Security firm Calif began auditing PHP on 30 July 2026 through the Patch the Planet programme, and on 11 August Ryan A of Calif reported unconditional remote code execution. OpenAI independently reported the same root cause that day. Wiz reported more attack vectors on 24 August, and OpenAI reported more on 18 September. Trail of Bits is also auditing PHP.
The Foundation also uses AI on defense: "Earlier this year, we worked with Alpha-Omega to scan PHP with Anthropic's Claude Mythos. But since the Mythos scan, we have added other tools, including OpenAI's Daybreak Red for validating reports and exploits, alongside sanitizer builds and reproduction environments that match our CI on every platform PHP supports."
It is blunt about the ten weeks between the August report and the October release: "the delay was a structural failure, caused by both the security team's decision process and its lack of resources." Each candidate fix carried trade-offs - backward-compatibility breaks, new denial-of-service potential, or changes needed across many third-party extensions - and with only a small team of core engine experts, the Foundation says, the work stalled and restarted repeatedly over months.
The Foundation set up an Ecosystem Security Team in May 2026. Alexandre Daubois joined in July to handle triage, reports and fixes, and Daniel Scherzer joined in September to work on hardening.
More in Tech News
Browse Tech News