Security Advisory · CVSS v4.0 9.2 Critical

USDSC Security Operations · White Paper · October 21, 2026

What Is PHP2Shell (CVE-2026-109618 & CVE-2026-109619), and How Do You Know If Your Server Is Exposed?

Direct Answer

PHP2Shell is the name for two critical remote-code-execution flaws in the PHP engine itself, CVE-2026-109618 (out-of-memory corruption) and CVE-2026-109619 (stale global state). Both are rated CVSS v4.0 9.2. They affect every PHP installation that serves web requests, including PHP-FPM, Apache mod_php, php-cgi, FrankenPHP and LiteSpeed, and an unauthenticated attacker can exploit them regardless of how secure the application on top is.

The fix is PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35 (released October 21, 2026), followed by a restart of every PHP worker. Interim mitigations reduce exposure, but none of them is complete.

9.2CVSS v4.0, each CVE
5.4+PHP versions affected, per Sansec
4Fixed branches: 8.2 / 8.3 / 8.4 / 8.5
0Complete mitigations short of patching

What PHP2Shell Actually Is

Most security news about PHP sites is really news about an application: a WordPress plugin, a Magento extension, a custom form handler. PHP2Shell is different. Both flaws live in the PHP runtime, the engine that executes every one of those applications. The PHP security team's advisory says it plainly: all PHP installations serving web requests are at risk.

The name comes from a public exploit tool that chains the two bugs into a single pre-authentication attack. Security vendors including Sansec, Huntress and watchTowr now use it as shorthand for both CVEs, the way “Log4Shell” came to stand for the 2021 Log4j flaw.

CVE-2026-109618: RCE via out-of-memory corruption

When a PHP request hits its memory limit, PHP stops it partway through. According to the advisory, that interruption can happen while the request's internal data is only partially initialized, and the cleanup code that runs afterward may treat that half-built data as valid. An attacker who can deliberately trigger the out-of-memory condition at the right moment can turn the corrupted state into code execution. (Tracked as GHSA-w8hw-w9fx-j79w.)

CVE-2026-109619: RCE via stale global state

PHP-FPM and Apache don't start a fresh process for every request. Each worker handles many requests in a row, and PHP resets its internal state between them. The advisory says some request-owned state can survive after its backing memory has already been freed, and a later request handled by the same worker may use that stale state before normal initialization resets it. That is a use-after-free across request boundaries, and it is exploitable for code execution. (Tracked as GHSA-6wmf-4rv5-p3rp.)

Why mod_php is the worst case

The PHP team rates Apache with mod_php the highest risk, citing “a demonstrated exploit where an unauthenticated request can trigger the attack before any application code runs.” In other words, your login pages, security plugins and application firewall rules never get a chance to see the request.

Why Application-Level Security Doesn't Help Here

A typical PHP site's defenses all live inside the application: a hardened CMS, a security plugin, input validation, a login rate limiter. Those controls only run once PHP has parsed the request and handed it to the application. PHP2Shell attacks the parsing and lifecycle machinery that comes before any of that.

  • Updating WordPress, Magento, Drupal or your plugins does not fix PHP2Shell. Sansec reports confirming exploitability against current releases of several major platforms, including WordPress, Magento, Drupal and Joomla, and notes that “a store is exposed even when its own application code is clean.”
  • Security plugins can't block it. In the mod_php case they don't run at all before the exploit fires.
  • An edge WAF may help, but only partially. Request-size limits at the proxy reduce the CVE-2026-109618 attack surface, which is why the advisory recommends them. They aren't a fix.

Who Is Affected: Version-by-Version

PHP branchStatusWhat to do
8.5.xFIX: 8.5.12Update to 8.5.12 or later
8.4.xFIX: 8.4.27Update to 8.4.27 or later
8.3.xFIX: 8.3.36Update to 8.3.36 or later
8.2.xFIX: 8.2.35Update to 8.2.35 now, and plan an upgrade: 8.2 reaches end of life December 31, 2026
7.4 / 8.0 / 8.1NO RELEASEMinimal source backports from the PHP security team, a vendor/LTS package, or isolate
5.4 – 7.3NO FIXVendor backport, upgrade, or isolate behind a VPN/WAF

