Skip to content
Memory corruption Write-up Advanced

Exploit PHP2Shell (CVE-2026–109618 & 109619): From Out-of-Memory to Remote Code Execution

PHP fails to clean up memory during early request processing, leaving a dangling session pointer after an out-of-memory crash. An attacker can exploit this to leak memory addresses and overwrite a function pointer, achieving remote code execution as the web server user.

Angelska Follow

Published on medium.com

Php2shell

Angelska, on medium.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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

Context

PHP2Shell is the name given to two memory corruption vulnerabilities in PHP, CVE-2026-109618 and CVE-2026-109619. Both share the same root cause: PHP fails to clean up memory during early request processing. The author's successful lab reproduction used the Out-of-Memory corruption path, CVE-2026-109618, and separately verified the stale global state path, CVE-2026-109619, in a differential lab.

The feature at the centre of the bug is session.upload_progress, which runs very early in a request, before normal request initialisation. The target configuration is Apache with mod_php, where PHP runs as an Apache module and the vulnerability triggers during the interpreter's memory management phase before application code begins to execute. The author notes that official security bulletins identify Apache mod_php as the highest-risk deployment method.

The goal of the lab was to make the server run the id command and return uid=33(www-data). The author chose id because it safely returns the current user context, proving code execution as the low-level web server user without causing damage to the target.

Setup

The lab was a local Docker container running PHP 8.4.26 with Apache (mod_php), on a Kali Linux machine. The author acquired a public proof-of-concept (PoC) toolkit to the Kali machine to simulate the attack. The fix versions are PHP 8.4.27 and higher; the lab intentionally used the unpatched 8.4.26 to verify the exploit's effectiveness, and later ran the same attack against 8.4.27 as a negative control.

Figure 1: Initializing the local Docker lab. The script successfully starts the vulnerable PHP 8.4.26 target, which will be the victim of the exploit. From the original on medium.com

Figure 1 shows the local Docker lab being initialised: the script starts the vulnerable PHP 8.4.26 target that will be the victim of the exploit.

Finding it

The author was challenged by a mentor to find or build a working PHP exploit, analyse it and document the findings without releasing the weaponised payload. The PHP2Shell vulnerabilities had recently been disclosed. The author notes that millions of automated scanners have tried to exploit this in the wild, but confirmed, reliable Remote Code Execution has been very difficult to achieve.

The attack chain is summarised in four steps combined with precise memory math:

  • Step 0 (Pin): Lock 149 workers with fake traffic. This forces the server to process the entire attack on the 1 remaining worker, keeping the memory state stable.
  • Step 1 (A1): Send a massive file upload to cause the Out-of-Memory crash. Because the server panics, it skips cleanup, creating the dangling pointer.
  • Step 2 (B1): Trigger an out-of-bounds memory read. This steals secret memory addresses, such as the libphp base address.
  • Step 3 (A2 + B2): Send the final payload to overwrite pDestructor with zif_system, forcing the server to execute the id command.

The exploit relies on offsets such as libphp+0x65EB60, and uses math formulas to calculate exactly where zif_system lives inside the server's memory based on the leaked libphp address.

Exploitation

Step 1: Breaking the server (the OOM bailout)

  1. The exploit script sends a specially crafted file upload that forces the PHP server to run out of memory (OOM).
  2. When PHP runs out of memory, it uses a mechanism called a longjmp to jump out of the request early and abort it.
  3. Because it jumped out early, it skips the cleanup phase. The session ID pointer (PS(id)) is left pointing to a memory address that has already been freed: a dangling pointer.
Figure 2: When I ran the exploit, the terminal output confirmed the exploit triggered this exact Out-of-Memory condition (A1: END-cleanup send_cookie OOM). From the original on medium.com

Figure 2 shows the terminal output confirming that the exploit triggered this exact Out-of-Memory condition (A1: END-cleanup send_cookie OOM).

To bypass the server's worker pool and guarantee the memory state was preserved, the exploit used worker pinning. The terminal output pinned 150/150 workers (149 holders) shows the script held 149 connections open to distract the server, forcing it to process the attack on the single remaining worker, which made the exploit reliable.

