PHP2Shell: two flaws that let anyone run code on PHP servers
Two critical bugs in PHP’s memory management and error handling allowed unauthenticated remote code execution. They touch almost every PHP request — and PHP runs a large share of the web.
- CVE-2026-109618
- CVE-2026-109619
How it happened, step by step
Simplified diagram: the boxes are illustrative, but the sequence follows what the sources describe.
Normal request flow
The web server hands each request to a PHP worker, which manages memory and errors while it runs your application.
Use the arrow keys to move between steps.
- Normal request flow: The web server hands each request to a PHP worker, which manages memory and errors while it runs your application.
- Reaching the vulnerable part: An attacker sends a request that makes PHP run out of memory or hit a fatal error at exactly the wrong moment. No login needed — on mod_php it happens before your code runs.
- What goes wrong: PHP keeps using half-initialised or already-freed memory. A skilled attacker turns that into running their own code with the web server’s rights — and can reach your application and data.
- How the patch helps: The fixed releases clean up memory and state correctly, so the same request fails safely. Updating is the only complete fix.
What happened
On October 21, 2026, the PHP project released PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, fixing two critical vulnerabilities nicknamed "PHP2Shell". Both can allow an unauthenticated attacker to execute code on a server running PHP. The CVE IDs leaked online the day before, so the release was moved forward by a day.
How it happened
CVE-2026-109618: if a request hit PHP’s memory_limit at exactly the wrong moment, PHP could leave partially initialised internal data behind and later treat it as valid, corrupting memory. On Apache with mod_php an unauthenticated request can trigger this before any application code runs.
CVE-2026-109619: a fatal error at the wrong point could leave internal state pointing at memory from a previous request. A later request handled by the same worker could then use that freed memory (a use-after-free).
Who was affected
All PHP installations serving web requests: Apache with mod_php (highest risk), PHP-FPM, php-cgi, FrankenPHP and LiteSpeed. That includes WordPress, Laravel and countless other PHP applications, and PHP hidden inside other products.
PHP 8.1 and older are end-of-life and received no fix.
Consequences
Remote code execution means an attacker can run their own commands with the web server’s rights: read data, plant malware or move deeper into the network. Proof-of-concept exploits circulated quickly, and on October 26 CISA added both CVEs to its Known Exploited Vulnerabilities catalogue.
How it was resolved
Updating is the only complete fix: PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35. CISA advised taking systems offline that cannot be patched, including anything still on PHP 8.1 or older. A web application firewall can provide some protection in the meantime.
What businesses can learn
Know every place PHP runs — including vendor tools and bundled copies. Inventory gaps turn a one-hour patch into a day of searching.
End-of-life software is a liability with a date on it: on PHP 8.1 there was nothing to install.
Defence in depth buys time. A WAF and monitoring do not replace patching, but they can stop the first wave while you update.
How FlowOne responded
We only list what our own logs can prove.
- All FlowOne application servers and container images were running the fixed PHP 8.3.36 within a day of the release.
- The only exploitation attempt we saw was blocked by our web application firewall before it reached PHP.
- End-of-life PHP runtimes we control were removed; one vendor-bundled copy we cannot replace was isolated from the internet.
More incidents
nginx: five critical flaws in the web server in front of millions of sites
F5 fixed five vulnerabilities in nginx that can let an unauthenticated attacker run code inside the nginx worker process. The most important one needs nothing more than HTTP/2 switched on.
Read the storyClamAV: one deliberately broken file could stop the virus scanner
The open-source ClamAV scanner fixed ten security flaws on November 18. A malformed help file, Office document, packed executable or archive could crash the scanner or send it into an endless loop, and several of the bugs could write past the end of a memory buffer.
Read the story