Linux distributions and LTS vendors received the patches in advance, so check your vendor's packages first. Enterprise distros often backport the fix while keeping the old version number, so a version string alone can be misleading. The PHP team specifically warned that the volunteer-maintained Remi repository would not have release-day updates, and urged Remi users to switch to distribution packages or build from source.

Disclosure Timeline

  1. August 1, 2026Research into the flaws begins, according to Sansec.
  2. October 20, 2026 (morning)A Hacker News post leaks that two critical PHP vulnerabilities are coming. It's removed quickly, but screenshots circulate, as Huntress reported. watchTowr confirms the leak is legitimate.
  3. October 20, 2026The PHP security team posts an advance warning of a critical release scheduled for October 21, rated CVSS v4.0 9.2, and reserves the right to release earlier if details go public or exploitation appears.
  4. October 21, 2026, 07:43 UTCSansec reports that Cloudflare observed early attacks against PHP sites, before patches were available.
  5. October 21, 2026PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 are released, along with source backports for 7.4, 8.0 and 8.1.

Reports on exploitation are still changing. As of mid-morning ET on October 21, Huntress had not seen exploitation across its partner base, while other researchers were seeing attacks emerge. Sansec expects mass exploitation as technical writeups follow the patches. Plan for the worst case: assume exploit code is or soon will be widely available.

How to Check Whether Your Server Is Exposed

The quickest answer is our free, read-only PHP2Shell exposure check script. It finds every PHP binary on a host, compares each against the fixed release, detects vendor backports, flags mod_php, and reports which interim mitigations are in effect for each SAPI. If you'd rather check by hand, these are the questions to answer:

  1. Which PHP builds are on the box, not just which one php -v reports?

    Multi-version hosts are common: php8.2, php8.4, an old php7.4 left behind for one legacy site. Check ls /usr/bin/php* /usr/sbin/php-fpm* plus any vendor paths under /opt.

  2. Which build serves web traffic?

    Check your vhosts for SetHandler "proxy:unix:/run/php/phpX.Y-fpm.sock" and run apachectl -M | grep php to see if mod_php is loaded at all.

  3. Is that build at or above the fixed release, or vendor-backported?

    Compare the version with the table above. On Debian and Ubuntu, zgrep CVE-2026-10961 /usr/share/doc/phpX.Y-fpm/changelog.Debian.gz shows a backport. On RHEL-family systems, use rpm -q --changelog.

  4. Have the workers restarted since the update?

    Compare the php-fpm master's start time (ps -o lstart= -C php-fpm8.4) with the package install time. A patched binary on disk does nothing for a worker that loaded the old one.

