PHP2Shell rooted PAN-OS firewalls and turned them into internal pivots
The instructive failure in the PHP2Shell campaign was not simply that perimeter firewalls failed to filter hostile traffic. Their internet-exposed management applications supplied initial access, after which the devices provided credentials, network knowledge and a route inside. In one US government-affiliated environment, that chain compromised two perimeter firewalls and an internal firewall management server. (src: Dream Research)
What happened
Dream Research reported 25 compromised PAN-OS systems: 24 perimeter firewalls across the United States, Japan, Taiwan and South Korea, plus one internal firewall management server. Its recovered logs show the first government-affiliated firewall being rooted at 18:14 UTC on 23 October. It crashed shortly afterwards and did not recover. A second firewall in the same environment was rooted the next morning, followed less than 90 minutes later by the internal management server. (src: Dream Research)
The second firewall was not just another webshell host. The attacker established a persistent reverse SSH tunnel through it, then used that tunnel to reach and exploit the management server. Active Directory enumeration, credential access and password spraying followed. Dream could not identify the organisation from its artefacts, and no named US department or agency has been publicly confirmed. The incident therefore supports “US government-affiliated environment”, not claims that multiple named agencies were breached. (src: The Record)
PHP published fixes on 21 October. Palo Alto Networks released PHP2Shell fixes progressively across 20 supported PAN-OS maintenance lines between 24 and 29 October. CISA added both PHP vulnerabilities to its Known Exploited Vulnerabilities catalogue on 26 October, with a 29 October federal deadline, then added the Fragnesia privilege-escalation flaw on 28 October with a 31 October deadline. All three entries require forensic triage under BOD 26-04. (src: PHP, Palo Alto Networks, CISA KEV: CVE-2026-109618, CISA KEV: CVE-2026-46300)
A separate Check Point campaign began on 30 October against unpatched Mobile Access gateways. It used a different privilege-escalation vulnerability, CVE-2026-123039, and some intrusions included an ESXi wiper. Those victims are not part of Dream's 25-system total. (src: Check Point Research)
How it works
The entry point was the management plane, not a VPN protocol. The observed attack targeted the PAN-OS management web interface, including the HTTPS UI and XML API. Palo Alto states that GlobalProtect portal, gateway and Clientless VPN were not impacted. Describing this as a VPN exploit would obscure the exposure that actually mattered. (src: The Hacker News)
Dream's recovered artefacts show a deliberate targeting funnel. FOFA identified approximately 19,000 internet-facing PAN-OS firewalls. A 200-thread scanner obtained version information from roughly 5,000 responsive devices, geographic and software filters reduced that set, and an automated process worked through 240 selected targets five at a time. (src: Dream Research)
The exploit was customised for PAN-OS rather than copied from a public PHP2Shell proof of concept. Version-specific memory offsets and heap geometry were derived from firmware and tested in a lab. A uniform appliance stack helped turn configuration-sensitive PHP memory corruption into a repeatable operation. (src: Hunt.io)
The two PHP defects attack different parts of the request lifecycle:
- CVE-2026-109618: out-of-memory handling can interrupt request processing while request memory is only partly initialised, allowing cleanup to trust invalid state.
- CVE-2026-109619: global state can retain pointers to freed request memory, allowing a later request handled by the same worker to use stale state. (src: PHP)
Against the PAN-OS appweb management server, the recovered exploit used session.upload_progress. Crafted multipart requests shaped the heap and forced memory exhaustion. An out-of-bounds read leaked a pointer through the Set-Cookie response, revealing the libphp.so base address and defeating ASLR. A second stage created a stale zend_reference, then a forged HashTable entry caused PHP cleanup to invoke zif_system. The resulting command ran as the low-privilege nobody user. Dream reports that the complete chain could turn an unauthenticated HTTPS connection into a persistent root webshell in under 15 minutes. (src: Dream Research)*
Fragnesia supplied root access. CVE-2026-46300 is a Linux XFRM ESP-in-TCP flaw that fails to preserve the shared-fragment marker during socket-buffer coalescing, permitting unintended modification of page-cache-backed data. The attacker overwrote /etc/pam.d/su, replacing its authentication rules with pam_permit.so, after which su root succeeded without a password. A 103-byte PHP root webshell was planted at /unauth/php/change_password.php. (src: Dream Research, CISA)
The appliance then supplied the pivot. Its configuration revealed domain controllers, VPN gateways, Keycloak, GitLab, network topology and the internal management server. An eight-port reverse SSH tunnel forwarded LDAP, LDAPS, RDP, management and SOCKS5 access. Persistence used a systemd service, an rc.local hook and scripts under /usr/local/lib/.panops/. Root access also allowed the attacker to decrypt a stored LDAP service-account password and use the management server's existing AD connectivity. The domain had lockoutThreshold=0, permitting unlimited password-spray attempts. (src: Dream Research)
The limits matter: successful spraying, backdoor-account creation, SAML signing-key extraction and Keycloak bypass were attempted or investigated, not confirmed.
Why it matters
A compromised firewall can provide more than an execution foothold. It can combine trusted internal connectivity, identity material, network knowledge and management relationships in one place. Here, those properties exposed a server that was not internet-facing and gave the attacker a ready-made route towards directory services. Network designs that treat “behind the firewall” as a trust boundary therefore amplify the value of compromising the firewall itself. (src: Dream Research)
The public evidence does not establish what endpoint coverage the victims had. The defensible warning is narrower: server EDR cannot be assumed to protect an appliance management plane. Teams need appliance-specific telemetry, configuration-integrity monitoring and compromise detection rather than an architectural assumption.
The patching chronology also exposes a second failure. Researcher William Bowling disclosed Fragnesia with a proof of concept and an upstream Linux fix on 13 May, and Fedora shipped a fixed kernel the following day. PAN-OS fixes did not arrive until 24 and 25 November. Palo Alto confirmed exploitation but told CSO it had no further information beyond its advisory when asked about the delay. (src: CSO)
Finally, remediation status remains uncertain. For 22 perimeter firewalls, Dream observed only the root webshell, suggesting access parked for later use. Its assessment that tunnels and webshells were likely still active dates from late October, not current telemetry. (src: Dream Research)
What to do about it
- Remove management interfaces from the public internet. Restrict them to trusted internal addresses or a dedicated management network and jump host. Inspect dataplane interfaces as well as the dedicated MGT port: attaching a management profile can expose management services there too. (src: Palo Alto Networks)
- Patch both stages. October's PHP2Shell fixes break the observed entry path but do not repair the kernel. Use the Fragnesia-fixed PAN-OS builds listed in PAN-SA-2026-0015, or a later release. Restricting management access and patching PHP2Shell can support a risk-based maintenance decision, but they do not make the kernel fixed. (src: Palo Alto Networks)
- Use signatures as supplementary cover. Threat ID 543004 and later signatures in Applications and Threats content 9162 onwards can add protection, but do not replace patching or exposure reduction. (src: Palo Alto Networks)
- Investigate before declaring a device clean. Check for the named webshell, unexpected public PHP files,
/usr/local/lib/.panops/, unexpected services andrc.localchanges, reverse SSH tunnels, SOCKS proxies, and web-service processes launching shells. Review configuration exports, LDAP credential use, AD enumeration and account-creation attempts. These are campaign-specific artefacts; their absence does not prove a device was uncompromised. (src: Dream Research) - Treat exposed secrets as compromised. Rotate LDAP service accounts and administrative credentials, replace harvested certificate and device keys, review managed firewall configurations and investigate AD systems reached through the tunnel. Review AD lockout policy and
MachineAccountQuota. Where root compromise cannot be excluded, reimage from a known-good build; patching alone removes neither persistence nor uncertainty about integrity. (src: CSO) - Reduce the value of the next appliance compromise. Segment firewall and Panorama management from domain controllers and general internal services, permit only required flows, and alert on outbound SSH from security appliances.
- Patch general PHP installations independently. Upgrade to at least PHP 8.2.35, 8.3.36, 8.4.27 or 8.5.12, or install the applicable vendor backport, then restart every worker and verify the serving runtime. Disabling
session.upload_progressor changingmemory_limitaddresses particular paths only and is not a complete mitigation. CISA advises taking PHP-based systems offline if they cannot be updated. (src: PHP, CISA)
Sources
- Dream Research: Chained PHP2Shell Exploit Roots 25 Servers
- Palo Alto Networks: CVE-2026-109618
- Palo Alto Networks: PAN-SA-2026-0015
- PHP: 2026 news and security advisory archive
- CISA: Critical Vulnerabilities in PHP Require Immediate Patching
- CISA KEV: CVE-2026-109618
- CISA KEV: CVE-2026-46300
- The Record: Limited reports of PHP bug exploitation emerge
- The Hacker News: PHP2Shell exploitation of PAN-OS management interfaces
- CSO: Palo Alto confirms Fragnesia exploitation
- Hunt.io: PHP2Shell One Week Later
- Check Point Research: PHP2Shell Exploitation on Check Point Gateway