Figure 3: Because this exploit relies on winning a race condition (timing the memory allocation perfectly), it does not always work on the first try. In my lab, the first attempt resulted in a heap leak failed error because the timing was off. From the original on medium.com

Because the exploit relies on winning a race condition, timing the memory allocation perfectly, it does not always work on the first try. In the lab, the first attempt resulted in a heap leak failed error because the timing was off (Figure 3).

Figure 4: On the next attempt, the memory layout aligned perfectly, and the exploit successfully executed the command. From the original on medium.com

On the next attempt the memory layout aligned perfectly and the exploit successfully executed the command (Figure 4).

Step 2: Stealing memory addresses (the info leak)

Modern operating systems use ASLR (Address Space Layout Randomization), which shuffles memory addresses so attackers cannot guess where things are. To bypass it, the exploit leaks addresses from the server:

  1. The exploit sends a second request. The server tries to use the dangling session ID pointer.
  2. Because the memory was freed and then reallocated with fake data crafted by the exploit, the server ends up reading out-of-bounds (OOB).
  3. The server takes the leaked memory address and accidentally sends it back to the attacker in the Set-Cookie HTTP header.
  4. With this leak, the exploit now knows exactly where the Zend memory manager and the libphp library are located in memory.

Figure 5, the successful memory leak, is referenced in the report but not reproduced here.

Step 3: Taking control (the exploit payload)

  1. The exploit sends a final crafted request to overwrite a specific piece of memory called pDestructor.
  2. Normally, pDestructor points to a function that cleans up memory. The exploit overwrites this pointer so it points to zif_system instead, a built-in PHP function that executes shell commands.
  3. When the PHP server finishes processing the request, it tries to clean up by calling pDestructor.
  4. Instead of cleaning up, it executes the command id.
Figure 6: The successful exploit chain- the terminal shows the calculation of zif_system (the command execution function) followed immediately by the [4/4] RCE OK and the uid=33 proof. From the original on medium.com

At this point in the script, the exploit uses the leaked libphp address to calculate where zif_system lives, then silently overwrites the pDestructor pointer with this address. The overwrite happens inside the server's RAM and is not visible on screen, but the immediate uid=33 output proves it was successful. Figure 6 shows the calculation of zif_system followed by the [4/4] RCE OK and the uid=33 proof.

Verifying the sibling vulnerability (CVE-2026-109619)

The author also verified the second PHP2Shell vulnerability, CVE-2026-109619 (stale global state), using a dedicated differential lab. This path relies on a Producer/Consumer relationship: the attacker first triggers an OOM crash (the Producer) to leave a stale session pointer in memory, then sends a second request (the Consumer) to the same worker to consume the stale state before normal initialisation can clean it up.

The exploit operates in three distinct stages:

  1. Heap Leak: the exploit crashes the worker to leak the Zend Memory Manager chunk base.
  2. Library Leak: it triggers a second crash to leak the exact memory address of libphp.
  3. Control Hijack: using the leaked offsets, it calculates the address of zif_system and overwrites the memory pointer.

Although the worker crashes with a Segmentation Fault during the final stage, the payload executes successfully before the process dies, as proven by the uid=33(www-data) output.

Figure 7: The execution of CVE-2026–109619. The terminal shows the three stages: leaking the Zend heap chunk, leaking the libphp base address, and calculating zif_system. The final proof confirms code execution as uid=33(www-data) on the vulnerable PHP 8.4.26. From the original on medium.com

Figure 7 shows the three stages in the terminal: leaking the Zend heap chunk, leaking the libphp base address, and calculating zif_system, with the final proof of code execution as uid=33(www-data) on PHP 8.4.26.

The differential lab confirms the patch works: the exact same attack against PHP 8.4.27 fails with a heap leak failed error. Because the patch resets the internal state before the second request can consume it, the memory leak fails completely.

Figure 8: The negative control. The exact same exploit is run against the patched PHP 8.4.27. The server successfully blocks the attack (heap leak failed), resulting in the final confirmation: vulnerable code executes, patched code does not. From the original on medium.com