Interim Mitigations (When You Can't Patch Today)

The PHP team is explicit that no complete mitigations exist. Updating is the only safe choice. If you need hours or days to roll out a patched build, these settings reduce exposure to specific attack paths. Set them in php.ini, the FPM pool, or Apache config via php_admin_value/php_admin_flag, never with ini_set() or FPM .user.ini, and restart workers afterward.

CVESettingValueTrade-off
109618memory_limit-1Removes the controllable PHP OOM path. Pair it with container or cgroup memory limits that kill the single worker, not RLIMIT_AS/RLIMIT_DATA.
109618post_max_size8M (no uploads) / 32M (uploads)Breaks large uploads above the limit. Keep upload_max_filesize below it.
109618Proxy / web-server limitsLowCap decoded body size, input fields, multipart parts, headers and nesting depth at the edge.
109619session.upload_progress.enabled0Disables upload progress bars that rely on the session. Rarely used.
109619fatal_error_backtraces (8.5 only)0Less detail in fatal error logs.
109619Application hygiene—Remove invalid or deprecated per-request settings that emit diagnostics early. Fix attacker-reachable fatal errors and timeouts.
# Example: PHP-FPM pool (e.g. /etc/php/8.4/fpm/pool.d/www.conf)
php_admin_value[memory_limit] = -1
php_admin_value[post_max_size] = 32M
php_admin_value[upload_max_filesize] = 16M
php_admin_flag[session.upload_progress.enabled] = off

# then restart the whole master, not a graceful reload of one pool
systemctl restart php8.4-fpm

Setting memory_limit=-1 on its own is risky: one runaway request can then exhaust the host's memory. Only use it with a per-worker memory cap from systemd, cgroups or your container runtime, so the kernel kills the single offending worker instead of PHP failing mid-request.

Detection: What Compromise Might Look Like

No confirmed indicators of compromise had been published as of this writing. Based on the vulnerability classes and early vendor guidance from Sansec and Huntress, watch for:

  • Unusual multipart requests followed by memory-limit errors or bursts of HTTP 500 responses.
  • Unexpectedly large or malformed PHPSESSID cookies.
  • Unexplained PHP worker crashes or restarts in the php-fpm or Apache error logs.
  • Shells, interpreters or download tools (sh, bash, python, curl, wget) spawned as children of php-fpm, apache2, httpd or php-cgi.
  • Reverse-shell patterns such as /dev/tcp/, fsockopen or mkfifo in process arguments or newly written PHP files.

If you find any of these on a host that was vulnerable, treat it as an incident response, not a patch job. Patching closes the door, but it doesn't remove anyone who already got in.

The Real Lesson: “We Ran the Update” Is Not the Same as “We're Patched”

Most of our white paper library makes one argument: in modern engineering, the failure mode has moved from “can you produce the fix” to “can you prove the fix actually landed.” PHP2Shell is a textbook case. Each of these looks done and isn't:

Field Notes · Release Day

The repo didn't have the fix yet. Hours after PHP published the fixed releases, a widely used third-party PHP package repository we checked was still offering a pre-fix build as its newest version. apt upgrade would have finished cleanly and installed a vulnerable package. The only way to know was to compare the candidate version against the fixed release.

The CLI lied about the web server. On the same release-day sweep, php -i from the command line reported memory_limit = -1, which looks mitigated. The FPM pool actually serving traffic on that host was set to several gigabytes. The CLI and FPM SAPIs read different ini files. Checking the one you can easily reach isn't the same as checking the one attackers reach.

The “other” PHP. Multi-version hosts routinely carry an old PHP build kept for one legacy app, often with mod_php still loaded even though modern vhosts use FPM. One patched binary says nothing about the others.

None of these needs a clever fix. Each needs someone to verify against ground truth: the running worker, the effective config, the actual package version. That is why we built the check script to read each SAPI's config separately and to treat “version looks fine” as a claim to be checked against the changelog. If you take one practice from this incident, make it this: after you patch, re-run the check and confirm the result from the system itself.

Frequently Asked Questions

What is PHP2Shell?

PHP2Shell is the common name for two critical PHP engine vulnerabilities, CVE-2026-109618 and CVE-2026-109619, disclosed October 21, 2026. Both allow unauthenticated remote code execution, carry a CVSS v4.0 score of 9.2, and affect PHP-FPM, Apache mod_php, php-cgi, FrankenPHP and LiteSpeed.

Which PHP versions fix PHP2Shell?

PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. PHP 8.1, 8.0 and 7.4 get no official release, only minimal source backports from the PHP security team. Older versions need a vendor backport or an upgrade.

Is my WordPress site affected by PHP2Shell?

If it runs on an unpatched PHP version, yes. PHP2Shell is in the PHP engine, not WordPress, so updating WordPress core or plugins doesn't help. Ask your host which PHP build serves your site, or run our check script if you have server access.

Is PHP2Shell being exploited in the wild?

Sansec reports that Cloudflare observed early attacks on October 21, before patches shipped, and expects mass exploitation. Huntress had not observed exploitation across its partner base as of that morning. Treat it as actively targeted.

Can I mitigate PHP2Shell without patching?

Only partially. The PHP team lists interim settings (memory_limit=-1, a low post_max_size, session.upload_progress.enabled=0, and on 8.5 fatal_error_backtraces=0) and states that no complete mitigation exists. Updating is the only safe option.

Do I have to restart PHP after updating?

Yes. Restart every php-fpm master and Apache. Workers already running keep the vulnerable code in memory until they restart.

My host says I'm on PHP 8.3.6. Am I vulnerable?

Possibly not. Distro packages often backport security fixes without changing the upstream version number. Check your distro's security advisory or the package changelog for the CVE IDs. Our check script does this automatically.

Patch It Once, and Prove It Worked

USDSC handles emergency PHP upgrades, worker restarts, mitigation rollout and post-patch verification for WordPress, WooCommerce and custom PHP stacks, and we confirm the fix on the running system instead of assuming it landed.

Sources