Two Critical PHP RCEs, Explained

Security • PHP • Advisory • October 21, 2026

Yesterday PHP did something it rarely does: a day-before warning, promising a release for 14:00 UTC today, with the line “we reserve the right to release earlier if details go public or we see exploitation in the wild.” That’s not php.net’s normal temperature.

Today the release landed. PHP 8.5.12, 8.4.27, 8.3.36, and 8.2.35 fix two critical vulnerabilities that allow unauthenticated remote code execution. Both are rated CVSS v4.0 9.2. The advisory banner on php.net says “update now,” and the project doesn’t write like that on an ordinary Tuesday.

So: if PHP answers HTTP requests for you, updating is the whole job. Go do that, then come back for the analysis.

The short version:

  • Fix: PHP 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35. Restart your PHP workers afterward — don’t just reload your feelings about it.
  • CVE-2026-109618 — RCE via OOM corruption. Out-of-memory handling can longjmp() out of a context that wasn’t finished initializing; request shutdown then reads invalid state as if it were valid.
  • CVE-2026-109619 — RCE via stale global state. Request-owned state survives past its freed memory; the next request on the same worker can consume it before initialization resets it.
  • No complete mitigation exists. The config changes below reduce exposure to specific paths. They do not make an installation safe. Both advisories say so, in a warning box, in bold.
  • Worst case is Apache mod_php, where a demonstrated exploit runs before any of your application code executes. Your input validation was never in the conversation.
  • PHP 8.1 and older get no official fixes — but given the severity, the security team shipped minimal source backport branches for 7.4, 8.0, and 8.1. That’s unusual, and for shops still living on old branches, that’s the headline.

CVE-2026-109618: The Out-of-Memory Corruption

PHP handles out-of-memory conditions with longjmp() — a hard sideways exit out of whatever it was doing, straight to request shutdown. It’s a decades-old pattern, and it’s the first place you look when “graceful error handling” and “memory that’s mid-initialization” occupy the same sentence.

Here’s the bug, plainly: there are contexts where request memory is reachable before it’s fully initialized. If any allocation fails at that moment — the failed allocation doesn’t even have to be related to the half-built memory — PHP exits without accounting for the early jump. Shutdown then reads or branches on state that was never completed. Invalid data, treated as valid, at shutdown time.

How does an attacker force OOM on purpose while staying under your limits? The advisory lists the multipart tricks:

  • A multipart request without a usable Content-Length can slip past the initial post_max_size check and keep feeding decoded body data anyway.
  • A single multipart part can carry an unbounded number of headers. PHP’s in-memory representation of headers costs far more than the wire bytes — a request that looks small on the wire blows memory_limit in RAM.
  • Empty file controls don’t count toward max_file_uploads, but they still build the normal file metadata arrays. Nested field names multiply the array work.

None of that requires your application to do anything wrong, because on mod_php it happens during request startup — before a single line of your code runs. Apache unconditionally invokes request shutdown, even when startup itself failed, which is exactly what closes the exploit window on other SAPIs. (FPM exits the child when request startup fails, which kills this path — though source analysis still supports FPM as susceptible through post-startup OOM. FrankenPHP, which like mod_php calls shutdown unconditionally, is assessed as likely susceptible. LiteSpeed’s LSAPI models FPM.)

The fix: the patch takes longjmp() out of the OOM path entirely. OOM becomes a delayed, graceful “soft” failure at the next safe point in the VM, plus a “hard” _exit() if consumption crosses a second, higher threshold. Shutdown never sees the invalid state, and PHP keeps its ability to cap memory. It’s a clean structural fix — the kind you’d want if you were reviewing the diff yourself.

CVE-2026-109619: The Stale Global State

This one is the more interesting bug, because it’s a lifecycle bug — and lifecycle bugs are how worker-based SAPIs get hurt.

PHP-FPM and mod_php workers are long-lived: the process stays up, request memory gets freed between requests, and global state (error state, session state, object and extension state) must be reset before that memory is released. Some operations run before normal initialization of the next request. The advisory frames it as a producer-consumer pair:

  1. Producer: a PHP operation stores request-owned state in a global location — and then a fatal error (parse failure, uncaught exception, failed require, Maximum execution time exceeded, or OOM) abandons the operation before its matching reset runs. A non-fatal diagnostic during later shutdown can even repopulate error state after shutdown already cleared it.
  2. The request heap is freed. The worker’s global field still points at it.
  3. Consumer: a later request on the same worker reads, frees, or branches on that stale state before normal initialization gets the chance to reset it.

