Skip to content
Memory corruption Write-up Advanced

PHP2Shell – Critical Vulnerabilities in PHP Core (CVE-2026-109618/CVE-2026-109619)

Two use-after-free flaws in PHP core let an unauthenticated attacker trigger an out-of-memory error with crafted HTTP requests, after which PHP may use freed memory. This can lead to memory disclosure and potentially remote code execution.

OffSec Team Follow

Published on offsec.com

PHP2Shell – Critical Vulnerabilities in PHP Core (CVE-2026-109618/CVE-2026-109619)

OffSec Team, on offsec.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely an out-of-memory error calls longjmp() to abort request handling while other C routines still hold references to the memory, so internal counters and global state treat freed memory as valid.

What the attacker needed

Web service uses PHP 5.4 or later; PHP version below the patched releases; attacker can send HTTP requests; same worker process handles follow-up request

The fix

The vulnerabilities were fixed by updating PHP to version 8.2.35, 8.3.36, 8.4.27, 8.5.12 or later.

How it was found

  1. Send a crafted HTTP multipart request with no declared Content-Length and a nested file upload with no filename to exhaust PHP memory.
  2. Trigger an out-of-memory error so PHP calls longjmp() and aborts handling while memory is still referenced.
  3. For CVE-2026-109618, submit a malformed OOM-inducing POST request so the $_POST array is left with invalid entries.
  4. When PHP cleans up the malformed $_POST array, it references a function pointer table tagged by the invalid memory region, allowing execution redirection.
  5. For memory disclosure, trigger an OOM during session initialisation, then send another multipart request without a file part to the same worker to leak heap memory in the PHPSESSID cookie.
  6. For CVE-2026-109619, poison the global fatal error backtrace with attacker-controlled data via an OOM, then send a second request to the same worker so it acts on the improperly reset state.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

PHP is a programming language used by many websites. A use-after-free bug means the program frees a piece of memory but later still tries to use it, so an attacker can sometimes control what is there. Here, sending special web requests that exhaust memory can make PHP use freed memory, which may let an attacker read data or run their own code.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.