PHP2Shell (CVE-2026-109618 / CVE-2026-109619): pre-auth RCE in the PHP engine
Two memory-safety flaws in PHP's request lifecycle (CVSS 4.0 9.2, on CISA KEV) allow unauthenticated RCE before any application code runs. Root cause, exposure checks, detection and the fix.
PHP2Shell is the name for two engine-level PHP flaws disclosed on 21 October 2026. Both are in CISA’s Known Exploited Vulnerabilities catalog. Because the bugs are in the interpreter and not in any framework, your application code doesn’t matter: a patched WordPress or Laravel on an unpatched PHP binary is still exposed. This is one of three “2Shell” bugs I’m covering today. The other two are Node2Shell and Java2Shell.
Scope and ethics. This post covers architecture, exposure checks, detection and remediation for systems you own or are authorized to assess. It contains no trigger inputs or exploit code. Lab validation means confirming a version and config on a VM you control, not firing a PoC at someone else’s server.
At a glance
| CVEs | CVE-2026-109618 (OOM memory corruption), CVE-2026-109619 (stale request state) |
| Severity | CVSS 4.0 9.2 Critical, AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H (PHP CNA, via NVD) |
| CWE | CWE-416 Use After Free (NVD). CISA additionally lists CWE-755, -824, -1325, -1419 |
| Fixed in | PHP 8.5.12, 8.4.27, 8.3.36, 8.2.35 (21 Oct 2026). Minimal source backports exist for 7.4, 8.0, 8.1 |
| Exploited? | Yes. CISA KEV, added 26 Oct 2026 (federal due date 29 Oct), with forensic triage required |
| Auth / interaction | None / none |
Description: how the bugs work
Both bugs are in how PHP handles a request from setup to teardown. Each request gets its own memory arena. When the request ends, PHP’s cleanup routines walk the request’s internal structures and free them, and the next request starts from a clean slate. Both bugs break the assumption that the slate really is clean.
CVE-2026-109618: out-of-memory corruption. When PHP runs out of memory it doesn’t return an error up the call stack. It uses longjmp() to jump straight out of whatever it was doing and abort the request. NVD’s description: some code paths “leave request memory in an uninitialized state before performing an allocation.” If an OOM hits in that window, the structure is only half built, and the cleanup that runs next reads or branches on uninitialized memory as if it were valid. The attacker controls the request, so they can choose where the OOM lands. Qualys’s analysis points at multipart form handling as the practical trigger area.
CVE-2026-109619: stale request state (use-after-free). PHP keeps several global pointers that temporarily point into request memory. In some paths a global isn’t reset at the end of a request, or it gets repopulated after being reset. The request memory is freed, but the global still points at it. The next request handled by the same worker reads or branches on that stale pointer before it’s reinitialized. That’s a classic cross-request use-after-free.
Both bugs fire during request setup and teardown, before your index.php runs. That’s why a WAF rule tuned to application routes won’t see them, and why patching the app does nothing.
Impact
- Remote code execution as the web server or PHP worker user (
www-data,apache,nginx, and so on). - Memory disclosure. Researchers showed unauthenticated reads of PHP worker memory, which can leak session tokens, database passwords and API keys from other users’ requests.
- Privilege escalation chains. Unit 42 reports PHP2Shell chained with a Linux kernel LPE to reach root, including against internet-facing PAN-OS management interfaces (PAN-OS embeds PHP).
Which deployments are exposed
| SAPI / server | Status |
|---|---|
Apache mod_php |
Highest risk. PHP says a single unauthenticated request can trigger exploitation before app code runs. The demonstrated config is prefork MPM with default limits |
PHP-FPM (nginx, Apache proxy_fcgi, Caddy) |
Affected. Startup behavior blocks one OOM path, but PHP validated RCE through the session lifecycle on FPM “under suitable application conditions” |
php-cgi, FrankenPHP, LiteSpeed |
Listed as affected by NCSC-NL and Help Net Security |
| Appliances with embedded PHP | Check the vendor. PAN-OS/Panorama, Trend Micro Apex One/Central, Xerox and X-Cart have published advisories |
Prerequisites: network reachability to a PHP endpoint, a pre-fix PHP build, no credentials, and no user interaction. Attack complexity is rated High. Reliability depends on allocator layout, build and worker scheduling, and the stale-state path needs two requests to land on the same worker. Don’t let “high complexity” slow you down: exploitation is confirmed, and Amazon’s MadPot honeypot logged an attempt four days before disclosure (17 Oct).
Identifying affected systems
Check the PHP that actually serves requests, not whatever php happens to be on $PATH. Qualys specifically warns that the CLI binary often differs from the FPM or mod_php build.
# 1) Every PHP binary/package on the host (CLI, FPM, Apache module)
php -v
ls /usr/sbin/php-fpm* /usr/lib/apache2/modules/libphp*.so 2>/dev/null
dpkg -l | grep -E '^ii\s+(php|libapache2-mod-php)' 2>/dev/null || rpm -qa | grep -i '^php'
# 2) Which SAPI is live? (mod_php shows up as php_module / php7_module)
apachectl -M 2>/dev/null | grep -i php
systemctl list-units --type=service | grep -i fpm
# 3) Version as seen by the web tier: drop a temporary file you DELETE afterwards
echo '<?php echo PHP_VERSION, " ", PHP_SAPI;' | sudo tee /var/www/html/.v.php >/dev/null
curl -s http://127.0.0.1/.v.php; sudo rm -f /var/www/html/.v.php
# 4) Containers: check the image, not the host
docker ps --format '{{.Image}}' | sort -u | xargs -I{} sh -c 'echo -n "{}: "; docker run --rm --entrypoint php {} -r "echo PHP_VERSION;" 2>/dev/null; echo'
Distro backports: RHEL, Debian and Ubuntu often fix PHP without changing the upstream version string. A RHEL 9 host can say 8.4.x and still be patched or unpatched. Check the package changelog or advisory instead: rpm -q --changelog php-common | grep -E 'CVE-2026-10961[89]', or apt changelog php8.x-common | grep .... Known errata include RHSA-2026:97880, USN-8948-1/2, DLA/DSA for php8.2/8.4, ALAS2023-2026-3301..3304, and SUSE-SU-2026:4843-1/4844-1.
Fleet scanners: Qualys QID 533086 (PHP2Shell). Qualys warns that QID 533068 is intrusive and may crash unpatched systems, so don’t run it against production.
Safe validation in an isolated lab
You don’t need to trigger the bug to confirm you’re fixed. A useful lab exercise is checking that your detection and patch process works end to end:
- On an isolated VM with no route to production, deploy a pre-fix image (for example
php:8.4.26-apache) and the fixed one (php:8.4.27-apache) side by side. - Run your version checks and scanner against both. The scanner should flag only the old one. If it flags neither, your tooling is reading the wrong binary.
- Apply the interim config below to the old one and confirm it shows up in
php -i/phpinfo(). - Generate benign web-shell-like activity (e.g.
www-datarunningidvia a test script) and confirm your EDR or SIEM rule from the detection section fires.
Detection and threat hunting
PHP2Shell traffic hits the engine before any app routing, so focus on post-exploitation behavior of the PHP worker.
- Child processes of PHP workers.
php-fpm,apache2/httpd(mod_php) orwww-dataspawningsh,bash,curl,wget,python,perl,nc,base64 -d, orchmod +xin/tmp,/dev/shmor/var/tmp. Unit 42’s Cortex XQL hunting query follows this model. They note it isn’t PHP2Shell-specific.# quick live check: anything running under a PHP worker that isn't a PHP worker for p in $(pgrep -f 'php-fpm|apache2|httpd'); do ps --ppid "$p" -o pid=,user=,cmd= ; done | grep -vE 'php-fpm|apache2|httpd' - Session files. Public PoCs stage attacker-controlled data into a real session file. Review
session.save_path(often/var/lib/php/sessions) for unusually large or binary session files. - Worker crashes. Bursts of
child exited on signal 11 (SIGSEGV)in FPM logs, orAH00052: child pid ... exit signal Segmentation faultin Apache’s error log, can mean failed attempts. - Network. Palo Alto NGFW threat ID 543004, plus Cloudflare’s free managed WAF rules for PHP2Shell. Watch for oversized or unusual
multipart/form-dataPOSTs to endpoints that never take uploads. - Cloud credentials. Requests to
169.254.169.254from the web tier right after anomalous POSTs.
Because exploitation is active and pre-dates disclosure, treat any internet-facing instance unpatched since 17 October as potentially compromised, and hunt before you declare it clean.
Remediation
- Upgrade PHP to 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35 or later (later monthly releases include these fixes), or install your distro’s errata. PHP’s own words: there are no complete mitigations short of updating.
- Restart every PHP worker. A new package on disk does nothing for an FPM master or Apache parent started last month:
systemctl restart php*-fpm apache2(orhttpd). - Rebuild containers from patched base images and redeploy. Pinned tags like
php:8.4.26-*keep the bug. - Get off EOL PHP (≤ 8.1). Source backports exist, but no official binaries do.
- Appliances: apply vendor fixes (PAN-OS/Panorama, Trend Micro, Xerox and others) and take management interfaces off the internet.
Interim hardening (if you truly can’t patch today)
These reduce attack surface but aren’t fixes:
; php.ini: reduce exposure until the update is applied
session.upload_progress.enabled = 0 ; NCSC-NL: keep 0 until the next regular PHP release
post_max_size = 8M ; or 32M if you accept uploads, with upload_max_filesize below it
; PHP 8.5 only:
fatal_error_backtraces = Off
- For FPM,
pm.max_requests = 1recycles a worker after each request, which breaks the cross-request stale-state path. Expect a significant performance cost. - Block
multipart/form-dataat the proxy for routes that never accept uploads. - Note that the
session.upload_progresssetting is tied to companion CVE-2026-115560 in PHP’s 23 Oct advisory, so treat it as defense in depth and not a fix for 109618/109619. - Hiding errors (
display_errors=Off,@) does not prevent the underlying memory access.
References
- CVE-2026-109618, NVD · CVE-2026-109619, NVD
- CISA KEV catalog · CISA alert, 21 Oct 2026
- PHP security release announcement · PHP follow-up advisory
- NCSC-NL operational info (versions, vendor status)
- Unit 42 threat brief (exploitation, hunting query)
- Qualys: find, mitigate and patch
- Help Net Security coverage
- Palo Alto Networks advisory
Verify every version against the vendor advisory before acting. Published 20 Nov 2026.