TL;DR#

Patch PHP now. Upgrade to 8.5.12, 8.4.27, 8.3.36 or 8.2.35 (or your distro's or control panel's patched build), then fully restart every PHP worker. The PHP project says there is no complete configuration-only mitigation, and both CVEs are being exploited in the wild.
  • Both flaws allow unauthenticated remote code execution and are rated CVSS v4.0 9.2.
  • Fixed releases shipped on October 21, 2026. CISA added both CVEs to its Known Exploited Vulnerabilities catalog on October 26, 2026.
  • Every PHP install that serves web requests is in scope. Apache with mod_php is the highest-risk setup.
  • A WAF can reduce exposure a little. It is not a fix.

What PHP2Shell is#

"PHP2Shell" is the name given to two memory-safety bugs in the PHP interpreter itself, not in WordPress, Laravel, or any other application. Researchers report that the earliest affected code dates back to PHP 5.4, released in 2012.

  • CVE-2026-109618 ("RCE via OOM corruption"): when PHP runs out of memory while it's still building the internal data for a request, it aborts with that data half-initialized, and the cleanup step can then treat invalid data as valid.
  • CVE-2026-109619 ("RCE via stale global state"): some per-request state can outlive the memory it points to, so a later request handled by the same worker can act on leftover data.

The part that matters for defenders: PHP automatically parses incoming request data, including $_POST, $_FILES and multipart uploads, before your script starts. PHP's advisory says request startup and automatic body parsing can exhaust memory_limit before the script runs, and that under Apache mod_php the whole sequence can happen "entirely before any application-specific code begins execution." Your app's input validation, login checks and security plugins never get a say.

The fix was released ahead of schedule after details leaked publicly on October 20. Exploitation attempts were reported around and before disclosure, and the Canadian Centre for Cyber Security's advisory now states both CVEs are exploited in the wild.

Am I affected?#

Assume yes unless you can prove otherwise. Officially:

BranchVulnerableFixed in
8.5.xBefore 8.5.128.5.12
8.4.xBefore 8.4.278.4.27
8.3.xBefore 8.3.368.3.36
8.2.xBefore 8.2.358.2.35
8.1 / 8.0 / 7.4All upstream releasesNo upstream release; source patches only. Use your distro, panel or LTS vendor's backport.
7.3 and olderAllNo fix. Upgrade to a supported branch.

How PHP is wired into your web server changes the risk, but not whether you need to patch:

  • Apache mod_php: highest risk. PHP's advisory notes that mod_php runs request shutdown even when request startup has failed.
  • PHP-FPM (typical with Nginx, and the default on newer RHEL): lower risk at startup, because FPM exits the child when startup fails, but still susceptible. The discoverers describe FPM exposure as application-dependent.
  • php-cgi, LiteSpeed (LSAPI), FrankenPHP: also in scope per the advisories.

Check your version and how PHP is served:

# CLI version (see the caveat below)
php -v

# Does Apache load mod_php? Any php_module line means yes.
sudo apache2ctl -M 2>/dev/null | grep -i php     # Debian/Ubuntu
sudo httpd -M 2>/dev/null | grep -i php          # RHEL family

# Which PHP-FPM services are running?
systemctl list-units --type=service --state=running 'php*-fpm*'
Don't trust the version string alone. Distros and panels backport fixes without changing the upstream number. Ubuntu 24.04 still reports PHP 8.3.6 after patching, and Plesk's and cPanel's patched 7.4/8.0/8.1 builds keep their old version numbers. Check the package changelog or build date instead (commands below). Also remember the CLI php can be a different build from the one your web server runs.

How to patch#

Ubuntu and Debian

Ubuntu published USN-8948-1 on October 21 (e.g. 24.04 LTS: php8.3 8.3.6-0ubuntu0.24.04.13; 22.04 LTS: php8.1 8.1.2-1ubuntu2.28). Ubuntu 20.04 and 18.04 fixes come through Ubuntu Pro. Debian fixed trixie in DSA-6574-1 (php8.4 8.4.27-1~deb13u1) and bookworm in DLA-4848-1 (php8.2 8.2.35-1~deb12u1).

sudo apt-get update
apt list --upgradable 2>/dev/null | grep php
sudo apt-get install --only-upgrade 'php8.*' 'libapache2-mod-php8.*'

# Verify: the changelog should mention the CVEs (adjust the branch)
zgrep -E 'CVE-2026-10961[89]' /usr/share/doc/php8.3-cli/changelog.Debian.gz

If you use the ondrej/Sury PPA, its patched 8.2+ builds carry the upstream fixed version numbers. For 8.1, 8.0 and 7.4 it only bumps the package revision, so verify with the changelog.

RHEL and derivatives

Red Hat's bulletin RHSB-2026-013 covers RHEL 7 through 10. Install the updated php packages for your stream when they're available, and rebuild any containers based on RHEL/UBI images.

cPanel/WHM

EasyApache 4 shipped ea-php85 8.5.12, ea-php84 8.4.27, ea-php83 8.3.36 and ea-php82 8.2.35, plus backports for ea-php81/80/74 that keep their old version strings. Update every installed ea-php* package (and CloudLinux alt-php* if you use it), then check each with rpm -q --changelog <package> | grep CVE-2026-109618. cPanel's own internal PHP is a separate package with its own update.

