Threats and Breaches
PHP2Shell: the flaw in PHP itself, and how a WAF held the line while servers were patched
PHP2Shell is a PHP vulnerability, two critical flaws in PHP itself made public with fixes on 21 October 2026. One crafted upload request, with no login, could run code on the server before the website's own code saw it. Patching PHP is the fix; a web application firewall is what holds the line until every server is patched.

Published 6 min read
PHP2Shell is a PHP vulnerability, in fact two critical flaws in PHP itself, CVE-2026-109618 and CVE-2026-109619, made public with fixes on 21 October 2026. One crafted upload request, with no login, could let an attacker run code on the server before the website's own code saw it, so plugins and application fixes could not help. The fix is a patched PHP release. Until every server was updated, a web application firewall stood in front: Cloudflare's rules blocked the attack on its Free and paid plans from hours before disclosure.
What PHP2Shell is
PHP2Shell is not a bug in WordPress, Drupal or a plugin. It sits in the part of PHP that reads an incoming web request and gets it ready for the application, and PHP's own advisories describe two separate faults there:
- CVE-2026-109618, memory corruption. PHP runs out of memory while it is still setting up a request's data, and the cleanup that follows treats the half-built data as valid (PHP).
- CVE-2026-109619, stale request state. A piece of state from one request outlives the memory it points to, and a later request handled by the same PHP worker uses it (PHP).
Both are reached through multipart uploads, the ordinary way a form sends a file, and PHP's session upload progress feature is one of the confirmed paths. No login is needed. PHP lists every common way it serves the web as affected: Apache with mod_php, PHP-FPM, php-cgi, FrankenPHP and LiteSpeed, with the risk highest for mod_php (PHP). How far back it goes depends on who you ask: Varonis says every version back to PHP 5.4, while PHP's two October advisories give no starting version.
Why application fixes could not help
This is the part that caught companies out. Security plugins, input validation and the application's own checks all run after PHP has read the request. PHP2Shell happens while it is reading it. Cloudflare put it plainly: updating website code or plugins alone does not fix these vulnerabilities (Cloudflare).
Several gaps we see on real projects made it worse:
- No PHP inventory. Asset lists name applications, not the runtime under them or its version. Forgotten admin tools, staging copies and old microsites run PHP that nobody patches.
- Nobody owns the update. On shared or managed hosting, patching waits on the provider or the distribution's package, and nobody inside the company knows who updates PHP.
- Stuck on old PHP. PHP 8.1 reached the end of its support on 31 December 2025 (PHP), so it gets no fixes from the project, and moving off it means an application upgrade nobody budgeted for.
From 21 October: the timeline
PHP announced on 20 October that fixes would ship the next day at 14:00 UTC, both flaws rated 9.2 on the CVSS v4.0 scale. That evening, according to F5 Labs, critical details and the CVE numbers leaked.
On 21 October, Cloudflare's WAF rules went live from 03:02 UTC. F5 Labs saw the first scanning at 08:36 UTC. PHP released 8.5.12, 8.4.27, 8.3.36 and 8.2.35 that afternoon: CERT-EU puts it at 13:30 UTC and the EU joint statement at 13:40. Within hours F5 was recording thousands of attempts, about 98 percent of them against CVE-2026-109619.
On 23 October PHP described a third flaw, CVE-2026-115560, affecting even the patched releases in an unusual session configuration, and advised turning upload progress off until the next release. On 26 October CISA added the first two to its catalogue of known exploited vulnerabilities. On 19 November PHP released 8.5.13, 8.4.28, 8.3.37 and 8.2.36, published CVE-2026-115560 as a full advisory and turned upload progress off by default (PHP).
The sources do not all agree, and the differences matter if you are briefing a board:
- The score. PHP, CERT-EU and Wiz give 9.2 on CVSS v4.0; F5 Labs gives 9.8 without naming the version.
- Attacks in the wild. Cloudflare saw attack traffic against its customers. F5 saw attempts. CERT-EU spoke of the likelihood that attackers were already exploiting. CISA's listing counts attempted exploitation as active, as The Record points out, and on 27 October Wiz said it had not yet seen a successful attack end to end.
- Which bug is which. PHP and Cloudflare tie CVE-2026-109618 to the memory corruption and CVE-2026-109619 to the stale state. Varonis counts four bugs grouped into two CVEs, and Wiz's table groups them differently. We follow PHP.
- The third flaw. PHP's note of 23 October said CVE-2026-115560 needed the configuration switched at runtime. Its advisory of 19 November says a runtime change is not required.
How a WAF held the line
A web application firewall sits in front of the server and inspects each request before it arrives. That is exactly where PHP2Shell can be stopped while PHP itself is still unpatched.
Cloudflare's post describes what it did. Seven rules, named "PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619)", went into the Cloudflare Managed Free Ruleset and the Cloudflare Managed Ruleset, deployed automatically on every plan with the WAF, Free included. A managed response rule, applied on all plans, inspects the server's answer too and can block it before it reaches the attacker. Cloudflare says the rules went live about 9 hours ahead of public disclosure. Measured from 03:02 UTC to a release at 13:30 or 13:40, it was closer to 10 and a half.
Two parts of the post matter as much as the rules. Paid plans were told to confirm the managed ruleset is deployed in Block mode, not just logging. And Cloudflare saw attackers changing their payloads to try to get past the rules, which is why it tells customers to patch even with the WAF in place. Cloudflare's post lists the rule IDs; we link to it rather than repeat them.
Where WAF setups fall short
When we set up or review Cloudflare WAF for a company, the rules are rarely the problem. The setup around them is:
- The origin is reachable directly. Not every hostname is proxied, or the server answers anyone on its IP address, so an attacker simply goes around the WAF.
- Rules left in Log mode. Managed rules were switched to Log after a false positive and never set back to Block.
- No rules of their own. Only the managed rulesets, with no custom or rate-limiting rules on upload, login or admin paths.
- Nobody reads the events. WAF events are not reviewed or sent to the SIEM, so attacks the rules caught, or missed, go unseen.
- No one in house knows the WAF. It was turned on once, and nobody on the team has the time or the experience to tune it.
What to do until every server is patched
In this order:
- Confirm the rules are on and in Block, and that the origin accepts traffic only from Cloudflare.
- Apply PHP's mitigations where a server cannot be updated today. Set
session.upload_progress.enabled=0in the server's configuration and restart every worker;ini_set()and.user.inido not work for this. Limit request sizes at the proxy, and keeppost_max_sizesmall, as PHP's advisory sets out. PHP is clear that there are no complete mitigations and updating is the only safe choice. - Patch in order of exposure. Internet-facing servers with unauthenticated upload paths first, internal ones after.
- Search the logs back to mid-October for multipart requests followed by memory errors or crashed PHP workers, and treat a hit as an incident.
- Bring the alerts together. Build alerts across on-premise servers, cloud and containers, and send them to one SIEM, so a PHP worker crashing on a server or in a container is seen in one place. That is the work of bringing WAF and server alerts into one SIEM, and of detection rules kept as code.
After patching
Patching closes the hole. It does not tell you whether someone came through it, or whether you are ready for the next one. Check that:
- Every copy is fixed. Every server shows a fixed version, including containers rebuilt from old base images and the hosts nobody remembered.
- Exposed secrets are rotated. Database passwords, API keys and session keys on any server that was exposed before it was patched are changed.
- The WAF stays on. Keep it as a standing layer, with its rules checked in Block, for the next flaw in a runtime.
- The runtime has an owner. PHP and the other runtimes go on the patch inventory with a named owner, so the next flaw has a person and a date. Patching and updates on a retainer is one way to make sure it does.
PHP2Shell will not be the last flaw that sits below the application. The companies that came through it calmly had three things before 21 October: they knew where PHP ran, their WAF was in Block in front of every hostname, and someone owned the update. That is the work of web application firewall design and operation, and of the step-by-step approach we would take for a PHP business.
Frequently asked questions
What is PHP2Shell?
PHP2Shell is the name given to two critical flaws in PHP itself, CVE-2026-109618 and CVE-2026-109619, which PHP fixed on 21 October 2026. A crafted upload request, sent without logging in, could corrupt PHP's memory or reuse request data PHP had already freed, and in tested setups that was enough to run code on the server. PHP rates both 9.2 on the CVSS v4.0 scale.
Am I protected if my site runs WordPress or another PHP application with security plugins?
No. PHP reads and sets up the request before WordPress, Drupal, Magento or any plugin sees it, so the flaw is reached before the application's own defences run. PHP and Cloudflare both say so. Updating the application or its plugins does not fix PHP2Shell; updating PHP does.
Does a WAF replace patching PHP?
No, and Cloudflare says so itself. A web application firewall can block the known shapes of the attack while servers are patched, and Cloudflare saw attackers changing their payloads to try to get past its rules. It buys time. The fix is a patched PHP release on every server, container and image.
Which PHP versions are fixed?
On 26 November 2026 the current releases are 8.5.13, 8.4.28, 8.3.37 and 8.2.36, released on 19 November, which also turn the upload progress feature off by default. The first fixes, 8.5.12, 8.4.27, 8.3.36 and 8.2.35, shipped on 21 October. PHP 8.1 and older are out of support and get no fixes from the PHP project.
Sources
- PHP news archive, 2026 (release notice of 20 October, security advisory of 21 October, advisory of 23 October, releases of 19 November), PHP, 2026
- RCE via OOM corruption, PHP (GitHub security advisory), 2026
- RCE via stale global state, PHP (GitHub security advisory), 2026
- Session serializer mismatch can lead to remote code execution, PHP (GitHub security advisory), 2026
- Supported versions, PHP, 2026
- Cloudflare deploys protections against php2shell vulnerability, Cloudflare, 2026
- PHP2Shell Exploitation Attempts Observed, F5 Labs, 2026
- PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet, Wiz, 2026
- PHP2Shell: Exploitation Attempts and Remediation Trends, Wiz, 2026
- PHP2Shell: One Upload, Full Server, Varonis, 2026
- Security Advisory 2026-018: Critical Vulnerabilities in PHP, CERT-EU, 2026
- Joint statement on critical PHP vulnerabilities, ENISA, 2026
- Critical Vulnerabilities in PHP Require Immediate Patching, CISA, 2026
- CISA warns of PHP bug exploitation attempts, gives federal agencies days to patch, The Record, 2026
Network security consulting and system hardening
We review your network and servers, harden them to CIS Benchmarks, segment the network, set up firewalls, remote access and DNS filtering, and design zero trust access. Then we hand it all to your team, documented, to run.
Explore Network & Systems SecurityRelated reading
Threats and Breaches
The $6 billion Binance hack: how EIP-7702 turned a hot wallet against its owner
Attackers drained about $6.3 billion from Binance's hot wallets on 29 October 2026, using EIP-7702 to point a wallet at their own contract. The keys did not leak; a system that signs was used. The lesson for any company is to protect the signer and the approvals, not only the key.
5 min read
Threats and Breaches
Software supply chain risk: what SolarWinds and CrowdStrike teach
The SolarWinds attack and the CrowdStrike outage were different failures that arrived the same way, as a trusted update. What they show about software supply chain risk, and the contract terms and controls that limit it.
5 min read
Tell us what you want to secure
Name the sites, servers and remote users involved, and any deadline. We reply within two business days.