BlogVulnerability Research

PHP2Shell: Decade-Old PHP RCE Chain Explained

On 21 October 2026, Wiz Research disclosed PHP2Shell — a pair of use-after-free bugs in PHP's fatal-error handling that chain into unauthenticated remote code execution against every WordPress, Drupal and Joomla site built on PHP 5.4 or later. CVSS up to 9.2. Here is what the bugs are, why they survived a decade of eyes on the PHP source, and what to patch and detect in the next 48 hours.

10 min readBy TigerGate Research, Security Research TeamPublished Updated

TL;DR

  • · Two CVEs: CVE-2026-109618 (upload-progress unserializer UAF) and CVE-2026-109619 (fatal-error backtrace UAF).
  • · Root cause: PHP's out-of-memory fatal-error path destroys the request heap but leaves global pointers dangling, so the next request on the same worker reuses the stale state.
  • · Chains into unauthenticated RCE on vanilla WordPress, Drupal and Joomla container images.
  • · Affects PHP 5.4 through all current branches. Patched upstream on 21 Oct 2026.
  • · If your attacker-facing fleet runs PHP under FPM or Apache mod_php, patch now. Everything else below is detection and context.
  • · November 2026 update: PHP2Shell is now being chained with Fragnesia (CVE-2026-46300) for root on Palo Alto, Cisco, Citrix, F5 and Siemens management interfaces — 25 PAN-OS firewalls already compromised in the wild.
Active exploitationUpdated 5 November 2026

November 2026 Update: PHP2Shell × Fragnesia Chain Hits Management Interfaces

In the two weeks since the 21 October disclosure, exploitation has moved from Wiz's Drupal / WordPress proof-of-concept into a full root-on-firewall chain. The new piece is Fragnesia — CVE-2026-46300, a Linux-kernel memory-corruption flaw — paired with the original PHP2Shell primitives. Attackers now combine the two to land as an unprivileged www-data via PHP2Shell, then pivot to root via Fragnesia on the underlying Linux kernel. The targets are management interfaces of security and network appliances, which are overwhelmingly PHP-fronted and historically under-patched.

As of 4 November 2026, 25 Palo Alto firewalls are publicly confirmed compromised via this chain. The attack surface is any vendor that ships a PHP-based management UI on a Linux appliance, which is most of them.

The PAN-OS chain

The observed kill-chain on Palo Alto PAN-OS devices:

  1. Initial foothold — PHP2Shell on the management plane. Attackers reach the PAN-OS web interface on TCP/443 and trigger CVE-2026-109618 via the upload-progress unserializer, landing shell execution as the nobody / www-data user running the management-UI PHP process.
  2. Privilege escalation — Fragnesia (CVE-2026-46300). From that unprivileged shell, the attacker drops the Fragnesia exploit against the kernel and escalates to root on the appliance. PAN-OS ships an older stable-branch kernel that is directly affected; the LPE is reliable on the shipped build.
  3. Persistence. Root on a firewall means: bypass the firewall's own policy enforcement, install persistent reverse shells, exfiltrate certificates and shared-key material, and push attacker-controlled rules back into the config. Palo Alto's own panorama sync will re-propagate those rules across the fleet if HA is enabled.

Palo Alto's advisory names the chain explicitly and recommends immediate PAN-OS patching, management-interface IP allow-listing, and secret rotation (API keys, certificates, SNMP strings, LDAP binds) on any device that was internet-exposed between 21 Oct and the patch date.

Other affected vendors

The chain is appliance-shape, not vendor-specific: any management interface that terminates HTTPS into PHP-FPM on a Linux kernel in the Fragnesia range is a candidate. Public vendor advisories confirming they are affected, as of 5 November 2026:

VendorAffected products (representative)Vendor advisory
Palo AltoPAN-OS management UI on PA-series, VM-series, PanoramaPublished; patch available
CiscoFMC web interface, select IOS XE WebUI builds, Secure Email & Web ManagerPublished; hotfix rolling out
CitrixNetScaler ADC / NetScaler Gateway management interfacePublished; emergency build issued
F5BIG-IP TMUI, BIG-IQ UIPublished; K-article with hotfix
SiemensRUGGEDCOM ROX II, SCALANCE and SIMATIC web UIs with PHP management front-endsProductCERT advisory; firmware updates staged

If you operate any of the above on a management interface reachable from outside the management VLAN, treat it as "assume compromised since 21 Oct" until proven otherwise.

Patched PHP versions

The PHP project shipped additional release-line builds on 3 November 2026 to close straggler cases and tighten the fix against the attack-chain variants:

Release lineFixed in
PHP 8.28.2.35
PHP 8.38.3.36
PHP 8.48.4.27
PHP 8.58.5.12

Older unsupported lines (5.4 – 8.1) have no vendor patch. Those installs need to be either upgraded off a supported branch, firewalled off management interfaces, or the workaround below applied.

The session.upload_progress.enabled workaround

If patching is not immediately possible — common for appliance firmware or legacy LTS PHP builds — disable the upload-progress feature. It closes the primary RCE primitive (CVE-2026-109618) without touching application code:

; php.ini — PHP2Shell CVE-2026-109618 workaround
session.upload_progress.enabled = 0

; Also recommended: tighten memory limits so the OOM path fires
; less often and attackers get fewer attempts per worker.
memory_limit = 128M

