PHP2Shell (CVE-2026-109618, CVE-2026-109619): how to check, patch and detect exploitation in your logs
What the two unauthenticated PHP remote code execution flaws are, which setups and versions are affected, how to verify your real PHP version, which interim mitigations help, and which log and host signals to search for if you suspect exploitation.
Summary
- PHP2Shell is the name for two unauthenticated remote code execution flaws in PHP itself, CVE-2026-109618 and CVE-2026-109619, rated CVSS 4.0 9.2 by the PHP Foundation. Every PHP installation that serves web requests is affected until it runs a fixed release: 8.5.12, 8.4.27, 8.3.36 or 8.2.35.
- Exploitation was reported around the 21 October 2026 release, and CISA added both CVEs to its Known Exploited Vulnerabilities catalog on 26 October. Patching is the only permanent fix; the interim mitigations reduce risk but do not fully block the attack.
- No official indicators of compromise have been published. Detection therefore means looking for generic signals: worker crashes and out-of-memory errors, unusual large uploads, new PHP files in web roots, shells spawned by PHP workers and unexpected outbound connections.
PHP2Shell is the name given to two remote code execution vulnerabilities in the PHP runtime, tracked as CVE-2026-109618 and CVE-2026-109619. Both can be triggered without authentication over a normal web request, and both run attacker code with the privileges of the web worker account. Because the flaws sit in PHP itself and not in a framework or plugin, they affect custom applications, Laravel and Symfony projects, shops and every WordPress site in the same way.
This guide is written for teams that operate PHP and WordPress in production. It covers what is known about the vulnerabilities, how to find out which PHP version actually serves your traffic, which interim mitigations the PHP project recommends if you cannot patch immediately, and which signals in logs and on hosts can point to exploitation. If you are building monitoring for PHP from scratch, our PHP monitoring guide and the post on WordPress security monitoring are useful companions.
Status as of 10 November 2026: fixed releases are available, active exploitation has been reported and both CVEs are listed in the CISA Known Exploited Vulnerabilities catalog. If you run an unpatched PHP version that serves web requests, treat this as an emergency change. The UK NCSC told organisations to update immediately or take affected systems offline.
What is PHP2Shell?
PHP2Shell combines two separate flaws that were reported by researchers from Calif, Wiz and OpenAI. According to the PHP security team, the common root cause is that PHP can leave memory in a corrupted state when a request ends abnormally. A following request handled by the same worker can then run into that corrupted state.
- CVE-2026-109618: remote code execution as the web worker account through a chain that triggers out-of-memory corruption.
- CVE-2026-109619: stale global state leads to an unauthenticated heap use-after-free, which allows memory disclosure and remote code execution with web worker privileges.
The PHP Foundation rates the flaws at CVSS 4.0 9.2. Early reports that cited a score of 10.0 were wrong. A score in the critical range combined with confirmed exploitation is exactly the case where the usual prioritisation debate is short; our article on vulnerability prioritization with CVSS, EPSS and runtime context explains why a listing in the KEV catalog moves a CVE to the top of the queue regardless of the base score.
Timeline
| Date (2026) | Event |
|---|---|
| 20 October | Details of the vulnerabilities leak, one day before the planned release. |
| 21 October | The PHP project releases PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 with the fixes. Cloudflare reports that it saw early attacks before patches were available. |
| 23 October | The PHP project publishes an informational advisory about a third issue, CVE-2026-115560, in the session upload progress feature. The fix is planned for the next regular release. |
| 26 October | CISA adds CVE-2026-109618 and CVE-2026-109619 to its Known Exploited Vulnerabilities catalog. |
Which PHP versions and setups are affected?
Every PHP installation that serves web requests is affected if it runs a release older than the fixed versions. This includes all common server APIs:
- PHP-FPM behind nginx, Apache or another reverse proxy
- Apache mod_php, which the PHP project rates as the highest risk, because the attack can trigger before any application code runs
- php-cgi
- FrankenPHP
- LiteSpeed (LSAPI)
| Branch | Fixed version | Note |
|---|---|---|
| PHP 8.5 | 8.5.12 | Also set fatal_error_backtraces=0 as long as you are not patched |
| PHP 8.4 | 8.4.27 | |
| PHP 8.3 | 8.3.36 | |
| PHP 8.2 | 8.2.35 | |
| PHP 7.4, 8.0, 8.1 (end of life) | No official release | The PHP project published minimal source backports. Distribution and LTS vendors may ship patched packages; check with your vendor. |
Command-line scripts that never serve web requests are not the main target, but the CLI binary usually comes from the same package. Updating the package fixes both.
How to check which PHP version really serves your traffic
The most common mistake in an emergency patch is checking the wrong binary. A server can have several PHP versions installed, the CLI version can differ from the FPM version, and containers ship their own runtime. Check every layer:
# CLI version (may differ from the web runtime)
php -v
# PHP-FPM binary, name depends on distribution
php-fpm -v
php-fpm8.3 -v
# Debian / Ubuntu: installed PHP packages and versions
dpkg -l | grep -E "php[0-9.]*-(fpm|cli|common)|libapache2-mod-php"
# RHEL / Alma / Rocky / Fedora
rpm -qa | grep -E "^php"
# Which FPM masters are running right now
ps -eo pid,user,cmd | grep -E "php-fpm: master"
# Containers: check the image that actually runs
docker exec <container> php -v
Distribution packages often keep an older upstream version number and add the fix as a backport. In that case php -v shows something like 8.2.x with a distribution suffix, and the only reliable source is your vendor's security advisory or changelog for the package, not the upstream number.
A temporary phpinfo() page shows the version and server API from the perspective of the web server, which is useful for shared hosting. Be careful: phpinfo() exposes configuration, paths and environment variables. Protect it by IP or password, never leave it public and delete it immediately afterwards. Managed WordPress and shared hosting customers usually find the PHP version in the hosting panel or in Tools → Site Health → Info → Server in WordPress.
How to patch PHP2Shell
Upgrading to a fixed release is the only permanent fix. A practical order for most teams:
- Inventory: list every host, container image and hosting account that runs PHP for web traffic. Do not forget staging systems reachable from the internet, admin tools such as phpMyAdmin and old marketing sites.
- Prioritise by exposure: internet-facing systems first, mod_php setups before FPM, then internal systems.
- Update packages: for example
apt update && apt install --only-upgrade 'php8.3*'ordnf upgrade 'php*', or rebuild container images on the fixed base image tag. - Restart all workers: a package update does not replace code in running processes. Restart PHP-FPM (
systemctl restart php8.3-fpm), Apache when using mod_php, and FrankenPHP or LiteSpeed processes. Redeploy containers. - Verify: repeat the version checks above against the running processes, not only against the package database.
- Check the end-of-life case: if you run PHP 7.4, 8.0 or 8.1, confirm with your distribution or LTS vendor that the backport is included in your package. If not, plan the upgrade to a supported branch now; the interim mitigations are not a long-term answer.
Interim mitigations if you cannot patch immediately
The PHP project describes several mitigations. None of them fully blocks the attack; they only reduce the attack surface until the patch is in place.
For CVE-2026-109618 (out-of-memory chain)
- Set
memory_limit=-1, ideally withphp_admin_valuein the FPM pool or Apache configuration, so applications cannot override it. - Keep
post_max_sizelow: 8M if the application accepts no uploads, 32M if it does. - Set a container or cgroup memory limit that kills only the affected worker, so a runaway request does not take down the host.
For CVE-2026-109619 (stale global state)
- Set
session.upload_progress.enabled=0and restart all workers. This also follows the PHP project's recommendation for the third issue, CVE-2026-115560.
For PHP 8.5
- Set
fatal_error_backtraces=0and restart.
; PHP-FPM pool, e.g. /etc/php/8.3/fpm/pool.d/www.conf
php_admin_value[memory_limit] = -1
php_admin_value[post_max_size] = 8M
php_admin_value[upload_max_filesize] = 8M
php_admin_flag[session.upload_progress.enabled] = off
; PHP 8.5 only:
; php_admin_flag[fatal_error_backtraces] = off
# Apache with mod_php, in the vhost or server config
php_admin_value memory_limit -1
php_admin_value post_max_size 8M
php_admin_flag session.upload_progress.enabled off
Hiding errors does not help: changing error_reporting, turning off display_errors or suppressing errors with @ does not prevent the memory corruption. Because memory_limit=-1 removes PHP's own memory cap, the container or cgroup limit becomes your safety net. Watch worker memory closely while the mitigation is active, and expect more OOM kills in the kernel log.
How to detect PHP2Shell exploitation in your logs
Important: the sources available to us contain no official indicators of compromise for PHP2Shell. The signals below are generic signs of memory-corruption attacks and post-exploitation activity on PHP servers. A match is a reason to investigate, not proof of compromise, and the absence of matches is not proof that a system is clean.
Focus your search on the period from 20 October 2026, when details leaked, until the moment each system was patched. If your log retention is shorter than that, note the gap; our post on security logging and audit log retention covers how to avoid it next time.
1. Worker crashes, segfaults and abnormal request terminations
Both flaws exploit requests that end abnormally. A spike of crashed or restarted workers, especially from few source addresses, is the first signal to look at.
# PHP-FPM log: children killed by signals (SIGSEGV, SIGBUS, SIGABRT)
grep -E "exited on signal (11|7|6)" /var/log/php*-fpm.log
# Apache with mod_php: crashed children
grep -E "exit signal (Segmentation fault|Bus error|Aborted)" /var/log/apache2/error.log
# Kernel: segfaults and OOM kills of PHP processes
journalctl -k --since "2026-10-20" | grep -E "php|apache2|httpd" | grep -E "segfault|Out of memory|oom-kill"
2. Out-of-memory fatal errors
# PHP fatal errors about exhausted memory
grep -E "Allowed memory size of [0-9]+ bytes exhausted" /var/log/php*-fpm.log /var/log/php_errors.log
# Pseudo-query for a log platform: errors per minute and source IP
level:fatal AND message:"Allowed memory size" | count by 1m, client_ip
A WordPress site with a heavy plugin can produce these errors on a normal day. What matters is the change: a sudden burst, unusual endpoints, or the same client hitting many workers in a short time.
3. Unusual large POST and multipart uploads
Look for large or multipart requests to endpoints that normally do not receive uploads, and for many requests that end with 5xx or a closed connection. In nginx, add $request_length to the log format if it is missing.
# nginx access log with $request_length as last field: POSTs over 1 MB
awk '$6 ~ /POST/ && $NF > 1000000' /var/log/nginx/access.log
# Pseudo-query: POSTs ending in 502/503/504 or 499 per client
method:POST AND status:(499 OR 502 OR 503 OR 504) | count by client_ip, path | sort desc
4. New PHP files in web roots (web shells)
Remote code execution is often followed by a web shell that gives the attacker persistent access. Search for PHP files created or modified since the leak, and compare against your deployment history.
# PHP files changed since 20 October in typical web roots
find /var/www /srv -type f -name "*.php" -newermt "2026-10-20" -ls
# WordPress: PHP files in uploads should not exist at all
find /var/www -path "*wp-content/uploads*" -name "*.php*"
# WordPress core integrity, if WP-CLI is available
wp core verify-checksums
5. Unexpected child processes of php-fpm or Apache
PHP workers rarely need to start a shell. A process tree where php-fpm or apache2 spawns sh, bash, curl, wget, nc or python is a strong signal.
# Current process tree
ps -ef --forest | grep -A3 -E "php-fpm: pool|apache2|httpd"
# auditd: record all program executions by the web user (uid 33 = www-data on Debian/Ubuntu)
auditctl -a always,exit -F arch=b64 -S execve -F uid=33 -k web_exec
ausearch -k web_exec --start today
6. Outbound connections from web workers
Downloads of second-stage payloads, reverse shells and data exfiltration need outbound connections. Compare current connections of PHP processes with what the application legitimately talks to: database, cache, payment and mail APIs.
# Established connections of PHP and Apache processes
ss -tnp state established | grep -E "php-fpm|apache2|httpd"
# Pseudo-query on network or firewall logs
process:(php-fpm OR apache2) AND direction:outbound AND NOT dest_ip:(known_backends) | count by dest_ip, dest_port
Signals at a glance
| Signal | Source | Why it matters |
|---|---|---|
| Worker segfaults and restarts | PHP-FPM log, Apache error log, kernel log | Memory corruption often crashes workers before an exploit succeeds |
| Out-of-memory fatal errors | PHP error log | CVE-2026-109618 uses an out-of-memory chain |
| Large or multipart POSTs with 5xx | Web server access log | Abnormally ending requests are the trigger |
| New PHP files | File system, deployment history | Typical persistence after RCE |
| Shells and download tools under PHP | Process data, auditd | Code is running as the web worker |
| New outbound destinations | Network and firewall logs | Payload download, reverse shell, exfiltration |
What to do if you find signs of compromise
Treat any confirmed shell, unknown PHP file or unexplained outbound connection as a security incident and follow your incident response process:
- Preserve evidence first: copy logs, suspicious files and a process list before cleaning up.
- Isolate the system or take it offline, as the NCSC recommends for unpatched systems.
- Rotate every secret the web worker could read: database passwords, API keys, WordPress salts and keys in
wp-config.php, and.envfiles. - Rebuild from a known-good image or backup and patch before bringing it back online, rather than trying to clean a compromised host.
- Check what the worker account could reach: other sites on the same server, shared file systems and internal services. This is where least privilege for pools and users pays off.
PHP2Shell checklist
PHP2SHELL CHECKLIST
[ ] Inventory of all hosts, images and hosting accounts running PHP for web traffic
[ ] Running PHP version verified per system (FPM / mod_php / container), not only CLI
[ ] Upgraded to 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35 or vendor backport confirmed
[ ] All workers restarted, containers redeployed
[ ] EOL branches (7.4, 8.0, 8.1): vendor backport confirmed, upgrade planned
[ ] Until patched: memory_limit=-1 via php_admin_value, low post_max_size,
cgroup/container memory limit, session.upload_progress.enabled=0,
fatal_error_backtraces=0 (8.5)
[ ] Logs since 20 Oct searched: segfaults, OOM errors, large POSTs with 5xx
[ ] Web roots checked for new PHP files, wp-content/uploads checked
[ ] Child processes of php-fpm/apache and outbound connections reviewed
[ ] Findings documented, secrets rotated where compromise is suspected
FAQ
Is WordPress affected by PHP2Shell?
Yes, if the PHP version that runs WordPress is not patched. The flaws are in PHP, not in WordPress core or plugins, so updating WordPress alone does not help. On managed hosting, ask your provider whether the PHP runtime has been updated and workers restarted.
Do I need a login or a vulnerable plugin to be attacked?
No. Both CVEs are unauthenticated and are triggered through web requests. With mod_php, the PHP project says the attack can trigger before any application code runs.
Is the CVSS score 9.2 or 10.0?
The PHP Foundation rates both flaws at CVSS 4.0 9.2. Early reports with 10.0 were wrong. With confirmed exploitation, the exact score makes no difference to the urgency.
Is a web application firewall enough?
No mitigation replaces the patch. The PHP project lists configuration changes that reduce the risk, and states that none of them fully blocks the attack. Filters in front of the application can add a layer, but they are no substitute for the update.
What about CVE-2026-115560?
It is a third, separate issue in the session upload progress feature, published by the PHP project as an informational advisory on 23 October. The fix comes with the next regular release; until then the project recommends disabling session upload progress.
How Obseria helps
Obseria does not patch PHP and does not block attacks; it helps you see what happens on your PHP servers and find signals like the ones above faster. The PHP integration collects traces, metrics and logs from PHP applications, and security log analytics keeps web server, PHP-FPM and host logs searchable in one place.
- Host signals: workload threat detection uses host logs to flag suspicious behaviour such as new processes, cryptominers or reverse shells. It is detection only; nothing is blocked.
- Web attacks: app and API threat detection spots attack patterns and scanning in access logs, again without blocking.
- Rules and investigation: Cloud SIEM runs detection rules on security events, and free-form search across security data supports threat hunting for the queries in this guide.
- Patch tracking: vulnerability management gives you one list to prioritise and document patch status; it is filled from a fixed rule set, not from your live telemetry.
Want to search your own PHP and host logs this way? Start a free trial and connect your first servers.