← All articles

PHP2Shell Attacks Show Why Firewalls Need Web Security

PHP2Shell Attacks Show Why Firewalls Need Web Security

PHP2Shell attacks against exposed firewall management interfaces show why PHP security and web application security matter far beyond ordinary websites. On October 28, Palo Alto Networks confirmed that attackers were exploiting two PHP vulnerabilities, CVE-2026-109618 and CVE-2026-109619, against PAN-OS management interfaces reachable from the internet. Both flaws allowed unauthenticated code execution on the web server. Details leaked on October 20, before the planned coordinated disclosure, and the PHP project released an emergency patch the following day.

The vulnerabilities did not require an account, but exploiting them reliably required skill and knowledge of the target. Network appliances make that work more practical because many devices run the same, often outdated software. Attackers can study one copy of the software and apply what they learn to many identical systems. In this case, Palo Alto Networks products included end-of-life PHP versions 8.0.30 and 7.4.33.

Security researchers at VulnCheck found the bugs exploitable on ARM64 systems and on x86 systems without ASLR. Address space layout randomization, or ASLR, is a protection that changes where code and data are placed in memory, making fixed-address exploits harder. Few public exploits bypassed ASLR on x86-64, and the one VulnCheck confirmed worked against only one PHP build. VulnCheck’s own exploit used a memory leak to obtain code execution even with ASLR enabled.

The PAN-OS attack also had to overcome ASLR. It leaked the base address of the libphp.so library through a Set-Cookie header, while SELinux restricted the resulting shell. Dream, an Israeli security company that worked with Palo Alto Networks during the investigation, found that the attacker had obtained PAN-OS firmware, decrypted it, extracted its PHP libraries and built precise memory profiles for nine software versions. The attacker then combined PHP2Shell with a Linux kernel vulnerability called Fragnesia, CVE-2026-46300, to obtain root access on 25 systems: 24 firewalls and one management server in the United States, Japan, Taiwan and South Korea.

The broader problem is that web application security is often treated as a developer concern, even though web interfaces control many critical devices. HTTP, the protocol used to exchange web requests and responses, is more complicated than many defensive systems assume. A file upload can be sent in chunks without declaring its total size. A server can also decompress request bodies, making it difficult to know how much memory a request will require.

In PHP2Shell, a specially crafted multipart upload pushed PHP beyond its memory limit while PHP was still parsing the request, before any application code ran. Deeply nested empty file fields caused PHP to allocate much more memory than the request actually contained. As a result, a request far below the default 8 MB post_max_size could still exhaust the default 128 MB memory limit. When PHP aborted processing, it left behind uninitialized request memory in CVE-2026-109618 and a pointer to freed memory in CVE-2026-109619. These memory-safety failures enabled the exploit chain.

Defenders need enough understanding of HTTP to recognise such traffic and create detection signatures. Security devices placed between users and applications can also affect what happens. Intruder found that nginx in front of PAN-OS buffered chunked request bodies, disrupting publicly available exploit chains. Web application firewalls are therefore not automatically sufficient, and blocking file uploads is usually impractical because many applications depend on them.

The practical response is to identify critical web applications, beginning with firewall and other network-equipment administration interfaces, and restrict who can reach them. Palo Alto Networks advised removing internet access to management interfaces and limiting them to trusted internal IP addresses. Organisations that use a web application firewall should configure it carefully and understand exactly what protection it does and does not provide.

Risk assessment was another difficulty. The PHP project assigned both flaws a 9.2 score under CVSS 4.0, a system for rating vulnerability severity. Fortinet’s PSIRT listed a 9.8 score under CVSS version 3. Palo Alto Networks initially rated the issue 8.7 for its own products and called for moderate urgency, then raised it to 9.2, Critical, with its highest urgency on October 27. The company confirmed exploitation a week after its advisory was published.

Many public proof-of-concept tools did not work, so a large number of attempts in logs did not by itself show whether a particular server was vulnerable. PHP core developer Gina Peter Banyard also warned that disabling session upload progress, an early workaround, was not sufficient on its own. The incident demonstrates why defenders must consider the device, its software version, available protections and the reliability of published exploit tools together rather than relying on one score or one log signal.

SANS says these lessons are being added to SEC522, Application Security: Securing Web Applications, APIs, and Microservices. The course covers HTTP/2, HTTP/3, file-upload handling, API security and AI endpoints through 17 hands-on labs and a Defend the Flag capstone, and is scheduled for December 14 to 18 at SANS Cyber Defense Initiative 2026 in Washington, D.C., as well as online. AEU-I provides security-first IT, infrastructure and consulting, which is relevant for organisations reviewing how exposed management interfaces and other critical web applications are protected.

Also available in: DeutschItalianoShqip