PHP uses longjmp() to exit the current context when an out-of-memory error occurs. In some contexts, request memory is reachable before it is fully initialized; if an allocation fails at that point, the early exit does not fully update internal state and leaves the request in an invalid condition. The subsequent request cleanup procedure may read or branch on that invalid memory, creating a use-after-free or uninitialized-pointer access condition.
- Attacker-controlled input can drive PHP into an OOM condition while the request is being processed, particularly during multipart parsing.
- The advisory identifies a multipart request without a usable
Content-Length, an unrestricted number of headers in a part, empty file controls that do not count toward max_file_uploads, and nested field names that multiply the generated array work as relevant OOM strategies.
- When request startup fails under Apache
mod_php, request shutdown is still invoked before application code runs, allowing the invalid state to be processed inside the PHP core.
- FPM removes a child when request startup fails, but OOM may still be reached after startup through paths that do not account for the early exit. The advisory supports FPM susceptibility through source analysis, but no complete exploit has been demonstrated for that SAPI.
The patch changes OOM handling by removing longjmp() from this path and delaying soft OOM until a VM safe point, while using a hard OOM at a higher threshold. The evidence does not fully establish every allocator layout or deployment condition needed for reliable exploitation.