# CVE-2026-109618: PHP2Shell bug gives unauthenticated code execution in PHP

An out-of-memory handling bug in PHP lets unauthenticated attackers run code as the web worker (CVSS 9.2). Scanning and exploitation attempts began on release day, and a working exploit exists for PHP 8.4 on x86-64.

- Vendor: PHP Group, PHP (mod_php, FPM, FrankenPHP, LSAPI)
- Severity: CRITICAL (CVSS 4.0 9.2)
- Exploited (CISA KEV): yes, added 2026-10-26
- EPSS: 100.0% on 2026-11-23
- Public exploit: yes
- Patch available: yes
- Vendor advisory: https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w
- Published: 2026-10-21; updated: 2026-10-23
- Page: https://patchtonight.com/breaking/CVE-2026-109618/

## Affected and fixed versions

| Affected | Fixed in |
| --- | --- |
| PHP 8.5.0 to 8.5.11 | 8.5.12 or later |
| PHP 8.4.0 to 8.4.26 | 8.4.27 or later |
| PHP 8.3.0 to 8.3.35 | 8.3.36 or later |
| PHP 8.2.0 to 8.2.34 | 8.2.35 or later |
| PHP 8.1 and older (end of life) | No official release. Upgrade to a supported branch |

## Why this matters

PHP runs on roughly 2.6 million internet-facing hosts, according to VulnCheck, and sits behind WordPress, Laravel, Joomla, Drupal and Magento. PatchTonight doesn't track PHP as a vendor, but nearly every team runs it somewhere, often inside an application nobody thinks of as "PHP". The bug needs no login, scanning started on release day, and a working exploit exists. VulnCheck counts over 1.1 million hosts on end-of-life branches that get no official fix.

CVE-2026-109618 is one of a pair nicknamed **PHP2Shell**. The other, CVE-2026-109619 (stale global state), is covered in the VulnCheck write-up. Patch both with the same release.

## What it is

PHP exits a request with `longjmp()` when it runs out of memory. In some code paths, request memory is reachable before it has been initialised, so the early exit leaves invalid data behind. Request cleanup then reads or branches on it. The failed allocation doesn't need to be related to the corrupted memory.

An attacker sends crafted requests, such as multipart POSTs, that push PHP to the memory limit while staying within apparent size limits. The advisory reports **unauthenticated remote code execution as the web worker user**, validated on mod_php with default limits. Reliability depends on the build, extensions, frontend and allocator.

CVSS 4.0 is 9.2. Attack complexity is rated high, because exploitation needs the right memory layout.

## Am I affected?

**Yes if you run PHP before 8.2.35, 8.3.36, 8.4.27 or 8.5.12** and PHP handles requests from the network. No special configuration is needed.

- The advisory says **mod_php is confirmed susceptible**. FrankenPHP and LSAPI are likely susceptible. FPM is considered susceptible from source analysis, but no full FPM exploit has been shown.
- **PHP 8.1 and older are end of life.** They get no official release.
- Linux distributions often backport fixes without changing the version string. Check your distribution's advisory before concluding a host is vulnerable or safe.
- PHP bundled in applications, containers and vendor appliances needs the same check.

Check the version on a host:

```
php -v
```

The CLI version can differ from the one serving web requests, so check that one too.

## What to do

1. **Upgrade** to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or your distribution's patched package. Restart web server or FPM workers afterwards.
2. **If you're on 8.1 or older,** move to a supported branch.
3. **If you can't patch yet,** apply the mitigations from the PHP advisory and VulnCheck. None is a complete fix:
   - Enforce `memory_limit=-1` through an admin-only setting. Make sure no pool, directory or app setting reapplies a finite limit.
   - Lower `post_max_size` (VulnCheck suggests 8M without uploads, 32M with) and keep `upload_max_filesize` below it.
   - Enforce decoded request size, field count, multipart part count, header count and nesting depth at the web server or proxy.
   - Block multipart requests at the frontend if the application doesn't use them.
   - Don't use `RLIMIT_AS` or `RLIMIT_DATA`. They trigger the vulnerable path.
   - For CVE-2026-109619, VulnCheck advises `session.upload_progress.enabled=0` in php.ini or the FPM pool config, then a restart of all workers.
4. **If a vulnerable host was internet-facing since 21 October,** hunt for compromise (below). If you find a web shell or unexplained processes, rebuild the host and rotate secrets the web user could read, such as database passwords, API keys and `.env` files.

## Detection

- Search web logs for the user agents and IPs in the indicators section.
- Look for multipart POSTs that set `PHP_SESSION_UPLOAD_PROGRESS`, followed by requests using `php://filter` to read a session file. VulnCheck saw this pattern on 21 October.
- Check the PHP session directory for the `sess_` file named in the indicators, and web roots for new or changed `.php` files.
- VulnCheck's observed web shell payload printed `PWNED::` before running a command, so a response containing it means the payload ran.
- Watch for unexpected child processes of the web server or PHP worker.
- VulnCheck advises checking for follow-up requests from `221.14.159.134`.

## Sources

- [PHP security advisory GHSA-w8hw-w9fx-j79w](https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w)
- [CVE record CVE-2026-109618](https://cveawg.mitre.org/api/cve/CVE-2026-109618)
- [VulnCheck, PHP2Shell](https://www.vulncheck.com/blog/php2shell-vulnerabilities)
- [CISA Known Exploited Vulnerabilities catalog](https://www.cisa.gov/known-exploited-vulnerabilities-catalog)

---

Data from PatchTonight (https://patchtonight.com), compiled from vendor advisories, CISA KEV and FIRST EPSS. Please credit PatchTonight and link to the CVE page when you use it.