Use-after-free, heap-sculpted, unauthenticated.

Two consumers are confirmed:

INI diagnostics before initialization. A warning raised while applying invalid or deprecated settings early touches error state before PHP decides whether to report it. Which leads to the sentence you should read twice: changing error_reporting, using @, or disabling display_errors does not protect you. The state is accessed before any reporting decision is made. On mod_php, .htaccess and directory-level php_value/php_flag configuration is applied before php_request_startup() — which is why per-directory settings are part of the attack surface here. Normal php.ini and FPM pool config are startup configuration and don’t replay per request; .user.ini applies after normal initialization — which is why the official mitigation says setting these via ini_set() or .user.ini doesn’t count.

Session upload progress. This feature — enabled by default, requiring no session_start() call in your code — can reach session handling before ordinary module initialization. Interrupt a request fatally after it publishes state (the demonstrated application-independent trigger is OOM during input processing), and a subsequent upload-progress operation on the same worker consumes the leftover state. The confirmed RCE case on PHP 8.5 involves fatal_error_backtraces: fatal-error reporting stores request-owned backtrace state whose reset is always missed during shutdown.

The validated exploit paths: fatal-backtrace RCE confirmed against mod_php; session-lifecycle RCE validated against both mod_php and FPM — the FPM path publishes state during application execution, hits a fatal, then consumes it via upload progress on the next request. Works on a normal dynamic pool.

The fix: the complete patch resets the wider state family — nothing request-owned survives into operations that precede normal initialization. That’s the only reliable repair, and the advisory says so explicitly: there is no complete generic configuration mitigation.

The Severity: Reading a 9.2 Honestly

Both CVEs carry the identical CVSS v4.0 vector:

CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N   →   9.2 (Critical)

In English:

MetricValueWhat it means here
Attack VectorNetworkRemote, over HTTP. The internet.
Attack ComplexityHighNot a one-shot copy-paste; the heap has to be groomed.
Attack RequirementsPresentNeeds specific conditions — same worker for producer/consumer, retries.
PrivilegesNoneUnauthenticated. No account, no API key.
User InteractionNoneNobody has to click anything.
Impact (C/I/A)High / High / HighFull compromise of the vulnerable system.

Two questions people actually ask:

“Why isn’t this 10?” Because AC:H and AT:P are real: multiple workers, unrelated traffic, and allocator layout mean an attacker needs attempts and luck. The advisory is candid that extra workers “increase the required number of attempts but do not remove the condition.”

“Why shouldn’t I shrug at High complexity?” Because “high complexity” in CVSS-land still means a determined remote attacker with a working exploit — and this advisory contains a working exploit, validated over HTTP against default mod_php. Mass scanners don’t need reliability; they need one hit on one worker. And the account they get is your web worker: the one whose environment has your database credentials in .env. Confidentiality, integrity, availability — all rated High, all deserved.

Also worth sitting with: on the mod_php path, the exploit completes before your application boots. Every security control you’ve built lives downstream of where this bug fires.

For calibration: this is a genuinely coordinated disclosure — advance notice on the 20th, release on the 21st at 14:00 UTC, patches pre-positioned with distros and LTS vendors, credits to the reporters, and an explicit threat of early release if details leaked. Dozens of eyes were on this before it hit the archive. It’s as handled as a critical can be, and it’s still a 9.2.

Who’s Actually Exposed

SAPIExposureWhy
Apache mod_phpHighest — confirmed RCE, pre-applicationUnconditional shutdown even on failed startup; .htaccess php_value is an early INI consumer
FrankenPHPLikely similarAlso calls shutdown unconditionally; no early-INI consumer established by default, but “not immune”
PHP-FPMConditional, but confirmed via session pathStartup failure kills the child (blocks one path); frontend PHP_VALUE params and the upload-progress consumer remain; validated app-fatal exploit
LiteSpeed (LSAPI)Conditional candidateModels FPM; can apply special environment INI values early
php-cgi and friendsAt risk per advisory“All PHP installations serving web requests”