Figure 8 shows the negative control: the same exploit against patched PHP 8.4.27, blocked with heap leak failed, confirming that vulnerable code executes and patched code does not.

Root cause

The mistake is in PHP's early request processing. When an Out-of-Memory condition or a fatal crash occurs, PHP uses longjmp to leave the request early and skips the normal cleanup phase. The session ID pointer (PS(id)) is left dangling, pointing at freed memory. A second request to the same worker then consumes that stale state: the freed memory is reallocated with attacker-crafted fake data, the server reads out of bounds, and the leaked address is returned in the Set-Cookie header. A final crafted request then overwrites the pDestructor function pointer so that cleanup calls zif_system instead.

ASLR does not stop the attack because the OOB read leaks the addresses needed to defeat it. The exploit depends on winning a race condition, so timing matters and attempts can fail, as the first lab attempt did.

Impact

Successful exploitation gives remote code execution on the web server. In the lab this was proven by running id and receiving uid=33(www-data), meaning control as the low-level web server user with access only to the website files. The author notes that reliable RCE has been very difficult to achieve in the wild despite mass scanning.

Fix

The official PHP release notes say: "There are no complete mitigations, updating is the only safe choice". The vulnerability is fixed in PHP versions 8.2.35, 8.3.36, 8.4.27 and 8.5.12. The patch ensures that both during early Out-of-Memory errors and fatal crashes, PHP properly resets the internal state and cleans up the session pointers. Updating to the latest version is the only permanent fix.

Variants to test

  • A positive result is the Set-Cookie header returning a leaked address, followed by uid=33(www-data) from the id command.
  • The stale global state path (CVE-2026-109619). Use a Producer request to crash a worker and a Consumer request to the same worker. A positive result is the three-stage output: Zend heap chunk leak, libphp base leak, and zif_system calculation, with code execution proven before the segfault.
  • Differential check against a patched build. Run the identical exploit against PHP 8.4.27 or later. A positive result for the fix is a heap leak failed error and no command output.

References

  • PHP Group. (2026). PHP 8.4.27, 8.3.36, 8.2.35, and 8.5.12 released [Security advisory]. https://www.php.net/archive
  • VulnCheck. (2026). CVE-2026-109618 and CVE-2026-109619: PHP2Shell memory corruption [Threat intelligence report].
  • Wiz Security Research. (2026). Understanding the PHP2Shell vulnerability chain: OOM bailout to RCE [Technical blog post].
  • Sophos. (2026). PHP2Shell: Why reliable exploitation remains elusive in the wild [Security analysis].
  • PoC [undisclosed]
Me and Mocha. From the original on medium.com

Me and Mocha.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 16 min read.

What happened, in plain words

A security researcher named Angelska was given a task by a mentor: find or build a working exploit for PHP, take it apart, and write down what she learned, without publishing the actual attack tool. She picked two recently disclosed bugs in PHP, together nicknamed PHP2Shell: CVE-2026-109618 and CVE-2026-109619. Both come from the same mistake: PHP does not tidy up its memory properly when a request is handled very early. She reproduced the first one (the Out-of-Memory path) in a lab on her own computer, and separately checked the second one (the stale global state path) in a second lab setup.

If you have never done anything like this, the short version is: a web server is a program that answers requests from browsers. PHP is a language that many web servers use to build those answers. These bugs let an attacker make the server run a command of their choosing, which is called Remote Code Execution (RCE). In the lab, the command was id, a harmless Linux command that just says who the server is running as. The server answered uid=33(www-data), which proves the attacker got the server to run their instruction as the low-level web server user.

A lot of automated scanners have tried this attack on real servers, but getting it to work reliably has been very hard. This article walks through the whole lab, step by step, explaining every term as it comes up.

Some background you need first

Before the steps make sense, here are the pieces of the picture, explained from zero.

What a web server and PHP are. When you open a website, your browser sends a request to a server. The server is a program on a machine somewhere that reads the request and sends back a page. PHP is a programming language often used to build that page on the fly. The server hands the request to PHP, PHP does its work, and the result goes back to your browser.

