PHP2Shell Is Being Exploited: Patch PHP, Find the Copies You Missed, and Check for Compromise
PHP2Shell (CVE-2026-109618 and CVE-2026-109619) is exploited in the wild. How to find hidden PHP, patch or mitigate it, and check for compromise.
- Author
- Ackatec
- Published
- Reading time
- 7 min read
- PHP2Shell
- Application security
- Vulnerability management
- Penetration testing
- Incident readiness
- Edge devices
On October 21, 2026, the PHP project shipped emergency releases for two critical flaws, CVE-2026-109618 and CVE-2026-109619, now known as PHP2Shell. Both are rated CVSS v4.0 9.2 and can allow unauthenticated remote code execution. Five days later, CISA added both to its Known Exploited Vulnerabilities catalog (opens in a new tab) and flagged them for forensic triage. Researchers have since reported that on October 23 and 24, a suspected China-nexus group chained them with a Linux kernel flaw to root 25 Palo Alto Networks firewall and management servers.
The short answer: updating the PHP you know about is necessary but not sufficient. Find the PHP embedded in appliances and vendor software, apply vendor fixes or the official mitigations, restart every worker, and check whether anything was compromised before you patched.
What is PHP2Shell?
PHP2Shell is the name for two memory safety flaws in how PHP handles web requests. According to the PHP security advisory (opens in a new tab):
- CVE-2026-109618 is remote code execution through out-of-memory handling that interrupts PHP while internal request data is only partially initialized.
- CVE-2026-109619 is remote code execution through stale request state that survives after its memory is freed, which a later request handled by the same worker may then use.
The fixed versions are PHP 8.5.12, 8.4.27, 8.3.36, and 8.2.35.
Who is affected?
PHP says every PHP installation serving web requests is at risk, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP, and LiteSpeed. It considers mod_php the highest risk, with a demonstrated exploit that runs before any application code. PHP 8.1 and older no longer receive project updates, although the PHP team published minimal source backports for 7.4, 8.0, and 8.1, and some vendors backport fixes.
Exposure varies. Red Hat notes (opens in a new tab) that reliable exploitation needs precise heap manipulation and timing, and that the default PHP-FPM deployment on Red Hat Enterprise Linux 8 and later makes remote code execution difficult in practice, while mod_php setups carry higher risk. Palo Alto Networks telemetry still counted more than 22.6 million exposed PHP instances potentially vulnerable as of October 29, SecurityWeek reported (opens in a new tab).
Is PHP2Shell being exploited?
Yes, though so far success looks narrow. On October 26, BleepingComputer reported (opens in a new tab) a honeypot capture of confirmed remote code execution against Apache mod_php on PHP 8.4.26. As of October 28, Defiant, the company behind Wordfence, knew of no WordPress site compromised through PHP2Shell despite recording more than 77,000 related requests, and noted that exploits often need tuning to each server.
The serious case was an appliance. Dream Research found (opens in a new tab) that attackers chained a custom PHP2Shell exploit with Fragnesia (CVE-2026-46300), a Linux kernel privilege escalation flaw CISA added to the catalog on October 28, to gain root on exposed PAN-OS management interfaces. Palo Alto Networks' Unit 42 independently verified the tooling. In one US government-affiliated environment, the attackers tunneled inside, exploited an internal firewall management server with the same chain, decrypted an LDAP service account password, and launched Active Directory attacks.
Why is patching PHP not enough?
Because the riskiest PHP can be PHP you do not manage. Dream reports that the PAN-OS builds the attackers targeted run PHP 8.0.30, and that PAN-OS 11.1 runs PHP 7.4.33. Neither would show up in a typical server inventory, and neither is fixed by updating PHP on your web servers. Only the PAN-OS hotfixes listed in the Palo Alto Networks advisory (opens in a new tab) fix those devices. CISA's PHP alert (opens in a new tab) makes the same point: PHP is often a component of other software, and its prevalence may not be directly observable.
How do you respond to PHP2Shell?
1. Inventory every place PHP runs
Start with internet-facing systems: websites and content management systems, customer portals, hosted applications, and appliance management interfaces. Then ask each vendor whose product exposes a web interface whether it embeds PHP and whether it has published a PHP2Shell advisory. For hosted sites, confirm with your provider that PHP was updated and restarted. A WordPress or plugin update does not change the PHP runtime.
2. Patch with the right version check
Upgrade to a fixed upstream release or to your distribution's patched package. Distribution packages often carry fixes under their own version numbers, so confirm against the vendor advisory rather than the upstream version string. For appliances, apply the vendor hotfix and confirm the build number.
3. Mitigate only as a bridge
If you cannot patch at once, PHP and Red Hat describe interim settings that reduce exposure but do not make an installation safe:
- Turn off session upload progress (set session.upload_progress.enabled to 0). This blocks the confirmed session paths for CVE-2026-109619 and fully covers CVE-2026-115560, a related, less likely issue PHP disclosed on October 23 and plans to fix in a regular release.
- Remove PHP's own memory limit (set memory_limit to -1), but only with a container or cgroup memory boundary in place, and lower post_max_size to 8M without file uploads or 32M with them. Do not use
RLIMIT_ASorRLIMIT_DATA, which can trigger the vulnerable failure. - On PHP 8.5, set fatal_error_backtraces to 0.
- Apply settings with
php_admin_valueor server configuration, notini_set()or.user.ini, and verify them through a temporaryphpinfo()page rather thanphp -i. - Restart every worker. Red Hat warns that a reload is not sufficient. In containers, replace the running container or pod.
CISA adds that a web application firewall may provide some protection, and that systems you cannot update immediately, or that still run PHP 8.1 or earlier, should be taken offline until they are patched or updated.
4. Pull management interfaces off the internet
Palo Alto Networks says exploitation targeted management interfaces exposed to the internet and recommends restricting access to trusted internal addresses or a jump box. Apply that rule to every appliance, not only firewalls.
5. Check for compromise, not just exposure
A patch does not remove a webshell. CISA recommends monitoring for PHP worker processes launching shells or downloading tools, and its alert links a SIGMA detection rule. For exposed systems that ran a vulnerable version after the October 21 disclosure, review web and process logs, look for unexpected PHP files in web directories, and check whether service account credentials the system held should be rotated. CISA's KEV entry flags PHP2Shell for forensic triage under BOD 26-04, the directive explained in our post on BOD 26-04 patch timelines. The directive binds federal civilian agencies, but its triage step is a sound benchmark for any organization.
What should leaders ask this week?
- Do we have a complete list of systems running PHP, including appliances and vendor-hosted applications?
- Has every vendor with a web-managed product told us whether PHP2Shell affects it?
- Are any appliance management interfaces reachable from the internet?
- For systems that were exposed before we patched, has someone checked for webshells and unusual process activity?
- Who decides whether to rotate credentials or bring in a forensics firm, and how fast?
- Which systems still run PHP 8.2, which reaches end of life on December 31, 2026, or an older unsupported version?
Where Ackatec can help
An independent penetration test shows how your web applications, and your external networks when in scope, hold up under attack, with fixes verified at retest when it is included. A security assessment gives leadership a current view of controls and exposure, including the gaps this event revealed, and sequences remediation around impact and capacity. Incident readiness work defines who makes the compromise call and rehearses the handoff to the response firms you engage. Emergency response, containment, and forensics stay with the firms contracted to deliver them.
If you are not sure where PHP runs in your environment, start a conversation.
References
- PHP, Security advisory: Critical remote code execution vulnerabilities, update now (opens in a new tab) (October 21, 2026) and informational advisory on session upload progress (October 23, 2026)
- CISA, Critical Vulnerabilities in PHP Require Immediate Patching (opens in a new tab) (updated October 26, 2026)
- CISA, Known Exploited Vulnerabilities Catalog (opens in a new tab)
- Red Hat, RHSB-2026-013: php2shell (opens in a new tab)
- Palo Alto Networks, CVE-2026-109618 security advisory (opens in a new tab) (updated October 29, 2026)
- Dream Research, Chained PHP2Shell Exploit Roots 25 Servers (opens in a new tab) (updated October 29, 2026)
- BleepingComputer, PHP2Shell security flaws now successfully exploited in the wild (opens in a new tab) (October 26, 2026)
- SecurityWeek, PHP2Shell Attacks Root Palo Alto Firewalls but Fail Against WordPress (opens in a new tab) (October 30, 2026)
