The PHP project has released fixes for a critical out-of-memory (OOM) memory-corruption flaw, tracked as CVE-2026-109618. It can give unauthenticated remote attackers code execution on vulnerable web servers.
The advisory, GHSA-w8hw-w9fx-j79w, was published on October 21, 2026, and rates the bug 9.2 (Critical) under CVSS v4.
PHP 8.5.12 security flaws
According to the security advisory published on GitHub, PHP uses longjmp() to leave the current context and abort a request when it runs out of memory. In some contexts, request memory is reachable before it is fully initialized.
If any allocation fails at that point, PHP doesn’t account for the early exit and leaves the request memory in an invalid state. The failed allocation does not need to relate to the corrupted memory.
The request shutdown routine can then read or branch on that state, and the advisory says several OOM strategies can trigger this reliably and lead to remote code execution.
The weaknesses listed are CWE-416 (use after free), CWE-755, CWE-824 (uninitialized pointer), CWE-1325 and CWE-1419.
The advisory describes several multipart-parsing problems that push a request into OOM while it still appears to respect PHP’s limits. A multipart request without a usable declared content length can pass the initial post_max_size check and keep supplying decoded body data.
Furthermore, a multipart part can carry an unlimited number of headers, and their in-memory representation is far larger than their size on the wire, so a request within post_max_size can exhaust memory_limit.
In addition, empty file controls don’t count toward max_file_uploads but still create file metadata arrays, and nested field names multiply that work, while application-specific input that triggers large or repeated allocations can also reach OOM.
Apache mod_php is the most exposed. It always runs request shutdown, even when startup fails, so body parsing can exhaust memory and leave invalid state before any application code runs.
Researchers validated full unauthenticated RCE over HTTP against mod_php with default input and memory limits and normal prefork setups. Extra workers and unrelated traffic only raise the number of attempts needed.
FPM exits the child process when startup fails, which blocks the startup path. OOM can still occur after normal startup. The impact is code execution as the web worker account, and reliability depends on the PHP build, extensions, frontend behavior and allocator layout.
| Branch | Vulnerable | Patched |
| 8.2 | < 8.2.35 | 8.2.35 |
| 8.3 | < 8.3.36 | 8.3.36 |
| 8.4 | < 8.4.27 | 8.4.27 |
| 8.5 | < 8.5.12 | 8.5.12 |
The CVSS v4 vector is AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H. That means network-reachable, no privileges, no user interaction, and high attack complexity.github
The patch removes longjmp() for OOM. It adds a delayed, graceful soft OOM at the next VM safe point, plus an immediate hard OOM through _exit() if usage reaches a second, higher threshold. Shutdown no longer sees invalid state.
Updating is the only complete fix. For servers that can’t update yet, the advisory suggests stopgaps including enforcing memory_limit=-1, restarting every worker, and confirming no pool, directory or application setting restores a finite limit, though this is not complete because a failed mmap() can still trigger longjmp().
Administrators should also keep post_max_size conservative and enforce decoded request size at the frontend, lower max_input_nesting_level, and cap input variables, multipart parts, headers per part and uploads.
In addition, teams should block multipart requests at the frontend if the application doesn’t use them, avoid using RLIMIT_AS or RLIMIT_DATA since they make mmap() fail and trigger the vulnerable path, and note that container or cgroup memory.max limits are only a partial alternative because killing a cgroup can take down the master and all workers.
Administrators should also follow the remediation advice in the related advisory GHSA-6wmf-4rv5-p3rp. The advisory credits four reporters and four remediation developers.