What Apache and mod_php are. Apache is one popular web server program. It can run PHP in different ways. One way is mod_php, where PHP is loaded inside Apache itself, like an extra engine bolted onto the same machine. The author notes that official security bulletins identify Apache mod_php as the highest-risk deployment method, because the bug triggers inside the interpreter's memory management before the website's own code even starts running.

What memory is, and what a pointer is. Every program keeps its working data in memory, a big shared space of numbered slots. A pointer is a small note that says "the data you want is at slot number X". If the program frees a slot (says it is no longer needed) but keeps the note, the note now points at nothing useful. That is called a dangling pointer, and it is the heart of this bug.

What a session is, and what a cookie is. Websites need to remember who you are between requests, because the web itself is forgetful. They give your browser a small label called a session ID, and your browser stores it in a cookie, a tiny piece of text the browser sends back with every request. The server keeps a note of which session ID belongs to which user. In PHP, the pointer to that session ID is called PS(id).

What session.upload_progress is. PHP has a feature that tracks file uploads while they are still in progress, so a website can show a progress bar. It runs very early in a request, before normal request initialisation. That early timing is exactly what the bug abuses.

What Out-of-Memory (OOM) means. Programs are given a limited amount of memory. If a program asks for more than it is allowed, it hits an Out-of-Memory condition and has to stop what it is doing. PHP handles this by jumping out of the request early, using a C function called longjmp. Think of it as hitting the emergency exit: you leave the building fast, but you skip turning off the lights and locking the doors on the way out.

What a worker is. A busy web server does not handle everything in one process. It keeps a pool of workers, separate processes that each take one request at a time. If you want two requests to hit the same piece of memory, you need them to land on the same worker.

What ASLR is. Modern operating systems use Address Space Layout Randomization: every time a program starts, its memory slots are numbered differently, so an attacker cannot guess where anything lives. To beat it, an attacker needs to leak an address, that is, get the server to reveal one.

What a race condition is. Some attacks depend on timing: if two things happen in the right order, the attack works; if not, it fails. That is a race condition. It explains why the first attempt in this lab failed and the second worked.

What a proof of concept (PoC) is. A PoC is a demonstration that a bug can actually be triggered. The author downloaded a public PoC toolkit to her Kali machine (Kali is a Linux distribution made for security testing) to simulate the attack.

The goal and the lab setup

The goal was to make the server run the id command and return uid=33(www-data). The author chose id because it is safe: it just asks the computer "who am I right now?" and prints the answer. If the server answers, it proves the attacker tricked it into running an instruction. Because the answer is www-data, we know the attacker got the low-level web server user, which only controls the website files, not the whole machine.

The lab was a local Docker container running PHP 8.4.26 with Apache (mod_php). Docker is a tool that runs a small, isolated computer inside your computer, so you can break things without breaking anything real. The fix versions are PHP 8.4.27 and higher; the lab deliberately used the unpatched 8.4.26 to check the exploit works, and later ran the same attack against 8.4.27 as a control.

Figure 1: Initializing the local Docker lab. The script successfully starts the vulnerable PHP 8.4.26 target, which will be the victim of the exploit. From the original on medium.com

Figure 1 shows the local Docker lab being started: the script brings up the vulnerable PHP 8.4.26 target that will be the victim of the exploit.

The attack chain in four steps

The whole attack is summarised in four steps, combined with careful arithmetic about memory addresses:

  • Step 0 (Pin): Lock 149 workers with fake traffic. This forces the server to handle the entire attack on the 1 remaining worker, keeping the memory state stable.
  • Step 1 (A1): Send a massive file upload to cause the Out-of-Memory crash. Because the server panics, it skips cleanup, creating the dangling pointer.
  • Step 2 (B1): Trigger an out-of-bounds memory read. This steals secret memory addresses, such as the libphp base address.
  • Step 3 (A2 + B2): Send the final payload to overwrite pDestructor with zif_system, forcing the server to execute the id command.