Restart every FPM pool / Apache worker after the change so the directive actually loads. This does not close the backtrace path (CVE-2026-109619), so it is a stopgap only — treat patching as still due.

  • Confirm the setting is active with php -r 'echo ini_get("session.upload_progress.enabled");' — expect 0.
  • Some distributions set the directive in /etc/php/*/fpm/conf.d/ override files; check those too.
  • On appliance firmware you often cannot touch php.ini. In that case, the only option is a vendor firmware update or network-level removal of the management interface from reachable surface.

What a pentest should check on exposed management interfaces

The chain's shape — PHP RCE + kernel LPE on an appliance that should not be internet-reachable in the first place — means the pentest checklist is mostly about surface, not payload. Run these on every management UI in scope:

  1. Reachability. Is the management interface reachable from any network segment other than the dedicated management VLAN? From the public internet? From VPN pools or vendor-support jump hosts? Document every source range that can reach it.
  2. PHP fingerprint. Banner-grab and error-induce to identify the PHP major and minor version. Any version below 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12, or any pre-8.2 LTS build, fails.
  3. Upload-progress toggle. If you have authenticated access, verify session.upload_progress.enabled is 0 or that the vendor firmware patch is applied. Unauthenticated: send a benign multipart POST with an UPLOAD_IDENTIFIER and observe whether an upload-progress session is created.
  4. Kernel version. For appliances where you can read the kernel banner (/proc/version via local shell, or vendor diagnostics), confirm it is not in the Fragnesia (CVE-2026-46300) affected range. For closed appliances, use vendor advisory version-mapping.
  5. Secret-material exposure. Enumerate what the management UI holds: TLS certificates, HA keys, LDAP / RADIUS binds, SNMP community strings, API keys to orchestration planes. Any of these is a root-on-appliance exfil target.
  6. Lateral-movement blast radius. If an attacker holds root on this appliance, what else do they reach? Push/sync protocols to peer firewalls (Panorama HA, FMC peering, Citrix cluster), SIEM / syslog receivers, management jump boxes.
  7. Evidence of past exploitation. Walk back 30 days of PHP-FPM error logs, HTTPd access logs, and kernel OOM logs for the signals called out further down this post — oversized PHPSESSID cookies, 500 bursts on upload endpoints, OOM messages correlated with login POSTs.

Our VAPT AI Engine ships the PHP2Shell × Fragnesia detection pack in its November update — scheduled to run against your ASM-discovered management interfaces, with findings linked to the exact chain step they correspond to. See continuous VAPT for the full program.

What is PHP2Shell?

PHP2Shell is the name Wiz Research gave to a chain of memory-safety flaws in the PHP core engine. Each bug on its own is a classic use-after-free; stitched together across a worker's request lifecycle, they produce memory disclosure and arbitrary code execution without authentication. The flaws live in PHP itself, which means the application running on top — WordPress, Drupal, Joomla, Laravel, Symfony, or any first-party PHP code — is incidental. Clean, modern application code offers no defence.

The root cause: fatal errors that don't clean up

PHP processes HTTP requests on long-lived worker processes under FPM or mod_php. Each request has a short-lived "request heap" that is destroyed and recreated between requests. When a fatal allocation failure (out-of-memory) interrupts a request mid-flight, PHP tears down the request heap — but a handful of global state pointers are left dangling at process scope:

  • BG(unserialize) — state for the upload-progress unserializer
  • EG(last_fatal_error_backtrace) — the backtrace captured when the fatal fired
  • CG(map_ptr_last) — OPcache's shared-memory frontier marker

The next request handled by the same worker reads from or writes through these pointers. The memory they reference has already been freed and may now hold attacker-controlled bytes, which turns ordinary PHP functionality into a UAF primitive. This is the single mechanism behind both CVEs; the two CVE IDs reflect two distinct exploitation surfaces.

The four exploitation primitives

1. Upload-progress unserializer corruption (CVE-2026-109618)

Stale BG(unserialize) state lets an attacker drive controlled deserialisation on the second request. The upload-progress feature is enabled by default on most distributions and does not require authentication to reach, which is why this one is the primary RCE primitive.

2. Memory disclosure via PHPSESSID cookies

Freed heap contents are reflected back in the next request's response cookies. Crucially, no session_start() call is required for the leak to work. For attackers this is the "read" side of the chain: leak pointers from the heap, defeat ASLR, prepare the second write.

3. Backtrace pointer reuse (CVE-2026-109619)

EG(last_fatal_error_backtrace) persists across requests, so a chain of two carefully timed requests gives the attacker a controlled read/write primitive through the dangling backtrace structure. Independent of the unserializer path — useful when upload-progress is disabled.

4. OPcache type confusion

Cross-worker drift in CG(map_ptr_last) advancement causes type confusion in OPcache's shared memory segment. Not required for RCE but hardens the chain against ASLR and heap-grooming entropy.

What's actually affected

Wiz demonstrated RCE against the latest container images of WordPress, Drupal and Joomla with no application-layer modification — just the vanilla PHP that ships with the image. Because the bug is in PHP, the real affected list is "any PHP application running under FPM or mod_php on a vulnerable PHP version." That includes:

  • WordPress, Drupal, Joomla, MediaWiki, Nextcloud, OwnCloud
  • Magento, PrestaShop, OpenCart, WooCommerce (via WordPress)
  • Laravel, Symfony, CodeIgniter, CakePHP applications in production
  • phpMyAdmin, Roundcube, SquirrelMail, Zabbix, Icinga web UI
  • Hosted PHP on Hostinger, Bluehost, SiteGround, Kinsta, WP Engine, GoDaddy

PHP versions affected: every branch released in the last decade, back to PHP 5.4. CVSS up to 9.2.

Timeline

DateEvent
19 Aug 2026Wiz Research discovers the first UAF primitive using Wiz Atlas, Gemini 4 Argon and GPT-5.6 Sol
20–21 Aug 2026RCE confirmed against Drupal and WordPress container images
24 Aug 2026Coordinated disclosure to the PHP security team
21 Sep 2026PHP acknowledges the reports and begins fix development
21 Oct 2026Patched PHP releases ship; public disclosure
28 Oct 2026First public PHP2Shell × Fragnesia (CVE-2026-46300) chain demonstrated against a PAN-OS appliance in a lab writeup
2 Nov 2026Palo Alto, Cisco, Citrix, F5 and Siemens publish advisories naming the chain
3 Nov 2026PHP ships 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12 with hardened fixes
4 Nov 202625 Palo Alto firewalls publicly confirmed compromised in the wild via the chain

Why did this survive a decade in the open-source PHP core?

The flaw sits at the intersection of three code paths that very few reviewers hold in their head at once: PHP's fatal-error handler, the global request-cleanup path, and specific extensions (upload-progress, OPcache) that interact with request-scope state. Static analysers do not model cross-request state. Fuzzers struggle because triggering the bug requires chaining two HTTP requests with a controlled out-of-memory failure between them.

Wiz credits frontier AI models for closing the gap. The quote from the writeup: "Frontier models substantially reduced that barrier, turning a longstanding flaw into an exploit." This is a worth-watching pattern — not that AI invents novel bug classes, but that it compresses the cost of adapting known-but-impractical primitives to specific heap layouts and PHP versions from months of specialist work into hours.

What to do in the next 48 hours

  1. Patch PHP. Apply the 21 Oct 2026 security releases from php.net or your distribution's package feed (Debian, Ubuntu, Red Hat, Amazon Linux, Alpine). Managed hosts (WP Engine, Kinsta, Hostinger, SiteGround) typically patch within hours — confirm your plan's SLA.
  2. Restart FPM pools. The dangling-state class means a worker process compromised before the patch stays compromised until it restarts. systemctl restart php8.2-fpm and watch for request errors during the drain.
  3. Audit OPcache contents. Clear OPcache (opcache_reset() via a CLI script or restart the FPM pool) in case cross-worker type confusion left poisoned entries.
  4. Hunt for exploitation. Look back 48 hours for: unusually large PHPSESSID cookies in access logs, bursts of HTTP 500s on multipart upload endpoints, repeated out-of-memory errors in php-fpm logs, and new outbound connections from webserver processes to unfamiliar IPs.
  5. Rotate secrets on any host where exploitation looks plausible — database passwords, API keys loaded into PHP via getenv(), OAuth client secrets.

How TigerGate helps

  • Server Vulnerability Monitoring flags vulnerable PHP builds on every Linux host and cloud VM, prioritized by CISA KEV and EPSS once the CVEs land on those feeds — and by eBPF runtime-reachability so you see which hosts are actually running PHP in production vs. just having it installed.
  • Container Security scans WordPress, Drupal, Joomla, Laravel and custom PHP images for the vulnerable PHP binary before they reach your registry and admission controller.
  • eBPF runtime detection watches for the exploitation side-effects: anomalous child processes spawned by php-fpm or Apache, unexpected outbound connections, writes to /tmp or /dev/shm followed by execution.
  • Compliance evidence maps the PHP patch to SOC 2 CC7.1 vulnerability lifecycle, PCI DSS 6.3.3 (critical patch within 30 days) and CERT-In VAPT reporting — the audit trail your next auditor will ask for.

Sources

  • Wiz Research: PHP2Shell — PHP RCE, 21 October 2026
  • PHP 8.x ChangeLog, security releases 21 October and 3 November 2026 (8.2.35, 8.3.36, 8.4.27, 8.5.12)
  • CVE-2026-109618, CVE-2026-109619 and CVE-2026-46300 (Fragnesia) at NVD
  • Vendor advisories: Palo Alto PSIRT, Cisco Security Advisories, Citrix Security Bulletins, F5 K-articles, Siemens ProductCERT — all published 2 November 2026

Find vulnerable PHP across your fleet

14-day trial. Agentless scan on EC2, Azure VM, GCE and Oracle Cloud starts in minutes. The agent adds runtime reachability so you page on CVEs loaded by live php-fpm, not every host that merely has the PHP package installed.