If you run PHP on the web, this one’s worth five minutes of your time.
At a glance
- CVE: CVE-2026-109618 — one half of the “PHP2Shell” pair, alongside CVE-2026-109619.
- Severity: 9.8 (Critical) — about as bad as the scale goes.
- Affected: any PHP older than 8.2.35, 8.3.36, 8.4.27, or 8.5.12. On older, unsupported branches (8.1 and back) you’ll need a backport from your distro.
- Known exploited: Yes — it’s on CISA’s KEV list, and Arctic Wolf saw people scanning for it and trying it out within days of it going public.
What’s going on
Here’s the short version. When PHP runs out of memory in the middle of a request, it bails out using longjmp(). The trouble is that in a few spots the request’s memory is only half set up when that happens, and the cleanup that runs afterwards trips over that half-finished state. An attacker can push PHP out of memory on purpose — a couple of multipart form-upload tricks do it well within PHP’s normal limits — and ride that broken cleanup into running their own code.
What does that mean for you? It’s unauthenticated remote code execution: someone can run commands on your box as the web user, with no login and no clicking on your end — just HTTP requests. It’s been proven against Apache with mod_php on default settings, and FrankenPHP, LiteSpeed/LSAPI and PHP-FPM look vulnerable too. So if your server runs PHP for the web, treat it as exposed until you’ve patched.
Even the NSA says: patch it or pull the plug
This one was serious enough that the NSA put out its own advisory the same day the patches landed. Their advice is blunt: take an inventory of everything that runs PHP, patch right away, and if you can’t update immediately, take the system offline until it’s fixed. They also said the risk is serious enough to require immediate patching across US government departments and agencies, and that attackers are likely to weaponize these bugs. CISA, the UK’s NCSC, Australia’s ACSC and CERT-EU put out guidance too.

The NSA’s Facebook post on 21 October 2026. Original post · Full advisory on nsa.gov
Timeline
- Disclosed: 2026-10-21
- Patch released: 2026-10-21 (an emergency release)
- NSA advisory: 2026-10-21 (patch now, or take the system offline)
== UPDATE ==
Good news: there’s a fix, and patching is the only thing that really closes this.
- Patch available: Yep.
- Fixed in: PHP 8.2.35, 8.3.36, 8.4.27, 8.5.12.
- How to apply: Update PHP through your package manager (or PHP distribution) to the fixed release for your branch, then restart your web server and all PHP-FPM pools so every worker picks up the new build. Stuck on an unsupported branch? You’ll need a distro/LTS backport, or to move up to a supported one.
- If you can’t patch right this minute: the NSA’s advice is simply to take the server offline until you can. If that’s not an option either, nothing below is a complete fix, but it lowers the odds. The advisory’s main tip is to set
memory_limit=-1everywhere and restart all workers (it helps, but it’s not a full fix on its own). Also keeppost_max_sizemodest, cap request size at your proxy or WAF, dropmax_input_nesting_level, and if your app never touches multipart form data, just block those requests up front. If you want to cap memory, do it with a container/cgroupmemory.max— steer clear ofRLIMIT_AS/RLIMIT_DATA, because those actually make the bug easier to trigger.
References
- https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w
- https://www.nsa.gov/press-room/press-releases-statements/press-release-view/article/4630238/nsa-advisory-critical-patches-recommended-for-php-vulnerabilities/
- https://www.facebook.com/NSAUSGov/posts/effective-immediately-all-organizations-using-php-for-their-systems-are-advised/1531572895668675/
- https://arcticwolf.com/resources/blog/php2shell-critical-php-vulnerabilities-enable-unauthenticated-remote-code-execution/
- http://www.openwall.com/lists/oss-security/2026/10/21/6
- http://seclists.org/fulldisclosure/2026/Oct/51
- https://github.com/rapid7/metasploit-framework/pull/22139