The exploit relies on offsets such as libphp+0x65EB60. An offset is a fixed distance between two places in memory: if you know where the library libphp starts, adding the offset tells you exactly where a particular function lives. The exploit uses these formulas to calculate where zif_system sits, based on the leaked libphp address.

Step 1: Breaking the server (the OOM bailout)

To take over a server, you first have to break its normal flow. Here is what happens:

  1. The exploit script sends a specially crafted file upload that forces the PHP server to run out of memory (OOM).
  2. When PHP runs out of memory, it uses a mechanism called a longjmp to jump out of the request early and abort it.
  3. Because it jumped out early, it skips the cleanup phase. The session ID pointer (PS(id)) is left pointing to a memory address that has already been freed. It is a dangling pointer.

Why this matters: normally, when a request ends, PHP tidies up, including the session pointer. The emergency exit skips that tidy-up, so the pointer is left behind, still pointing at memory the server thinks it has given back. That leftover is the opening the rest of the attack uses.

Figure 2: When I ran the exploit, the terminal output confirmed the exploit triggered this exact Out-of-Memory condition (A1: END-cleanup send_cookie OOM). From the original on medium.com

Figure 2 shows the terminal output confirming that the exploit triggered this exact Out-of-Memory condition (A1: END-cleanup send_cookie OOM).

To bypass the server's worker pool and guarantee the memory state was preserved, the exploit used worker pinning. The terminal output pinned 150/150 workers (149 holders) shows the script held 149 connections open to distract the server, forcing it to process the attack on the single remaining worker, which made the exploit reliable. In everyday terms: imagine a shop with 150 tills. You send 149 friends to stand at 149 tills and do nothing, so the only till left for the real customer is the one you are watching.

Figure 3: Because this exploit relies on winning a race condition (timing the memory allocation perfectly), it does not always work on the first try. In my lab, the first attempt resulted in a heap leak failed error because the timing was off. From the original on medium.com

Because the exploit relies on winning a race condition, timing the memory allocation perfectly, it does not always work on the first try. In the lab, the first attempt resulted in a heap leak failed error because the timing was off (Figure 3).

Figure 4: On the next attempt, the memory layout aligned perfectly, and the exploit successfully executed the command. From the original on medium.com

On the next attempt the memory layout aligned perfectly and the exploit successfully executed the command (Figure 4).

Step 2: Stealing memory addresses (the info leak)

Modern operating systems use ASLR, which shuffles memory addresses so attackers cannot guess where things are. To bypass it, the exploit leaks addresses from the server:

  1. The exploit sends a second request. The server tries to use the dangling session ID pointer.
  2. Because the memory was freed and then reallocated with fake data crafted by the exploit, the server ends up reading out-of-bounds (OOB).
  3. The server takes the leaked memory address and accidentally sends it back to the attacker in the Set-Cookie HTTP header.
  4. With this leak, the exploit now knows exactly where the Zend memory manager and the libphp library are located in memory.

A few terms here. An out-of-bounds (OOB) read means the program reads past the edge of the data it was supposed to read, like reading the next page of someone else's notebook because the pages are stuck together. The Zend memory manager is PHP's internal system for handing out and reclaiming memory. libphp is the core library that runs PHP. The Set-Cookie header is the part of a server's reply where it tells your browser to store a cookie; here it is being abused to carry leaked data back to the attacker.

Figure 5, the successful memory leak, is referenced in the report but not reproduced here.

Step 3: Taking control (the exploit payload)

Now that the addresses are known, the attack can land:

  1. The exploit sends a final crafted request to overwrite a specific piece of memory called pDestructor.
  2. Normally, pDestructor points to a function that cleans up memory. The exploit overwrites this pointer so it points to zif_system instead, a built-in PHP function that executes shell commands.
  3. When the PHP server finishes processing the request, it tries to clean up by calling pDestructor.
  4. Instead of cleaning up, it executes the command id.

Think of pDestructor as a note on the cleaner's desk saying "when you are done, call this number". The attacker swaps the note for a different number, so the cleaner calls the command runner instead. zif_system is the internal PHP function that runs shell commands, so the call becomes a command execution.

