PHP2Shell: Two Critical PHP Flaws, Now Exploited in the Wild
Two PHP bugs fixed on October 21 allow unauthenticated code execution. CISA now lists them as exploited, and one campaign chained them with a Linux flaw to root 25 firewalls.
TL;DR
- PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, released October 21, fix CVE-2026-109618 and CVE-2026-109619, two bugs that can allow unauthenticated remote code execution [^1] [^2].
- CISA listed both as exploited on October 26; Dream found a campaign that chained them with a Linux kernel flaw to root 25 firewalls [^3] [^6].
Background
PHP runs a large part of the web, including WordPress, Drupal and MediaWiki, the software behind Wikipedia [^4]. These flaws are not in any of those applications but in the PHP engine itself, in code that nearly every request touches: memory management and error handling [^2]. That is why the PHP project tells every installation serving web requests to update, whether it runs PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP or LiteSpeed [^1].
What happened
The two bugs share a root cause. In CVE-2026-109618, out-of-memory handling can interrupt PHP while internal request data is only partly initialized, and the request cleanup then treats the invalid data as valid. In CVE-2026-109619, internal state belonging to one request survives after its memory is freed, and a later request handled by the same worker can use it [^1]. NVD lists CVE-2026-109618 at 9.8 under CVSS 3.1 and 9.2 under CVSS 4.0 [^7]. The project rates mod_php highest risk: there, an unauthenticated request can trigger the attack before any application code runs [^1].
The problem was not new. A developer working for the PHP Foundation found the first signs of the out-of-memory flaw in 2024, but a fix stalled for months; the foundation calls the delay "a structural failure" [^2]. In August 2026, researcher Ryan A at the security firm Calif reported an unconditional remote code execution with the same root cause, followed by further attack paths from Wiz and OpenAI [^2]. Wiz says frontier AI models helped it turn the flaws into working exploits, and demonstrated unauthenticated code execution on current WordPress, Drupal and Joomla containers [^4].
Disclosure did not go to plan. On October 20 the CVE IDs leaked with a wrong CVSS score of 10.0, so PHP pulled its release forward by a day to October 21 [^2]. Hours before it went out, the distributor Chainguard published built images containing the fix, which the foundation says broke the embargo [^2].
Why it matters
At first it looked like a scare. On release day, Elias Taylor pointed out in a blog post that the thousands of "PoC" exploits on GitHub did not work against a stock PHP install, many of them relying on the server already having a file-inclusion bug [^5]. Five days later CISA added both CVEs to its Known Exploited Vulnerabilities catalog [^3]. Dream then reported a campaign that used a custom PHP2Shell exploit together with Fragnesia, a Linux kernel privilege-escalation flaw (CVE-2026-46300), to root 25 Palo Alto Networks PAN-OS firewalls and management servers in the United States, Japan, Taiwan and South Korea, including systems in a US government-affiliated environment [^6]. PAN-OS runs PHP 8.0.30 on its management web server [^6].
That case makes CISA's warning concrete: PHP is often a component of other software, so it can run in places nobody thinks of as PHP servers [^3]. Workarounds only help so much. The PHP project lists settings that reduce exposure, such as disabling session upload progress, but says only an update fully fixes the flaws [^1]. CISA goes further and advises taking PHP systems offline if they cannot be updated, or if they run PHP 8.1 or older [^3].
Practical example
Say Mara runs a small online shop on WordPress, on a rented server with Apache, mod_php and an 8.2 release of PHP older than 8.2.35. One night an automated scanner finds the shop. With mod_php, the attacker needs no account and no vulnerable plugin: a crafted request can trigger the flaw before WordPress runs any of its own code [^1].
The bug sits in PHP's housekeeping. If out-of-memory handling interrupts PHP while internal request data is only half set up, the cleanup afterwards treats that broken data as valid [^1]. The attacker's request is built to make exactly that happen, and Wiz showed that such a foothold can be turned into code execution on current WordPress, Drupal and Joomla containers [^4]. From there the attacker can run commands as the web server, for example to read the shop's database password from its configuration file or to leave a backdoor for later. On firewalls, the attackers Dream tracked went one step further and added a Linux kernel flaw to become root [^6].
Mara's fix takes minutes: update to PHP 8.2.35 or the distribution's patched package [^1]. If that has to wait a day, setting session.upload_progress.enabled=0 and restarting every worker blocks the confirmed session-based attack paths, though not the bug itself [^1].
Related gear
We recommend this book because it explains how attacks on web servers and the applications behind them actually work, which is the context PHP2Shell lands in.
The Web Application Hacker's Handbook: Finding and Exploiting Security Flaws
Sources
- [1]php.net — Security advisory: critical remote code execution vulnerabilities, update now
- [2]The PHP Foundation — Today's PHP Security Release, and How We're Strengthening PHP Security
- [3]CISA — Critical Vulnerabilities in PHP Require Immediate Patching
- [4]Wiz — PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet
- [5]Elias Taylor — There isn't an easy exploit for this PHP vulnerability
- [6]Dream — Chained PHP2Shell Exploit Roots 25 Servers, including US Government Servers
- [7]NVD — CVE-2026-109618
- [8]Hacker News — Security advisory: Critical remote code execution vulnerabilities, update now