The short version
- Two bugs in PHP core, not in a framework: an out-of-memory corruption during request setup (CVE-2026-109618) and stale state reused by the next request, reported as a use-after-free in upload progress (CVE-2026-109619).
- Every PHP that serves web requests is in scope: PHP-FPM, Apache mod_php (highest risk), php-cgi, LiteSpeed, FrankenPHP. Reports confirm PHP 5 is affected too.
- Fixed in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. PHP 7.4, 8.0 and 8.1 got source backports only; older versions get nothing. Restart every PHP worker after upgrading.
- PHP says no configuration change fully mitigates it. CISA added CVE-2026-109618 to KEV on 26 October 2026.
- Our incident: the attacker read the container's environment, tried a decoy AWS key, and the container was replaced in under two minutes.
1. What PHP2Shell is
Most PHP security bugs live in an application or a framework. PHP2Shell is in the interpreter, which is why it reaches every PHP site at once. It's two separate memory-safety bugs:
- CVE-2026-109618: out-of-memory corruption. When PHP runs out of memory partway through setting up a request, it aborts with a jump that skips normal cleanup. Some structures are left half-initialized, and during request shutdown the engine can read attacker-shaped memory and follow a function pointer from it.
- CVE-2026-109619: stale global state. Internal state outlives the request memory it points to, so the next request handled by the same worker acts on leftover data. Akamai's analysis traces it to the session upload progress feature, which caches pointers into a table that gets freed and replaced.
Both are reachable with one unauthenticated request, and both happen in PHP's request handling rather than in your code. PHP's maintainers rated the risk highest for Apache mod_php, where an attack can succeed before the application runs at all.
2. Am I affected?
If PHP serves web requests on your system, assume yes. The advisories name PHP-FPM, Apache mod_php, php-cgi, LiteSpeed and FrankenPHP. The CLI running a cron job isn't the target; anything parsing HTTP requests is.
| PHP branch | Status | What to do |
|---|---|---|
| 8.5, 8.4, 8.3, 8.2 | Affected before 8.5.12, 8.4.27, 8.3.36, 8.2.35 | Install the fixed release |
| 8.1, 8.0, 7.4 | Affected; no official release | Distribution or LTS vendor package, PHP's source backports, or upgrade |
| 7.3 and older, PHP 5 | Affected; no fix (watchTowr confirmed PHP 5) | Upgrade, or remove from the internet |
PHP turns up in places that aren't obviously PHP sites: the official php: Docker images and every image built FROM them, apt install php8.3-fpm lines in Dockerfiles, Bref layers on Lambda, WordPress and Drupal images, and appliances. Palo Alto Networks reported that PAN-OS and Panorama were affected, and Unit 42 described attacks on exposed PAN-OS management interfaces.
3. What to install, and what doesn't work
- Install the fixed build, then restart every PHP worker. PHP-FPM pools and Apache children keep the old binary loaded until they're restarted. For containers, rebuild the image (bump the
FROM php:8.3.xtag or the apt pin) and redeploy. - Configuration isn't a fix. PHP's maintainers say no configuration change fully mitigates these bugs. Disabling
session.upload_progress.enabled, which Akamai lists as a precondition for CVE-2026-109619, doesn't touch CVE-2026-109618. - If you can't patch today, cut exposure. Put the system behind a VPN or an allowlist. WAF rules shipped quickly, but a bug triggered by memory exhaustion is hard to describe with a request pattern.
- Check your exposure. Searchlight Cyber published an open-source scanner,
php2shell-scanner, on 22 October 2026.
4. Timeline
- 17 October 2026: Amazon's MadPot honeypots record an exploitation attempt, four days before the fixes.
- 20 October: PHP pre-announces a security release; details leak on social media, and watchTowr confirms the bugs are real.
- 21 October: PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 ship. watchTowr observes exploitation in its honeypot network.
- 22 October: The planned disclosure date. Palo Alto Networks confirms PAN-OS is affected, and a public scanner appears.
- 26 October: CISA adds CVE-2026-109618 to the Known Exploited Vulnerabilities catalogue.
The gap that matters: attackers had the bug before defenders had a patch. Patch speed can't cover that window. Detection has to.
5. Our PHP2Shell incident: under two minutes
We run a few public PHP sites in containers on AWS Fargate. Ten months earlier, React2Shell had kept an attacker inside our network for four days while our alerts were explained away. This time the containers carried something extra: a decoy AWS access key and a decoy database login in the environment, next to the real variables. The app never uses them.
- The attacker got code execution through PHP2Shell, read the environment, and tried the AWS key.
- CloudTrail logged the call. An EventBridge rule matched the decoy and delivered it to the agent. The alert reached Slack in under a minute.
- Each decoy is planted in exactly one task definition, so the key ID named the compromised task. No guessing.
- The agent restarted that task. A clean container from the image replaced it. Restarting is easy to undo, so the agent could do it alone. One more minute.
Under two minutes from the attacker's first move to containment, with zero harm. The incident and the reasoning behind it are the subject of the talk One Fake Password Is Worth More Than 10,000 Alerts. The restart didn't fix the PHP bug; only the patched image does that. What the restart did was end that attacker's session before it could become four days.
6. How Compass helps
The agent in that story is Compass, which we open-sourced (Apache 2.0). It covers both halves of a PHP2Shell-style event.
Before: the patch pull request
- The patch captain follows OSV, the CVE list, CISA KEV, EPSS, Packagist and the Ubuntu, Debian, Alpine and Amazon Linux trackers every hour.
compass patch feed_runpulls them immediately on disclosure day. - It knows where PHP is in your account:
FROM php:…images in task definitions and Dockerfiles,php8.x-fpmpackages installed inRUNlines, Bref layers inserverless.yml, SAM or Terraform, and which of those workloads face the internet. - For a KEV-listed, internet-facing finding like this one it opens the fix pull request without waiting for a click:
php:8.3.30-fpmbecomesphp:8.3.36-fpm, an apt pin moves to the fixed distro build, a Bref layer moves to its new version. Then it reads CI, the image build, and an optional canary run on a staging twin. You merge.
During: active defense with honeytokens
- Compass plants decoy AWS keys, decoy database logins, decoy S3 objects and decoy SSH key pairs as Terraform pull requests in your repository. Nothing is created until you merge and apply.
- A trip becomes an incident with the source (which task definition the decoy lives in) and the blast radius from the map.
- The response policy decides whether to act alone. The two actions, restarting an ECS task and deactivating an access key, each take a snapshot, verify the result, record an audit entry and can be rolled back.
What it doesn't do
It doesn't stop the exploit request, and it doesn't see an attacker who never touches a decoy. It's a tripwire on the attacker's most predictable move, the credential grab, plus a fast patch path. Keep GuardDuty and your alerts; the honeytoken decides, the alerts explain. More about Compass · build a honeytoken by hand.
7. FAQ
What is PHP2Shell?
PHP2Shell is the nickname for CVE-2026-109618 and CVE-2026-109619, two unauthenticated remote code execution vulnerabilities in the PHP interpreter, disclosed in October 2026 and rated CVSS 4.0 9.2. A single crafted request can run code on the server, in some setups before the application's own code runs.
Which PHP versions fix PHP2Shell?
PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, released on 21 October 2026. PHP 7.4, 8.0 and 8.1 received minimal source backports rather than official releases, so use your distribution's or LTS vendor's package. PHP 7.3 and older, including PHP 5, have no fix: upgrade or take them off the internet.
Does WordPress or Laravel need an update for PHP2Shell?
No, the bug is in PHP itself, so the fix is a new PHP build: the php-fpm package, the php Docker base image, or your hosting provider's PHP. A WordPress or Laravel update doesn't change the interpreter. Remember to rebuild images and restart PHP workers so the patched binary is what's running.
Can I mitigate PHP2Shell with a php.ini setting?
Not fully. PHP's maintainers say no configuration change fully mitigates these vulnerabilities. Some researchers list session.upload_progress.enabled, which is on by default, as a precondition for CVE-2026-109619, but turning it off doesn't address CVE-2026-109618. Patch, and restrict internet access to any PHP system you can't patch right away.
Is PHP2Shell being exploited?
Yes. Amazon reported an exploitation attempt against its honeypots on 17 October 2026, four days before the fixes shipped, and watchTowr observed exploitation on 21 October. CISA added CVE-2026-109618 to its Known Exploited Vulnerabilities catalogue on 26 October 2026. Palo Alto Networks also reported that PAN-OS management interfaces were affected and attacked.
Are PHP Lambda functions on Bref affected?
Bref layers bundle a PHP build, so a function on a layer built before the fix carries a vulnerable PHP. Move to a layer version built with a fixed PHP release. Exposure is lower than for a long-running web server, but a function behind an API Gateway or function URL still parses untrusted requests.
Written by Ilia Dubovskii, founder of Beamreach. Versions and dates were checked against PHP's advisories and reporting from watchTowr, Akamai, Help Net Security and Palo Alto Networks Unit 42 on 17 November 2026. Sources differ on some details, such as exact disclosure times; check php.net before relying on one. Our incident is anonymised and simplified.
Related: The *2Shell vulnerabilities, 2021 to 2026 · React2Shell (CVE-2025-55182) · AWS canary credentials · What to automate in incident response · One Fake Password Is Worth More Than 10,000 Alerts (talk)
Beamreach