Figure 6: The successful exploit chain- the terminal shows the calculation of zif_system (the command execution function) followed immediately by the [4/4] RCE OK and the uid=33 proof. From the original on medium.com

At this point in the script, the exploit uses the leaked libphp address to calculate where zif_system lives, then silently overwrites the pDestructor pointer with this address. The overwrite happens inside the server's RAM and is not visible on screen, but the immediate uid=33 output proves it was successful. Figure 6 shows the calculation of zif_system followed by the [4/4] RCE OK and the uid=33 proof.

Checking the sibling vulnerability (CVE-2026-109619)

The author also verified the second PHP2Shell vulnerability, CVE-2026-109619 (stale global state), using a dedicated differential lab. Stale global state means internal data that is still sitting there after it should have been reset. Differential testing means running the same test against two versions and comparing the results: here, vulnerable 8.4.26 against patched 8.4.27.

This path relies on a Producer/Consumer relationship: the attacker first triggers an OOM crash (the Producer) to leave a stale session pointer in memory, then sends a second request (the Consumer) to the same worker to consume the stale state before normal initialisation can clean it up. In everyday terms: one person leaves a door unlocked, and a second person walks through it before anyone locks it again.

The exploit operates in three distinct stages:

  1. Heap Leak: the exploit crashes the worker to leak the Zend Memory Manager chunk base.
  2. Library Leak: it triggers a second crash to leak the exact memory address of libphp.
  3. Control Hijack: using the leaked offsets, it calculates the address of zif_system and overwrites the memory pointer.

The heap is the region of memory where programs put data they create while running. A heap leak is when some of that data escapes to someone who should not see it.

Although the worker crashes with a Segmentation Fault during the final stage, the payload executes successfully before the process dies, as proven by the uid=33(www-data) output. A segmentation fault is the crash a program gets when it touches memory it is not allowed to touch. Here the crash comes after the command has already run, so it does not save the server.

Figure 7: The execution of CVE-2026–109619. The terminal shows the three stages: leaking the Zend heap chunk, leaking the libphp base address, and calculating zif_system. The final proof confirms code execution as uid=33(www-data) on the vulnerable PHP 8.4.26. From the original on medium.com

Figure 7 shows the three stages in the terminal: leaking the Zend heap chunk, leaking the libphp base address, and calculating zif_system, with the final proof of code execution as uid=33(www-data) on PHP 8.4.26.

The differential lab confirms the patch works: the exact same attack against PHP 8.4.27 fails with a heap leak failed error. Because the patch resets the internal state before the second request can consume it, the memory leak fails completely.

Figure 8: The negative control. The exact same exploit is run against the patched PHP 8.4.27. The server successfully blocks the attack (heap leak failed), resulting in the final confirmation: vulnerable code executes, patched code does not. From the original on medium.com

Figure 8 shows the negative control: the same exploit against patched PHP 8.4.27, blocked with heap leak failed, confirming that vulnerable code executes and patched code does not. A negative control is a test where you expect nothing bad to happen, to prove that the bad thing you saw earlier really came from the bug and not from something else.

Why the bug happens

The mistake is in PHP's early request processing. When an Out-of-Memory condition or a fatal crash occurs, PHP uses longjmp to leave the request early and skips the normal cleanup phase. The session ID pointer (PS(id)) is left dangling, pointing at freed memory. A second request to the same worker then consumes that stale state: the freed memory is reallocated with attacker-crafted fake data, the server reads out of bounds, and the leaked address is returned in the Set-Cookie header. A final crafted request then overwrites the pDestructor function pointer so that cleanup calls zif_system instead.

ASLR does not stop the attack because the OOB read leaks the addresses needed to defeat it. The exploit depends on winning a race condition, so timing matters and attempts can fail, as the first lab attempt did.

What the impact is

Successful exploitation gives remote code execution on the web server. In the lab this was proven by running id and receiving uid=33(www-data), meaning control as the low-level web server user with access only to the website files. The author notes that reliable RCE has been very difficult to achieve in the wild despite mass scanning.

How to stop it

