PHP shipped emergency fixes for two unauthenticated remote code execution bugs
Short answer
On October 21, 2026, PHP released 8.2.35, 8.3.36, 8.4.27, and 8.5.12 to fix two critical vulnerabilities, CVE-2026-109618 and CVE-2026-109619. The 8.4.27 release notes say both can allow unauthenticated remote code execution and that updating is the only safe choice. The matching advisories are GHSA-w8hw-w9fx-j79w, an out-of-memory state corruption, and GHSA-6wmf-4rv5-p3rp, a use-after-free from stale per-request state kept on a worker. The project changelog lists both advisory IDs and both CVE IDs on one line and does not pair them one-to-one. There is no complete configuration workaround.
Last updated · Sekrd Research
- When: advisories and releases published October 21, 2026. PHP 8.5.12 and 8.4.27 tags were published about 14:06 and 14:07 UTC. The NEWS file dates the 8.5.12 notes October 22.
- CVEs: CVE-2026-109618 and CVE-2026-109619. The 8.4.27 announcement calls both critical and says they can allow unauthenticated remote code execution.
- Advisories: GHSA-w8hw-w9fx-j79w (RCE via OOM corruption) and GHSA-6wmf-4rv5-p3rp (RCE via stale global state). Both published by bukka.
- Patched versions named on the advisories: 8.2.35, 8.3.36, 8.4.27, 8.5.12.
- Workaround: the 8.4.27 release says there are no complete mitigations. The OOM advisory says memory_limit=-1 is not a complete mitigation.
What happened
PHP’s October 21, 2026 security releases fix two bugs the project describes as critical unauthenticated remote code execution. The 8.4.27 and 8.5.12 announcements use the same sentence: update immediately, there are no complete mitigations, updating is the only safe choice. The NEWS entry for 8.5.12, dated October 22, lists both GitHub advisories and both CVE IDs in a single bullet. It does not say which CVE belongs to which advisory. This article does not invent that pairing.
The two write-ups describe different mechanisms that share a theme. PHP sometimes abandons a request in the middle of setting up state, and a later step trusts that state. One path is an out-of-memory bailout. The other is global state that still points at memory from a request that has already ended.
Timeline
- October 21, 2026. GHSA-w8hw-w9fx-j79w and GHSA-6wmf-4rv5-p3rp published. PHP 8.5.12 tagged at 14:06 UTC and PHP 8.4.27 at 14:07 UTC, both by adoy.
- Versions the release announcements tell you to install: 8.4.27 for the 8.4 line, 8.5.12 for the 8.5 line. The advisories’ patched list also includes 8.2.35 and 8.3.36.
- Affected ranges the stale-state advisory prints: below 8.2.35, below 8.3.36, below 8.4.27, and below 8.5.12. The OOM advisory’s affected field, as fetched, lists below 8.2.35 and below 8.3.36, while its patched list also includes 8.4.27 and 8.5.12. Follow the release that matches the line you run.
The two mechanisms, in plain language
Out-of-memory bailout
GHSA-w8hw-w9fx-j79w says PHP uses longjmp() to leave a request when it runs out of memory. In some moments during startup, request memory exists but is not fully initialized. If an allocation fails then, PHP does not account for the early exit and leaves that memory in an invalid state. The failed allocation does not have to be the one that touches the bad memory. Request shutdown can later read or branch on it. The advisory says several out-of-memory strategies can trigger this and lead to remote code execution.
On Apache mod_php, shutdown runs even when startup failed, before any application code. The advisory says that path is the confirmed one. It says FPM is susceptible on source review after a normal startup, and that no complete FPM exploit has been demonstrated. FrankenPHP is described as likely susceptible. LSAPI is described as modeling FPM, with application-specific exploits likely but unvalidated.
The patch stops using longjmp() for out-of-memory. A soft failure waits for the next safe point in the VM. A hard failure calls _exit() if memory hits a second, higher threshold. The advisory’s warning is unchanged by that explanation: installing a release that contains the patch is the only complete mitigation. Setting memory_limit=-1 removes one predictable per-request limit and is not complete, because a failed mmap() can still take the old path. Restart every worker after you change the setting, and do not let a pool or a directory config put a finite limit back.
Stale state on the next request
GHSA-6wmf-4rv5-p3rp says a worker keeps global fields for errors, sessions, objects, and extensions that point at memory owned by one request. That state has to be cleared before the request memory is freed. Some operations run before the next request is fully initialized and can touch state the previous request left behind. The result the advisory names is a use-after-free, and a crafted heap layout can turn it into remote code execution.
The advisory says a real exploit needs a producer and a consumer on the same worker, in different HTTP requests. A fatal error, including memory exhaustion, can abandon an operation before it resets state. A non-fatal diagnostic during a later shutdown can also write new request-owned error data back into the global field after it was cleared. The consumer runs before normal initialization. The advisory says changing error_reporting, using @, or turning off display_errors and log_errors does not close that path, because the global state is touched before PHP decides whether to report the diagnostic.
How to check if your app is exposed
- On every host that runs PHP, run
php -v. You want 8.2.35, 8.3.36, 8.4.27, or 8.5.12, or a later patch on that line. A version in composer.json is not the server binary. - Restart php-fpm, Apache, or the process manager after the package update. A long-lived worker keeps the old binary until it is recycled.
- Do not rely on
memory_limit=-1as a fix. The OOM advisory says it is not complete. Do not send a proof-of-concept request at a production pool to see if it crashes. The check is the version. - If the public site is a Next.js or Lovable app and PHP only serves a side path, an old
public/blog, a webhook in a/apifolder you forgot, or a packaged adminer, that path is still in scope. The October 14 Next.js bugs are a separate patch: those advisories. - After the workers are new, confirm a second time with
php -vfrom the same user the pool uses. A CLI binary and the FPM binary are not always the same package.
How Sekrd helps
Sekrd’s dependency check queries OSV for JavaScript, Python, Go, and Ruby packages it finds in the shipped bundle. It does not read your server’s php -v, and it will not flag CVE-2026-109618 or CVE-2026-109619 from a homepage. The cadence of that OSV query is documented on the vulnerability-update page. Use it for the npm side of the same week, including the tensorlake release and the Next.js versions, and use the package manager on the host for PHP.
A free scan still answers a different question: did the app you generated put a secret, an open database, or a missing header on the URL users hit while you were patching the runtime. That is the check for a Lovable, Bolt, Cursor, v0, or Replit deploy. PHP on the box is yours to upgrade.
Related reading
Frequently asked questions
Which PHP versions fix CVE-2026-109618 and CVE-2026-109619?
The advisories list 8.2.35, 8.3.36, 8.4.27, and 8.5.12 as patched. The 8.4.27 and 8.5.12 release announcements tell users of those lines to update immediately.
Which CVE is which advisory?
PHP’s NEWS entry lists GHSA-w8hw-w9fx-j79w and GHSA-6wmf-4rv5-p3rp together with CVE-2026-109618 and CVE-2026-109619. It does not pair them. This article does not assign one CVE to one advisory.
Is PHP-FPM affected by the out-of-memory bug?
The OOM advisory says FPM exits the child when request startup fails, which blocks that particular path, and that after a normal startup an out-of-memory condition can still leave invalid state. It says no complete FPM exploit has been demonstrated for this SAPI, and it still says updating is the only complete mitigation.
Does memory_limit=-1 fix it?
No. The OOM advisory calls that the primary configuration mitigation and says it is not complete, because a failed underlying allocation can still take the old longjmp path.
Will Sekrd detect these PHP CVEs on a website scan?
Not from the homepage. The dependency channel queries OSV for packages discovered in the JavaScript, Python, Go, or Ruby bundle. Confirm PHP with php -v on the server.
Sources
Don't ship until you're sekrd
Run a free scan to find the vulnerabilities your AI missed.
Scan Your App Free