Plesk

Plesk shipped fixed PHP handlers (8.2.35, 8.3.36, 8.4.27, 8.5.12) and rebuilt 7.4.33, 8.0.30 and 8.1.34 on Linux. For those three, a build date of October 21, 2026 or later is what tells you it's fixed. Plesk's own engine is fixed in Obsidian 18.0.81 Update 4 and 18.0.80 Update 11. Install all available updates, then check, for example, /opt/plesk/php/8.3/bin/php -v.

Then restart everything

Fully restart PHP-FPM and Apache (a reload is not enough per Red Hat), plus queue workers, Supervisor jobs and any long-running PHP processes. Old code stays in memory until the process is replaced. If you run bundled PHP in appliances, Docker images or vendor products, those need their own updates.

Interim mitigations (if you truly can't patch today)#

PHP, Red Hat and Plesk all list partial measures. All three are clear that these reduce exposure and do not make a server safe:

  • For CVE-2026-109619: set session.upload_progress.enabled=0 in php.ini, the FPM pool, or the server config, then restart every worker. On PHP 8.5, also set fatal_error_backtraces=0.
  • For CVE-2026-109618: PHP suggests memory_limit=-1 set so applications can't override it, plus a low post_max_size (8M without uploads, 32M with). Removing PHP's memory cap has its own risk, so keep a container or cgroup limit around it. Do not use RLIMIT_AS or RLIMIT_DATA, which both PHP and Red Hat warn make things worse.
  • Use php_admin_value (FPM pool or Apache config) rather than ini_set() or .user.ini, and audit .htaccess and .user.ini files that could switch settings back.
  • If an internet-facing server can't be patched, the Canadian Cyber Centre's advice is to isolate it from public networks.
A third CVE, still unpatched upstream: on October 23 PHP published an informational advisory for CVE-2026-115560, which the October 21 releases do not fix. It only affects apps that switch session.serialize_handler to php at runtime, and the mitigation is the same session.upload_progress.enabled=0. PHP plans the fix for a regular release. If you don't use upload progress bars, leaving this off after patching is a reasonable default.

Can a WAF stop it?#

Short answer: no, not reliably. A WAF is a layer, not a patch.

The core problem is timing and position. A WAF inspects requests before they reach your server, which sounds ideal for a bug that fires before your app runs. But the bug lives in how PHP's parser reacts to memory pressure and error states, and that's not something a WAF can see. There's no fixed signature: a request that's perfectly harmless to one server can push another over its memory_limit, depending on configuration, application, and what else the worker is doing. Attackers can vary field names, part layouts and encodings, and PHP's advisories note that both bugs can also be reached through application-specific paths, not just the request parser. Some vendors shipped emergency rules for known exploit vectors. Those are useful cover, but they're scoped to what was known when the rules were written.

What a WAF or reverse proxy can do is shrink the space an attacker has to work with. PHP's own advisory points in this direction, recommending that the decoded request size be enforced "at the frontend" and that unused multipart be blocked "before they reach PHP." Reasonable measures:

  • Request-body size limits that match what each endpoint really needs, not a single generous global value.
  • Multipart limits: caps on the number of parts, headers per part, and field-name nesting depth.
  • Reject malformed multipart (bad boundaries, inconsistent headers) rather than passing it through.
  • Block multipart entirely on paths that never take uploads or form posts.
  • Refuse unexpected bodies without a usable declared length, such as chunked request bodies on endpoints that don't need them. PHP's advisory notes that a multipart request with no usable declared length may pass the initial post_max_size check.

One big caveat: all of this only works if the WAF actually buffers and inspects request bodies. Many setups only look at headers and the URL, or stop reading after the first few kilobytes, or skip bodies above a size threshold. A WAF that doesn't read the body can't enforce limits on it.

A managed ruleset like OWASP CRS, which ShieldIngress runs for customers, is very good at blocking whole classes of attacks: SQL injection, cross-site scripting, path traversal, scanners, and more. That's why it's worth having. But a memory-corruption bug inside the language runtime is not a class of attack a ruleset can close. For PHP2Shell, the update is the fix.

Checklist#

  1. Inventory every PHP install that serves web traffic, including panels, containers, appliances, and staging servers.
  2. Note which ones use Apache mod_php and patch those first.
  3. Upgrade to 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35, or your vendor's backported build.
  4. Verify with the package changelog or build date, not just php -v.
  5. Fully restart PHP-FPM, Apache, and all long-running PHP workers.
  6. Set session.upload_progress.enabled=0 unless you need it (covers CVE-2026-115560 too).
  7. Plan an upgrade off PHP 8.1 and older. PHP 8.2 reaches end of life on December 31, 2026.
  8. Tighten request-body and multipart limits at your proxy or WAF as defense in depth.
  9. Review web server, PHP and endpoint logs for unexpected processes, files or outbound connections since mid-October.

Defense in depth, not a silver bullet

Patch first. Then check what else your site exposes, and put a managed WAF with OWASP CRS in front of it for the broad classes of attacks a ruleset can actually stop.

Sources#