The official PHP release notes say: "There are no complete mitigations, updating is the only safe choice". The vulnerability is fixed in PHP versions 8.2.35, 8.3.36, 8.4.27 and 8.5.12. The patch ensures that both during early Out-of-Memory errors and fatal crashes, PHP properly resets the internal state and cleans up the session pointers. Updating to the latest version is the only permanent fix.

Things worth testing yourself

  • A positive result is the Set-Cookie header returning a leaked address, followed by uid=33(www-data) from the id command.
  • The stale global state path (CVE-2026-109619). Use a Producer request to crash a worker and a Consumer request to the same worker. A positive result is the three-stage output: Zend heap chunk leak, libphp base leak, and zif_system calculation, with code execution proven before the segfault.
  • Differential check against a patched build. Run the identical exploit against PHP 8.4.27 or later. A positive result for the fix is a heap leak failed error and no command output.

References

  • PHP Group. (2026). PHP 8.4.27, 8.3.36, 8.2.35, and 8.5.12 released [Security advisory]. https://www.php.net/archive
  • VulnCheck. (2026). CVE-2026-109618 and CVE-2026-109619: PHP2Shell memory corruption [Threat intelligence report].
  • Wiz Security Research. (2026). Understanding the PHP2Shell vulnerability chain: OOM bailout to RCE [Technical blog post].
  • Sophos. (2026). PHP2Shell: Why reliable exploitation remains elusive in the wild [Security analysis].
  • PoC [undisclosed]
Me and Mocha. From the original on medium.com

Me and Mocha.

Glossary

  • ASLR (Address Space Layout Randomization): a security feature that shuffles where things sit in memory each time a program starts, so attackers cannot guess addresses.
  • Apache: a popular web server program.
  • Cookie: a small piece of text a website asks your browser to store and send back with later requests, often used to remember who you are.
  • Dangling pointer: a note that says where some data is, when that data has already been thrown away.
  • Differential testing: running the same test against two versions of software and comparing the results.
  • Docker: a tool that runs a small isolated computer inside your computer.
  • Heap: the part of memory where a program puts data it creates while running.
  • Heap leak: when data from the heap escapes to someone who should not see it.
  • Kali Linux: a Linux distribution made for security testing.
  • libphp: the core library that runs PHP.
  • longjmp: a C function that jumps out of the current work to an earlier saved point, skipping the normal tidy-up.
  • Memory: the working space where a running program keeps its data, made of numbered slots.
  • mod_php: a way of running PHP inside the Apache web server itself.
  • Negative control: a test where you expect nothing bad to happen, used to prove an earlier bad result really came from the bug.
  • Offset: a fixed distance between two places in memory, used to calculate one address from another.
  • OOM (Out-of-Memory): when a program asks for more memory than it is allowed and has to stop.
  • OOM bailout: the emergency exit a program takes when it runs out of memory, skipping normal cleanup.
  • OOB (out-of-bounds) read: reading data past the edge of what the program was supposed to read.
  • pDestructor: a pointer to the function that cleans up memory; the exploit swaps it for a command runner.
  • PHP: a programming language commonly used to build web pages on the server.
  • PoC (proof of concept): a demonstration that a bug can actually be triggered.
  • Pointer: a note in a program saying where a piece of data lives in memory.
  • Producer/Consumer: a pattern where one action leaves something behind and a second action picks it up.
  • PS(id): PHP's internal pointer to the current session ID.
  • Race condition: a situation where the result depends on timing or order.
  • RCE (Remote Code Execution): getting a remote server to run commands of your choosing.
  • Segmentation fault: a crash caused by a program touching memory it is not allowed to touch.
  • Session ID: the label a website gives your browser so it can recognise you between requests.
  • session.upload_progress: a PHP feature that tracks file uploads while they are in progress, running very early in a request.
  • Stale global state: internal data that is still there after it should have been reset.
  • Worker: one of the separate processes a web server uses to handle requests.
  • Worker pinning: keeping many connections open so the attack is forced onto one specific worker.
  • Zend memory manager: PHP's internal system for handing out and reclaiming memory.
  • zif_system: the internal PHP function that runs shell commands.

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.