Two critical vulnerabilities in the PHP engine itself that let an unauthenticated attacker run code on your web server over plain HTTP — and even read its memory. Your application can be fully up to date and still be exposed.
Upgrade to 8.2.35, 8.3.36, 8.4.27 or 8.5.12 — then restart every PHP worker (Apache, PHP-FPM). Updating WordPress, Laravel, Drupal or plugins does not fix this. Check changelogs if you use distro packages, which may backport the fix under older version numbers.
PHP2Shell is the nickname researchers gave to an exploit chain built on two separate memory-safety bugs in the PHP interpreter — not in WordPress, Laravel, or any plugin. Because the vulnerable code runs while PHP is reading the request, before your application gets a say, even a fully patched application on a vulnerable PHP build can be taken over.
Both flaws are classified as CWE-824: Access of Uninitialized Pointer. The shared pattern, in one sentence: PHP can leave internal state corrupted when a request ends abnormally, and a later request — or the shutdown path of the same request — then trusts that state.
The bugs were reported by researchers at Calif, Wiz, OpenAI’s Codex security team (and Quarkslab on one of them), working with the PHP security team — found with AI assistance, and disclosed as GitHub advisories GHSA-w8hw-w9fx-j79w and GHSA-6wmf-4rv5-p3rp.
PHP uses longjmp() to abort a request when it hits an out-of-memory error. Some execution contexts don’t account for that interruption, leaving request memory uninitialized. Later cleanup reads or branches on that memory → remote code execution.
Also enables remote memory disclosure: the session upload-progress handler can return chunks of freed server memory inside the PHPSESSID response cookie — a Heartbleed-style leak that can expose DB passwords, session tokens, API keys, even TLS private keys.
PHP also uses longjmp() to abort on fatal errors. Some contexts leave global state pointing at memory that gets freed at the end of the request. A subsequent request reads or branches on that invalid state → use-after-free → remote code execution.
Includes a fatal-error backtrace generation use-after-free and an OPcache type-confusion primitive.
Demonstrated primitives beyond RCE: ~67 KB of process-memory disclosure via the PHPSESSID cookie, arbitrary file read via a stale OPcache class-cache slot redirecting a file operation, session decoder use-after-free, and worker crashes. Note: attack complexity is rated high — triggering the bug is easier than weaponizing it into reliable RCE, but it has been demonstrated, including against stock WordPress/Drupal/Joomla containers.
Check your PHP version on every web server (and don’t forget embedded copies — sidecars, workers, appliances need separate inventory):
# check the version php -v # example of a VULNERABLE build PHP 8.3.35 (cli) ... # < 8.3.36 → vulnerable # example of a FIXED build PHP 8.3.36 (cli) ... # patched
| Question | Answer |
|---|---|
| Which PHP versions? | Believed affected back to 5.4.0 (2012). Fixed in 8.5.12, 8.4.27, 8.3.36, 8.2.35; source backports published for 7.4 / 8.0 / 8.1. Distro packages may carry the fix under older numbers — check the changelog for the CVE IDs. |
| Which SAPIs? | Apache mod_php is the easiest target and highest risk; also PHP-FPM, php-cgi, FrankenPHP, LSAPI, Windows PHP. |
| Does updating WordPress / plugins fix it? | No. This is in the PHP runtime. CMS and framework updates are irrelevant to this bug. |
| Does the app need sessions/uploads? | Not necessarily — the upload-progress trigger runs before application code, even if the app never calls session_start(). |
| What does the attacker get? | Code execution as the web worker user (not root automatically) — enough to read configs/DB creds, drop webshells, and pivot. Plus potential memory disclosure of secrets and keys. |
These are not complete workarounds — they only remove the demonstrated triggers. Patch as soon as possible.
; in php.ini — temporary mitigation only, NOT a fix session.upload_progress.enabled = 0 opcache.enable = 0
CVE-2026-109618 • CVE-2026-109619 • CWE-824 • CVSS v4.0 9.2 (Critical). This page is educational and defensive — it explains the vulnerability and how to fix it. Last updated 22 Oct 2026.