Skip to content
Writing
5 min read4 sources

PHP2Shell: Critical PHP Vulnerabilities Expose Millions of Websites to Remote Code Execution

PHP2Shell is not an app bug but a core PHP emergency: two critical flaws can yield unauthenticated RCE across a huge slice of the web. Here’s what’s affected, why mod_php is especially risky, and what defenders should do now.

Shuja Abrar · Blockchain Consultant & Engineer

  • php
  • vulnerability
  • rce
  • cybersecurity
  • websecurity
0:00 / 9:10
On this page
  1. 01What PHP2Shell is
  2. 02Why the blast radius is wide
  3. 03How exploitation can unfold
  4. 04What defenders should do now
  5. Sources (4)

PHP2Shell matters because it is not a bug in one popular CMS or a bad plugin choice; it is a set of flaws in core PHP that can let an unauthenticated attacker reach remote code execution in the runtime itself. On October 21, 2026, PHP shipped emergency fixes for CVE-2026-109618 and CVE-2026-109619, and the project said there are no complete mitigations beyond upgrading.

01What PHP2Shell is

PHP2Shell is the nickname researchers gave to two critical PHP vulnerabilities that were released together. The PHP project describes them as “RCE via OOM corruption” and “RCE via stale global state.” In plain English, one bug can corrupt internal request state when PHP runs out of memory during request processing, and the other can leave request-owned state pointing at freed memory after cleanup. Either path can turn an ordinary web request into memory corruption and, in the worst case, code execution.

That distinction matters because this is not a typical application-layer flaw. The vulnerable behavior sits in the engine that every PHP application relies on. If the runtime itself can be pushed into a bad state before the application has a chance to validate input, then even a well-written app can inherit the risk. Wiz’s research summary says the issues are independent of the app running on top of PHP, and that even a simple “Hello World” deployment on an affected version can be vulnerable.

The public disclosure also makes clear why the vulnerabilities were taken so seriously. The PHP Foundation and the PHP project urged all users to update immediately, and the release notes say the fixes cover PHP 8.5.12, 8.4.27, 8.3.36, and 8.2.35. Those are not optional hardening releases; they are emergency security updates for core runtime flaws.

02Why the blast radius is wide

PHP still powers a very large share of the public web. Wiz describes PHP as the language behind roughly 70% of websites, and calls out WordPress, Joomla, Drupal, and MediaWiki as examples of major software built on it. That does not mean every site using PHP is equally exposed, but it does mean the pool of potentially affected servers is enormous.

The PHP project’s advisory is even more direct about scope. It says all PHP installations serving web requests are at risk, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP, and LiteSpeed. The same advisory says the risk is highest for mod_php, where a demonstrated exploit can trigger before application code runs. That is an important operational detail: if the exploit path fires in the web server’s PHP integration layer, the app itself may never get a chance to defend itself.

That also explains why this disclosure moved so quickly from research to emergency patching. The core issue is not limited to one deployment pattern, and it is not fixed by simply checking whether your application sanitizes input. A site can have secure application code and still be exposed if the runtime is vulnerable and internet-facing. The combination of a large install base and engine-level memory corruption is what makes PHP2Shell different from an ordinary CVE.

03How exploitation can unfold

The most worrying aspect of PHP2Shell is that exploitation does not need authentication. The PHP advisory says the vulnerabilities can allow unauthenticated remote code execution, and Wiz says it demonstrated pre-authentication RCE against common CMS targets in test environments. Public reporting from the response community has also described simple HTTP request patterns, including POST traffic, as enough to trigger the issue in vulnerable configurations.

That matters because unauthenticated RCE changes the defender’s job from “protect privileged admin paths” to “treat the exposed runtime as potentially hostile.” Once an attacker can influence request lifecycle bugs in the engine, the impact can extend beyond a shell. Wiz says the flaws can also expose process memory, including secrets such as passwords, tokens, and API keys. The PHP project’s own notes warn that the vulnerabilities stem from internal request data being only partially initialized or surviving after its backing memory has been freed, which is exactly the sort of condition that can lead to both corruption and disclosure.

That combination is what makes the problem operationally painful. A successful exploit could allow an attacker to execute code as the web server account, read configuration files and in-memory credentials, alter content, plant web shells, or pivot deeper into adjacent systems. Even if a site is behind authentication, the attack may never reach application logic. The attack surface is the runtime itself, not just the application sitting on top of it.

04What defenders should do now

The first action is simple: patch to a fixed release immediately, or install your distribution or hosting provider’s backported package if they are the source of your PHP builds. The PHP project says there are no complete mitigations, which means patching is the only reliable answer. If you are running PHP 8.2, treat this as a temporary reprieve, not a reason to stay there; PHP 8.2 reaches end of life on December 31, 2026 and will stop receiving security fixes after that date.

The second action is to inventory everywhere PHP runs. Many teams only think about the public website, but PHP often sits inside admin portals, package mirrors, internal tools, customer support consoles, marketing microsites, and vendor-managed appliances. The PHP advisory explicitly names multiple server integration modes, so the safe assumption is that any internet-facing PHP workload deserves review. If you operate containers, make sure you are not pinning an older base image that quietly keeps the vulnerable runtime alive long after the application team believes the site is patched.

The third action is to assume credential exposure may have occurred if you had an exposed vulnerable runtime before patching. Because the research shows memory disclosure as part of the impact, API keys, database passwords, session material, and other secrets may have been resident in PHP worker memory. Rotate what matters, invalidate sessions if necessary, and check for signs that attackers touched the service before the patch landed. That is especially important for long-lived worker models such as PHP-FPM pools, where memory can persist across requests.

The broader lesson is uncomfortable but important: core runtime bugs can have a wider blast radius than application bugs because they sit underneath your security controls. PHP2Shell is a reminder that language ecosystems need the same urgency we usually reserve for operating-system flaws. If your business depends on PHP, this is a patch-now event, not a monitor-and-wait event. If your business depends on systems that embed PHP indirectly, the same rule applies. The safe response is to upgrade, verify, rotate secrets, and then verify again.

Share

Link opens on iamshuja.dev · previews show the site card

All writing