PHP core use-after-free (PHP2Shell) gives unauthenticated RCE, exploitation reported
A stale-state use-after-free in the PHP runtime lets unauthenticated attackers run code as the web worker. Apache mod_php carries the highest risk. Attacks were reported on disclosure day. Update to 8.5.12, 8.4.27, 8.3.36 or 8.2.35 and restart every worker.
On 2026-10-21, watchTowr honeypots observed exploitation of both PHP2Shell CVEs. Cloudflare's CTO reported early attacks before the patches shipped. Neither PHP nor the NCSC has confirmed exploitation.
What you need to know
- Exposure: PHP 8.2 through 8.5 below the fixed releases. PHP says every installation serving web requests is at risk (FPM, mod_php, php-cgi, FrankenPHP, LiteSpeed), with mod_php at highest risk.
- Impact: unauthenticated remote code execution as the web worker account. Memory disclosure can also leak passwords, tokens and API keys from other requests.
- Exploitation: watchTowr and Cloudflare reported attacks on 2026-10-21, some before the patch shipped. The CVE is not in CISA KEV and no actor has been named.
- Fix: update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35 and restart every PHP worker. Configuration stopgaps are partial only.
- Detect: look for multipart requests followed by memory-limit errors, repeated HTTP 500s or worker crashes. Then look for new files in web roots.
What's happening
CVE-2026-109619 is a use-after-free in the PHP core runtime. It lets an unauthenticated remote attacker disclose memory and execute code with the privileges of the web worker account 1. PHP disclosed it on 2026-10-21 together with sibling CVE-2026-109618 and shipped fixes in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 2,3. Researchers call the pair PHP2Shell 7. Wiz demonstrated pre-authentication code execution against WordPress, Drupal and Joomla. It also showed memory disclosure that works regardless of the application and can expose secrets from other requests 8.
PHP says all installations that serve web requests are at risk, naming PHP-FPM, Apache mod_php, php-cgi, FrankenPHP and LiteSpeed 2. It rates the risk highest for mod_php, where an unauthenticated request can start the attack before any application code runs 2. The technical advisory describes FPM and LSAPI as conditionally exposed through early configuration paths, and says FrankenPHP showed no equivalent default path but is not immune 1. PHP's advisory lists ranges only for the four supported branches 1. Wiz says every PHP version back to 5.4 is affected by at least one of the two PHP2Shell CVEs, Google Cloud reports older releases affected, and the NCSC says all versions may be affected 8,4,6. Siemens says RUGGEDCOM APE1808 devices running PAN-OS are affected 5. BleepingComputer cites a VirusTotal estimate of more than 5.1 million PHP hosts exposed online 9.
watchTowr says its honeypots observed in-the-wild exploitation of both CVEs on 2026-10-21, but it published no request details or counts 7. Per BleepingComputer, Cloudflare CTO Dane Knecht said Cloudflare saw early attacks against the two flaws before the patches shipped 9. Neither source says which CVE was used. PHP's advisory does not report observed exploitation 2. A proof-of-concept tool named PHP2Shell surfaced before the embargo ended, and watchTowr confirmed the leaked flaws were real 7. Wiz built its own exploit script and demonstrated it against current WordPress, Drupal and Joomla container images 8.
How it works
PHP keeps global state that points into memory owned by a single request 1. If that state is not reset before the request heap is freed, a later request served by the same persistent worker can use the dangling pointer 1. The state can survive in two ways 1: - A fatal error, including out-of-memory or an execution timeout, abandons an operation before its reset runs. - A diagnostic raised during shutdown repopulates state that was already cleared. The advisory tags CWE-416 along with CWE-755, CWE-824, CWE-1325 and CWE-1419 1.
PHP confirms two paths 1:
- The PHP 8.5 fatal-error backtrace feature, which is the basis of the confirmed mod_php RCE.
- The session upload-progress lifecycle, validated against mod_php and FPM.
Upload progress is enabled by default and works without the application calling session_start(), though exploitation still needs an interrupted request and a follow-up request on the same worker 1. PHP describes other error, exception, object and extension state as conditionally reachable, and the patch resets that wider state too 1. Wiz says the vulnerable code is more than a decade old and that likely untracked variants exist 8. Hiding warnings with error_reporting, display_errors or @ does not protect 1,2.
The attack spans multiple requests that must reach the same PHP worker 1. More workers and worker recycling lower the success rate per request but do not remove the condition 1. PHP rates the issue CVSS v4.0 9.2, with high attack complexity and attack requirements present 1. The CVSS v3.1 score shown here is 8.1 (AC:H). Early claims of a 10.0 score 10 are contradicted by PHP's rating. Wiz maps the individual bugs to the two CVE IDs differently from PHP 8. This brief follows the vendor mapping, in which CVE-2026-109619 covers the stale global state issue 1.
What to do
In order of priority- 1
Update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, then restart every PHP worker. PHP says this is the only reliable fix and that no complete configuration workaround exists 1.
- 2
On Google Cloud 4: - App Engine standard (PHP 8.2+) is patched automatically. - Cloud Run and Cloud Run functions are patched only if automatic base image updates are enabled. - Flexible environments and custom containers must be redeployed. - Unsupported runtimes will not be patched.
- 3
For PHP 8.1 and older, use one of the following, then confirm the patched binary is the one serving web traffic 2,7: - a distribution or LTS vendor package; - PHP's source backports for 7.4, 8.0 or 8.1; - an upgrade to a supported branch.
- 4
Can't patch yet? Apply PHP's partial stopgaps, then restart all workers 1,2: - Set
session.upload_progress.enabled=0in php.ini, FPM pool or server config, notini_set()or.user.ini. - On 8.5, setfatal_error_backtraces=0. - Remove invalid per-request INI settings and fix reachable fatal errors. - Considerpm.max_requests=1. watchTowr considers .ini mitigations ineffective 7. - 5
Follow the sibling advisory for CVE-2026-109618 as well 2,3: - Set
memory_limit=-1administratively, in a way applications cannot override. - Use a conservativepost_max_size. - Enforce frontend limits on multipart requests. - Avoid RLIMIT_AS and RLIMIT_DATA. After patching, keep upload progress disabled if you do not need it 1. - 6
Inventory PHP systems and prioritise internet-facing ones. If you can neither patch nor mitigate quickly, consider taking them offline 6.
- 7
For RUGGEDCOM APE1808 on PAN-OS, contact Siemens support. Apply Palo Alto Networks' workarounds for CVE-2026-109618 5.
- 8
Attacks were reported before the patch, so treat exposed hosts as possibly compromised 9. Preserve logs and configuration, then hunt for web shells, cron jobs and new accounts 7. Check unpatched systems for backdoors 6. Rotate credentials, tokens and API keys that PHP handled, since memory disclosure can expose them 8.
Detection
- Search PHP and web-server logs for unusually large or deeply nested multipart requests. Correlate them with PHP workers that crashed or hit their memory limit 7.
- Application logs may show little, because the bugs sit below the application layer 8. Wiz's signals are:
- multipart requests followed by memory-limit errors or repeated HTTP 500s;
- unexpectedly large or malformed
PHPSESSIDresponse cookies; - unexplained churn of PHP workers. These signals follow Wiz's bug mapping 8. - Run PHP's audit on an isolated copy. Set
log_errors=On, a workingerror_loganderror_reporting=E_ALLin startup config 1. Then review for: - warnings or deprecations raised before scripts run; - diagnostics from extension or server cleanup; - fatal, parse and uncaught errors; - 'Maximum execution time exceeded'. A clean log is not proof of safety 1. - Hunt for post-exploitation signs 7: - unexplained files or web shells in web roots; - unexpected cron jobs; - new accounts tied to PHP processes; - unexplained outbound connections from PHP worker processes.
- Validate exposure by checking the PHP version that actually serves web requests (Apache module or FPM). The CLI binary can report a different version 7.
Timeline
Wiz says it found its first PHP vulnerability in the PHP2Shell family. 8
Wiz reports the vulnerabilities to the PHP security team. 8
PHP acknowledges the reports and begins work on a coordinated fix. 8
Details leak before the embargo ends. PHP pre-announces an emergency release, and watchTowr says it has not yet seen exploitation. 10
PHP releases 8.5.12, 8.4.27, 8.3.36 and 8.2.35 and publishes GHSA-6wmf-4rv5-p3rp. 2
Cloudflare's CTO says the company is seeing early attacks before the patches ship. 9
watchTowr's honeypot network observes in-the-wild exploitation of both PHP2Shell CVEs. 7
UK NCSC publishes an alert urging inventory, patching and compromise checks. 6
Siemens publishes SSA-566512 for RUGGEDCOM APE1808 running PAN-OS. 5
Sources
- 1RCE via stale global state (GHSA-6wmf-4rv5-p3rp)PHP (php-src) · Vendor · Oct 21, 2026
- 2Security advisory: Critical remote code execution vulnerabilities, update nowPHP Group · Vendor · Oct 21, 2026
- 3RCE via OOM corruption (GHSA-w8hw-w9fx-j79w, CVE-2026-109618)PHP (php-src) · Vendor · Oct 21, 2026
- 4Responding to core PHP vulnerabilities CVE-2026-109618 and CVE-2026-109619Google Cloud · Vendor · Oct 21, 2026
- 5SSA-566512: PHP2Shell vulnerabilities in Palo Alto Networks PAN-OS on RUGGEDCOM APE1808Siemens ProductCERT · Vendor · Oct 23, 2026
- 6Critical security issue affecting PHPUK NCSC · Government · Oct 21, 2026
- 7PHP2Shell RCE Exploited: CVE-2026-109618 & CVE-2026-109619watchTowr · Research · Oct 21, 2026
- 8PHP2Shell research write-upWiz Research · Research · Oct 21, 2026
- 9PHP ships emergency patches for critical PHP2Shell flawsBleepingComputer · News · Oct 21, 2026
- 10PHP warns admins of two critical flaws, emergency patches coming tomorrowBleepingComputer · News · Oct 20, 2026
Corroborated by independent sources. Researched and drafted by the VulnDigest briefs agent from 10 sources, then checked against them by a separate review step on Oct 23, 2026.
Exploitation reports come from watchTowr honeypots and Cloudflare's CTO (via BleepingComputer). PHP and the UK NCSC have not confirmed exploitation, and the CVE is not listed in CISA KEV.
It is unclear whether observed attacks used CVE-2026-109619, CVE-2026-109618 or both. Wiz maps bugs to the two CVEs differently from PHP; this brief follows PHP's mapping.
Severity CRITICAL follows PHP's CVSS v4.0 score of 9.2. The CVSS v3.1 score of 8.1 (AC:H) comes from the CVE record, not the PHP advisory. Early claims of 10.0 are contradicted by PHP.
BleepingComputer has a separate headline saying Amazon saw exploitation 4 days before the patches. We have not reviewed that report, so first-seen stays 2026-10-21 for now.
Google Cloud and Siemens guidance was not re-checked at publication. Distro backport package versions and Palo Alto Networks PAN-OS workarounds are not listed here; check your vendor.
Spotted an error? Open an issue on sochub.io.