A few non-obvious things to check while you’re in there:

  • session.upload_progress.enabled is on by default, and your code doesn’t have to use sessions for it to matter. The advisory suggests turning it off even after patching, on the grounds that it’s a hardly-used, hardly-tested feature attackers are now reading about.
  • PHP 8.5’s fatal_error_backtraces — set to 0 blocks the confirmed 8.5 producer path (before you’re patched).
  • Obsolete or invalid INI settings applied per request emit diagnostics before initialization. Remove them; hiding them with @ or error_reporting changes nothing.
  • Attacker-reachable fatal errors — upload, import, error pages, timeouts, destructors, callbacks — are producers. Your “pretty 404” that throws a fatal is now a security chore.
  • The audit trick from the advisory: run an isolated pass with log_errors=On, a real error_log, and E_ALL, and look for warnings repeating before your script runs. But — their words — “absence of an error in logs is not proof of safety.” Logs supplement the audit; they don’t replace it.

If You Absolutely Cannot Update Today

The advisories frame these as exposure-reduction, not safety. The ones worth knowing:

For the OOM bug:

  • memory_limit=-1, enforced administratively (php_admin_value in the FPM pool or Apache config), with no pool/directory/ini_set path putting a finite limit back. This removes the controllable OOM — an underlying mmap() failure can still reach the vulnerable path.
  • Low post_max_size — 8M if you don’t need uploads, 32M if you do — plus frontend limits on decoded size, field counts, part counts, header counts, nesting depth, including requests without a Content-Length.
  • A container/cgroup memory limit as an availability boundary, ideally one that kills only the affected worker.
  • Do not use RLIMIT_AS or RLIMIT_DATA. They make mmap() fail at the limit, which is precisely the trigger for the vulnerable longjmp(). A “hardening” setting that arms the exploit is exactly the kind of thing worth remembering.

For the stale-state bug:

  • session.upload_progress.enabled=0 — in php.ini, FPM pool, or server config, applied before request parsing — then restart every worker. ini_set() and .user.ini don’t qualify.
  • On 8.5: fatal_error_backtraces=0, same rules, same restart.
  • Kill attacker-reachable fatals and timeouts; purge pre-initialization diagnostics at the source.

Then update anyway. These are seatbelts, not airbags.

The Lazy Checklist

  1. Find your versions. php -v and php-fpm -v (or php -i for the SAPI — “Server API” tells you which row of the table you’re in). Compare against 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35.
  2. Update from your distribution or LTS vendor — they received patches in advance. The volunteer rpms.remirepo.net will not have same-day updates; the project explicitly asks people to move off it for security reasons.
  3. Restart PHP workers — FPM restart, Apache restart. Pooled workers keep old code until they’re recycled.
  4. Verify — php -v again, and confirm session.upload_progress.enabled didn’t come back from a .user.ini or directory override.
  5. On PHP 8.1 or older: your official fix doesn’t exist. Prefer a vendor backport or an upgrade; if you build from source and have nothing else, the project published minimal backport branches — PHP-7.4-CVE-2026-109618-109619, and the 8.0/8.1 equivalents — specifically “given the severity.” I run a production platform still on 7.4, so I don’t take that gesture for granted. EOL PHP without a vendor is now a decision you’re making with full information.
  6. 8.2 users: you got your fix today, and 8.2 hits end of life on December 31, 2026. This is the last alarm before the lights go out. Plan the upgrade.

Why This One Earns the Banner

Most security advisories describe what an attacker needs to build. This one describes something the PHP team already built, validated over HTTP, and handed to four reporters’ credit lines.

Two different bug classes — an exceptional-condition handling flaw and a request-lifecycle flaw — converging on the same outcome: unauthenticated code execution in your worker, and in the worst configuration, before your application’s first statement. The fix is structural in both cases: stop jumping out of half-initialized contexts, and stop letting request state outlive its request.

There’s no clever workaround to take credit for here. The fix fits in a package update and a worker restart.

Whoever runs the deploy owns the exposure. That’s always been true too.

Resources