
PHP Memory Corruption via OOM longjmp() Leads to Remote Code Execution (CVE-2026-109618)
Actively exploited: listed in the CISA KEV catalog
- CVE published
- Exploitation confirmed (CISA KEV)
- Fix released
- Last checked
A fix was available for 5 days before exploitation was confirmed. If it isn't installed yet, install it now.
Researched and written by AI agents from official sources, fact-checked by a second agent against those sources, and reviewed by a person before publishing. Mistakes are still possible: confirm the details in the original advisory linked below.
Timeline of updates
3 December 2026
What changed:
- Fix release date updated to 2026-10-21 (all patched versions 8.2.35, 8.3.36, 8.4.27, 8.5.12 released on this date).
Affected versions now:
Vulnerable if you’re running any of these branches below the fixed version. The fix for all branches was released on 2026-10-21:
| PHP branch | Vulnerable | Fixed |
|---|---|---|
| 7.3.0 - 8.2.34 | Yes | 8.2.35 |
| 8.3.0 - 8.3.35 | Yes | 8.3.36 |
| 8.4.0 - 8.4.26 | Yes | 8.4.27 |
| 8.5.0 - 8.5.11 | Yes | 8.5.12 |
All PHP installations using Apache mod_php or FrankenPHP with default or custom memory limits and automatic body parsing are affected. PHP-FPM is also susceptible when an out-of-memory condition is reached in application-specific contexts after normal startup.
Fix now:
- Update PHP to 8.2.35, 8.3.36, 8.4.27, or 8.5.12 (or later), matching your current branch. These versions, all released 2026-10-21, close the vulnerability.
- Restart Apache/mod_php, FrankenPHP, or PHP-FPM workers after updating so the new binary is actually loaded.
- Confirm the running version with
php -vand check your web server’s phpinfo output, since some environments keep stale cached workers.
If you can’t patch immediately, apply these as temporary measures, not substitutes for the update:
- Set memory_limit=-1 administratively across all pools, vhosts, and app-level overrides. This removes the predictable per-request memory ceiling the confirmed exploit relies on, but does not close the underlying bug.
- Keep post_max_size conservative and enforce a decoded request size limit at your reverse proxy/frontend, since declared content-length can’t be trusted.
- Lower max_input_nesting_level and cap the number of input variables, multipart parts, headers, and file uploads allowed per request.
- If your application doesn’t need multipart form uploads, block multipart/form-data requests at the frontend entirely.
- If you rely on container/cgroup memory limits instead of PHP’s own memory_limit, note that’s only a partial substitute, not a complete fix.
- Do not use RLIMIT_AS or RLIMIT_DATA to cap PHP process memory — these cause mmap() failures that trigger the exact vulnerable longjmp() path instead of preventing it.
Original post, published 23 November 2026:
Summary
PHP mishandles out-of-memory conditions: when an allocation fails mid-request, PHP uses longjmp() to bail out of the current context, but request memory can be left uninitialized before the shutdown procedure runs. That shutdown code then reads or branches on the bad memory, giving an unauthenticated attacker a path to remote code execution. This is actively exploited in the wild, and anyone running PHP under Apache mod_php or FrankenPHP should treat this as urgent.
Affected versions
Vulnerable if you’re running any of these branches below the fixed version:
PHP branch | Vulnerable | Fixed 7.3.0 - 8.2.34 | Yes | 8.2.35 8.3.0 - 8.3.35 | Yes | 8.3.36 8.4.0 - 8.4.26 | Yes | 8.4.27 8.5.0 - 8.5.11 | Yes | 8.5.12
Apache mod_php is universally susceptible because it runs the request shutdown procedure even when request startup itself failed. FrankenPHP is affected under default or custom memory limits with automatic body parsing enabled. PHP-FPM is also affected, but only when an out-of-memory condition is hit in application-specific code after normal request startup has completed.
Severity
CVSS 9.2 (critical) — unauthenticated, network-reachable, full remote code execution. CISA added this to its Known Exploited Vulnerabilities catalog on 2026-10-26, confirming active exploitation. Known attacks abuse multipart form parsing to force an OOM condition: requests without a usable declared content length skip the normal post_max_size check, multipart parts can carry unbounded headers that use far more memory than their wire size suggests, and empty file upload fields create metadata entries that don’t count against max_file_uploads. Full RCE has been demonstrated over HTTP against mod_php in a standard prefork setup with default settings.
Fix
- Update PHP to 8.2.35, 8.3.36, 8.4.27, or 8.5.12 (or later), matching your current branch.
- Restart Apache/mod_php, FrankenPHP, or PHP-FPM workers after updating so the new binary is actually loaded.
- Confirm the running version with
php -vand check your web server’s phpinfo output, since some environments keep stale cached workers.
If you can’t patch immediately, apply these as temporary measures, not substitutes for the update:
- Set memory_limit=-1 administratively across all pools, vhosts, and app-level overrides. This removes the predictable per-request memory ceiling the confirmed exploit relies on, but does not close the underlying bug.
- Keep post_max_size conservative and enforce a decoded request size limit at your reverse proxy/frontend, since declared content-length can’t be trusted.
- Lower max_input_nesting_level and cap the number of input variables, multipart parts, headers, and file uploads allowed per request.
- If your application doesn’t need multipart form uploads, block multipart/form-data requests at the frontend entirely.
- If you rely on container/cgroup memory limits instead of PHP’s own memory_limit, note that’s only a partial substitute.
- Do not use RLIMIT_AS or RLIMIT_DATA to cap PHP process memory — these cause mmap() failures that trigger the exact vulnerable longjmp() path instead of preventing it.
Original sources
Every version of this post on GitHub
Spotted a mistake? Report it and the correction is published on this page.