PHP2Shell: the patches are out, the cause was something else
PHP released patches for two critical RCE flaws on 21 October 2026. The cause sits in the PHP core, not in session upload progress.
- by blacklens.io Team
- Published
- Updated
- 9 min read

PHP published out-of-band security releases on 21 October 2026 for two critical flaws circulating under the name PHP2Shell: versions 8.2.35, 8.3.36, 8.4.27 and 8.5.12. Both allow remote code execution without authentication, both sit in the PHP core rather than in an application. And both have a different cause from the one that travelled through forums and newsletters after the leak of 20 October.
Updated on 21 October 2026, after the release: this post previously described an unreleased patch and followed the reading of the time, that session upload progress was the cause. PHP's advisory disproves that. The mechanism, the interim measures and the version details now follow the official advisories.
What is PHP2Shell?
PHP2Shell is the unofficial name for two critical vulnerabilities in the PHP core, tracked as CVE-2026-109618 and CVE-2026-109619. Both allow unauthenticated remote code execution, meaning an attacker runs their own commands on the server with the privileges of the web server process. PHP rates both CVSS 9.2 under version 4.0. The vector explains why it is not 10.0: AC:H and AT:P record high attack complexity and additional requirements. The exploit does not succeed on every attempt — but attackers may try as often as they like.
According to the advisories, every installation that serves web requests is affected, regardless of the application on top: PHP-FPM, Apache with mod_php, php-cgi, LiteSpeed and FrankenPHP. The highest risk sits with mod_php. W3Techs reports that 69 per cent of all websites with a known server-side language run PHP, for example under WordPress, TYPO3, Magento or Shopware. The acknowledgements in the advisories credit the researcher lcfr-hax along with researchers at Wiz, Areion and OpenAI; four members of the PHP team developed the fix.
Flaw 1: when PHP runs out of memory
CVE-2026-109618 abuses the way PHP leaves a request when memory runs out. It jumps out via longjmp(). At certain moments a request's memory is already reachable but not yet fully initialised. If an allocation fails at exactly that point, PHP does not account for the early exit, and the memory is left in an invalid state. Request shutdown then reads that state and branches on it.
The attacker triggers the memory exhaustion themselves, during multipart form parsing: through unbounded headers, empty file controls or nested field names. No form in the application is required, and no login. The patch replaces the hard jump: on memory exhaustion PHP now ends the request at the next safe point in the virtual machine, and only above a higher threshold does it abort via _exit().
Flaw 2: when remnants of the previous request stay behind
CVE-2026-109619 concerns state that outlives the request it belongs to. A PHP worker handles many requests in sequence and holds global state for error handling, sessions, objects and extensions. Some of that state points to memory owned by the request and must be reset before the request frees it. Some operations, however, run before the next request is properly initialised and read the old references — a use-after-free.
The advisory separates producers from consumers, and that separation is why a single setting is not enough:
- Producers: fatal errors such as parse and compile failures, uncaught errors, a failed
requireor exceeding the maximum execution time; also memory exhaustion and diagnostics emitted during shutdown or extension cleanup. - Consumers: INI diagnostics raised before request initialisation, and session upload progress handling, which is enabled by default.
- Confirmed as RCE: the route via
fatal_error_backtraceson PHP 8.5, and the session upload progress path, triggered there through memory exhaustion. - Reachable through:
.htaccessandphp_value/php_flag/php_admin_*under Apache mod_php; conditionally under PHP-FPM viaPHP_VALUEandPHP_ADMIN_VALUEfrom a frontend; LSAPI is considered a candidate. For FrankenPHP, PHP found no early consumer in the default configuration.
What does not help: hiding error messages. error_reporting, display_errors and the @ prefix suppress the output, not the error — the producer remains.
What the leak got wrong
On 20 October an anonymous post on the Hacker News forum announced two PHP flaws, with no evidence beyond the author's trust in their source. watchTowr confirmed the same day that the flaws were real, and PHP moved the release planned for 22 October forward by a day. Anyone working from Monday's screenshots is working from several wrong figures:
| Topic | Leak of 20 October | PHP advisory of 21 October |
|---|---|---|
| Severity | CVSS 10.0 | CVSS 9.2 under v4.0 |
| Cause | session upload progress | two core flaws; upload progress is one consumer of several |
| Mitigation | turning off upload progress is enough | only the update closes both flaws |
| Affected | all versions from PHP 5 | everything before 8.2.35, 8.3.36, 8.4.27 and 8.5.12 |
For internal communication, use the advisories, not Monday's screenshots.
Which versions get a patch
According to PHP's release announcement, PHP ships security updates for its four supported branches. For the end-of-life branches 7.4, 8.0 and 8.1 the security team additionally provided minimal source backports, intended for self-built installations and for operators without an LTS vendor.
| Branch | Fixed release | Updates until |
|---|---|---|
| 8.5 | 8.5.12 | end of 2029 |
| 8.4 | 8.4.27 | end of 2028 |
| 8.3 | 8.3.36 | end of 2027 |
| 8.2 | 8.2.35 | 31 December 2026 |
| 8.1, 8.0, 7.4 | source backport or distro package | end of life |
| 7.3 and older | no patch | end of life |
Three points on this cost real time in practice. First, Debian, Ubuntu and Red Hat backport the fix into their packages without raising the version number: php -v still shows the old number, and the package changelog is what counts. Second, PHP explicitly notes that the volunteer-maintained rpms.remirepo.net repository had no update on release day, and advises moving to distribution packages; AlmaLinux initially published its packages in testing. Third, 8.2 is only covered for a limited time — patch an 8.2 server today and plan the upgrade in the same breath.
How many systems run without a vendor fix was counted by the security firm Mallory on 20 October, using publicly visible HTTP banners: more than 880,000 internet-facing hosts reported PHP 8.1 or older, 59 per cent of the roughly 1.5 million hosts that state a version. Around 740,000 more showed PHP without a version. In German-speaking Europe the share without an official patch is 41 per cent in Germany, 53 per cent in Austria and 64 per cent in Switzerland, according to Mallory. The figures describe banners, not confirmed vulnerable systems.
Interim measures when the update has to wait
PHP is unambiguous on this point: only the update is a complete mitigation. The settings below, taken from the advisories, reduce exposure but do not make an installation safe. They belong in php.ini, the FPM pool or the server configuration — somewhere the application cannot override them. ini_set() and .user.ini apply too late. Restart every worker afterwards, and rebuild containers.
; against CVE-2026-109618 (memory exhaustion)
memory_limit = -1 ; as php_admin_value, not overridable
post_max_size = 8M ; 32M if uploads are required
upload_max_filesize = 8M ; must stay below post_max_size
; against CVE-2026-109619 (stale state)
session.upload_progress.enabled = 0
fatal_error_backtraces = 0 ; PHP 8.5 only
; optional, costs performance
pm.max_requests = 1 ; FPM: one request per worker
Three things are easy to get wrong here:
memory_limit = -1is not a typo. The memory limit is the trigger the attacker wants to reach. Cap memory through containers or cgroups instead, and check that no pool, directory or application sets a finite limit.- No
RLIMIT_ASand noRLIMIT_DATA. PHP advises against them explicitly: such limits make the attack easier, not harder. - Remove errors from reachable paths. That includes execution timeouts an attacker can trigger predictably, and warnings from obsolete INI directives raised before request initialisation. Large multipart requests can additionally be capped at the web server or in the web application firewall.
End-of-life systems that cannot be updated immediately belong behind a VPN or off the public network — as CERT-EU recommended before the release.
Exploitation: what had been seen by 21 October
Several vendors report exploitation attempts; confirmed compromises, so far, none. watchTowr saw the first attempts on its sensors at roughly the time of the release, and Jake Knott, who leads threat intelligence there, told SecurityWeek: "Whilst nobody has been successful to date, we don't expect that will last long." Hadrian reported exploitation "at scale" a few hours before the release and names the session upload progress path as the one most used. Patchstack, Cloudflare and Vega also observed attempts, Vega with publicly available proof-of-concept code. Neither flaw appears in the CISA KEV catalogue as of 21 October.
That it moved quickly was to be expected. The update makes the corrected source public, and a comparison with the previous version shows where the flaw sat. When CVE-2024-4577, a PHP flaw in CGI mode on Windows, became public in June 2024, Akamai saw exploitation attempts on its honeypots within 24 hours. Here the leak came before the patch.
Update, 22 October: Amazon Threat Intelligence has since reported an exploitation attempt from 17 October, four days before disclosure. What that means for logs, hunting and patch deadlines is in the follow-up post.
A successful attack is ultimately detectable because a process starts: alert when php-fpm, php-cgi, httpd or apache2 invokes a shell, an interpreter or tools such as curl, wget or certutil.exe. Unusually frequent HTTP 500 responses and crashed PHP workers are a second signal — the exploits do not always succeed, and many crashes mean many attempts. Once a web server has started a shell, treat the system as compromised: disconnect it first, do not power it off, then preserve logs, the process list and connections, search for web shells, new files in the web root, cron jobs and accounts, rebuild, and rotate every credential held in configuration files. Assume they are known.
What helps — and why visibility decides
On patch day the problem is rarely the updating. It is the question of where PHP runs. Beyond the obvious web servers, that means hosting panels such as Plesk and cPanel, which bring several parallel PHP versions with them, Docker images, appliances with a web interface from the phone system to time tracking, Windows software with PHP built in, and intranet tools nobody has touched in years. If you do not run the web server yourself, ask your host for its patch date.
blacklens.io uses Attack Surface Management to track continuously, from the outside, which domains, services and web applications are reachable and which technologies run on them; the Sentry Agent covers internal systems. The Threat Center matches new CVEs such as CVE-2026-109618 and CVE-2026-109619 against that inventory in real time and shows whether a match rests on the exact version or only on the product, for example because a server hides its version. Without a check template for a verification scan, it flags the match for manual review. What a PHP process starts on the server is not something blacklens.io sees; that remains the job of monitoring on the host.
Frequently asked questions
- PHP2Shell is the unofficial name for two critical vulnerabilities in the PHP core, CVE-2026-109618 and CVE-2026-109619, both of which allow unauthenticated remote code execution. PHP rates them CVSS 9.2 under version 4.0 and published patches on 21 October 2026. One flaw occurs when PHP runs out of memory; the other when state from one request survives in the worker and a later request reuses it.
More articles

NIS2 supply chain: what happens between two questionnaires
Supply chain security under NIS2: what Austria's NISG 2026 and Germany's BSIG require, where questionnaires end and how to monitor suppliers continuously.
- 6 min read

HTTP2Shell: the Brotli flaw reaches far beyond Node.js
HTTP2Shell is not a new flaw but CVE-2026-111497 in any software with a Brotli decoder. Who is affected, and why the version number misleads.
- 5 min read

Node2Shell: why patching Node alone is not enough
Node2Shell exploits a flaw in the Brotli decoder that Node.js bundles. The fix ships in Node 22.23.4, 24.22.1 and 26.12.1 – and in Brotli itself.
- 5 min read
See your attack surface within 24 hours.
We set up your workspace and walk you through the first findings.
- 14 days free, all features
- No credit card required
- We walk you through your first findings