PHP2Shell-Everything you need to know
Two remote code execution flaws in the PHP engine (CVE-2026-109618 and CVE-2026-109619) allow an unauthenticated attacker to run arbitrary commands on a server by sending a crafted HTTP request that triggers memory corruption. The flaws affect the PHP engine itself, so any PHP application on a vulnerable version is exposed.
medium.com
Published on medium.com
Php2shell
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.
Context
PHP2Shell is the name given to two remote code execution flaws in the PHP engine itself. Because the bugs sit in the engine rather than in application code, a plain WordPress install or a custom PHP site can be exposed through code the site owner never wrote. The attacker needs no login, and the site's own code does not have to be buggy: a single crafted HTTP request to a reachable PHP site is the entry point. Roughly 70% of websites run on PHP, and Censys found about 1.58 million internet-facing hosts with identifiable PHP versions still unpatched on 21 October.

Setup
No accounts, roles or tooling are described for reproducing the flaws. The relevant preconditions are version-based: the affected engine is Zend, the core of PHP, and fixed releases were published for PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Sites on PHP 7.4, 8.0 or 8.1 had no fixed builds reported as of 24 October, and the author cites studies putting almost 59% of PHP web servers on 8.1 or earlier, versions that will never receive an official patch.
Finding it
The two flaws were found months before disclosure by researchers using AI-assisted auditing, who kept the details private and worked with the PHP team to fix them before a patchless chaos could unfold. Both are rated 9.2 under CVSS v4.0 and both are RCE:
- CVE-2026-109618: remote code execution via out-of-memory (OOM) corruption. Handling out-of-memory errors via
longjmp()leaves request memory uninitialized because of improper control flow management, which lets attackers reliably reach RCE using OOM triggers. - CVE-2026-109619: remote code execution via stale global state. PHP globals retain references to freed request memory, so a later request on the same worker can reuse it.
LCFR found pre-auth RCE on the following PHP applications, and in some instances on arbitrary PHP scripts running on them:
- WordPress 7.1.2
- Drupal 11.4.3
- Joomla 6.1.4
- MediaWiki 1.46.2
- Roundcube 1.7.4
- Magento 2.4.9
- phpMyAdmin 5.2.3
- Nextcloud 35.0.1
- Laravel 13.11
- Symfony 8.1
- WHMCS
Timeline
- 17 October 2026: Amazon notices exploitation attempts against its honeypot. Amazon threat intelligence, using MadPot, which Amazon describes as its internet-facing network of decoy systems for monitoring malicious activity, understood that an attempt was made, but at that time there was no clear idea whether it was a PHP2Shell-related incident.
- 20 October 2026: details of both flaws leak online, which accelerates proof-of-concept circulation.
- 21 October 2026: Amazon states that multiple PoC exploits were seen, followed by more attempts from anonymized infrastructure. Cloudflare's CEO confirms thousands of exploit attempts in 10 hours, rising to millions within hours of the announcement.

Shutdowns were reported in a wide list of countries: government websites in the Netherlands and Finland were shut down as a precaution, and in Austria universities and the Burgenland state portal went down.
Exploitation
Step 1: reach a PHP site with a single request
The flaws are in the PHP engine, so a plain WordPress or custom PHP site can be exposed through code the site owner never wrote. A single crafted HTTP request to a reachable PHP site is the entry point. The report does not publish the request itself.

Step 2: understand the shared root cause
Both vulnerabilities live in Zend and share a single root cause: PHP's fatal-error path jumps out of the current call stack with longjmp() without properly unwinding. When PHP hits a fatal error, such as running out of memory, it abandons what it was doing mid-task. If that jump happens while internal data is only half-built, cleanup code can later treat leftover bytes as if they were valid.

Step 3: follow the request memory lifecycle
When a POST request is sent to the PHP server, it stores the required data in memory, and when the data is no longer required it is cleaned up so the space can be reused for another task. Many users share the server, and memory is given to each user according to their request, so the PHP server claims the memory before actually adding data. The cycle is constant:
ALLOCATED → DATA STORED → REMOVED → REUSED
Step 4: leave an incomplete key behind
A bug was found in this process: a trick that makes the PHP server run arbitrary commands. After the allocated data is set, the data stored is an incomplete key, which leads to writing the value of the key into memory but not considering it a valid entry, because the bookkeeping sees it as empty. The data is then replaced. This makes the space non-allocated, and that block of memory is used to hold new data.

Step 5: trigger out-of-memory deliberately
The idea is to manually allocate memory beyond the settings allowed, hence triggering the out-of-memory error. An out-of-memory error can trigger longjmp(), interrupting request processing while internal request data is only partially initialized. The failing request's own cleanup routine then reads and branches on those bytes.
Step 6: turn the half-built array into a function call
An out-of-memory error is not a big deal if it is handled properly; it happens all the time. What led to RCE here was how the PHP bookkeeping handled the elements. Once memory is full, PHP abandons the job halfway through, and in this case PHP is dealing with an array. It goes through what is initialized in memory to clean it, but the bookkeeping considers elements that are used and considers the array that was going to be written into memory as valid at first, before it actually fills the memory.
So PHP thinks it has valid data stored, but instead it has previously written data with a missing key. PHP considers it an array and tries to destruct the array. There is no array, only the data left behind earlier, carefully crafted to manipulate the pointer so the destructor points to a completely different function in the server. PHP then calls a function that allows commands written directly on the server, hence RCE.

Root cause
The mistake is in the engine's error handling, not in application code. longjmp() abandons the current call stack without unwinding it, so request memory can be left partially initialized. The bookkeeping then treats that leftover memory as a valid array, and the destructor path follows a pointer that the attacker has shaped through the leftover bytes. The vulnerable path is reached through a normal fatal error such as OOM, and the flaws are in the engine, so the site's own code does not have to be buggy.
Impact
An attacker can run code on the server without any sign-in, and can steal and access user data and accounts. The flaws affect any reachable PHP site on an affected version, including the listed applications and, in some instances, arbitrary PHP scripts on them.
Fix
PHP published fixed releases on 21 October 2026: PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. No fixed builds had been reported for older branches such as PHP 7.4, 8.0 and 8.1 as of 24 October, so sites still running those versions need to upgrade to a supported branch. The author's advice is to update to the latest versions as soon as possible.
Variants to test
What happened, in plain words
In October 2026 two serious bugs were found in PHP, the software that runs a very large share of the world's websites. The bugs let an attacker run their own commands on a web server without logging in and without the website's own code being badly written. The attacker only needs to send one specially crafted request to a site that runs an affected version of PHP. The two bugs are together called PHP2Shell.
Almost 70% of websites run on PHP, and Censys found about 1.58 million internet-facing hosts with identifiable PHP versions still unpatched on 21 October.

(Image source: offsec.com)
A quick comparison before we go further. Think of a web server as a busy restaurant kitchen. Each visitor's request is an order. The kitchen has a fixed amount of counter space (memory) and a routine for clearing a counter when an order is finished so the next order can use it. These bugs are mistakes in that clearing routine. If the kitchen is interrupted at exactly the wrong moment, the next cook can mistake leftover scraps for a real ingredient and follow a recipe that was never ordered. Here the "recipe" is a command the attacker chose.
Setup
No accounts, roles or tooling are described for reproducing the flaws. What matters is the version of PHP the site runs. The affected part is Zend, the core engine of PHP, and fixed releases were published for PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Sites on PHP 7.4, 8.0 or 8.1 had no fixed builds reported as of 24 October, and the author cites studies putting almost 59% of PHP web servers on 8.1 or earlier, versions that will never receive an official patch.
A few words that will come up constantly:
- PHP: a programming language used mostly to build web pages on the server side. When you open a page ending in
.php, or a WordPress blog, PHP is usually what builds the page before it reaches your browser. - Engine: the part of PHP that actually executes the code. Zend is PHP's engine.
- Version: a numbered release of software, like 8.2.35. Older versions stop receiving fixes once the maintainers move on, which is why the version number matters so much here.
- Patch: a small update that fixes a bug. An unpatched site is one that has not installed the fix.
Finding it
The two flaws were found months before disclosure by researchers using AI-assisted auditing, who kept the details private and worked with the PHP team to fix them before a patchless chaos could unfold. Both are rated 9.2 under CVSS v4.0 and both are RCE:
- CVE-2026-109618: remote code execution via out-of-memory (OOM) corruption. Handling out-of-memory errors via
longjmp()leaves request memory uninitialized because of improper control flow management, which lets attackers reliably reach RCE using OOM triggers. - CVE-2026-109619: remote code execution via stale global state. PHP globals retain references to freed request memory, so a later request on the same worker can reuse it.
Some of those terms deserve a plain explanation:
- AI-assisted auditing: using an AI tool to help read through a large codebase looking for mistakes. It is like having a very fast proofreader, not a replacement for a human who understands the code.
- Disclosure: the moment the details of a bug become public. Before disclosure, only a small group knows.
- CVE: a public catalogue number for a known vulnerability, so people can talk about the same bug unambiguously. The number is not a score; it is a name tag.
- CVSS v4.0: a standard scoring system for how severe a vulnerability is. 9.2 is high on that scale.
- RCE (remote code execution): the attacker can make the server run commands of their choosing, from a distance, over the network. It is the most serious kind of web bug because it usually means full control of the machine.
- OOM (out of memory): the moment a program asks for more memory than it is allowed to use. Well-behaved programs handle this gracefully; the bug is in how PHP handles it.
longjmp(): a low-level C function that jumps out of the current function back to an earlier point, skipping the normal tidy-up steps. Think of it as leaving a room by the fire escape instead of the door: you get out fast, but you leave your things behind.- Uninitialized memory: memory that has been reserved but not yet filled with a known value. It still contains whatever was there before, which is exactly what an attacker wants to control.
- Global state: data that lives for the whole program rather than for one request. If it is not cleared properly, one visitor's leftovers can be seen by the next.
- Worker: a long-running process on the server that handles requests one after another. Reusing a worker is normal and efficient; it is also why stale data can leak between requests.
LCFR found pre-auth RCE on the following PHP applications, and in some instances on arbitrary PHP scripts running on them:
- WordPress 7.1.2
- Drupal 11.4.3
- Joomla 6.1.4
- MediaWiki 1.46.2
- Roundcube 1.7.4
- Magento 2.4.9
- phpMyAdmin 5.2.3
- Nextcloud 35.0.1
- Laravel 13.11
- Symfony 8.1
- WHMCS
These are all well-known pieces of software built on PHP: WordPress runs blogs, Drupal and Joomla run general websites, MediaWiki runs wiki sites, Roundcube is webmail, Magento is a shop platform, phpMyAdmin is a database admin tool, Nextcloud is file storage, Laravel and Symfony are frameworks developers build on, and WHMCS is billing software for hosting companies. Pre-auth means the attacker does not need to log in first.
Timeline
- 17 October 2026: Amazon notices exploitation attempts against its honeypot. Amazon threat intelligence, using MadPot, which Amazon describes as its internet-facing network of decoy systems for monitoring malicious activity, understood that an attempt was made, but at that time there was no clear idea whether it was a PHP2Shell-related incident.
- 20 October 2026: details of both flaws leak online, which accelerates proof-of-concept circulation.
- 21 October 2026: Amazon states that multiple PoC exploits were seen, followed by more attempts from anonymized infrastructure. Cloudflare's CEO confirms thousands of exploit attempts in 10 hours, rising to millions within hours of the announcement.

( Source: https://www.php.net/archive/2026.php#2026-10-20-1)
A honeypot is a decoy server set up to look interesting to attackers. Nobody legitimate uses it, so any traffic to it is suspicious. MadPot is Amazon's name for its network of such decoys. A proof of concept (PoC) is a small demonstration that a bug really works. Once a PoC circulates, people who are not researchers can try the attack too, which is why leaks speed things up so much. Anonymized infrastructure means the attacking machines are hidden behind services that mask who really owns them.
Shutdowns were reported in a wide list of countries: government websites in the Netherlands and Finland were shut down as a precaution, and in Austria universities and the Burgenland state portal went down.
Exploitation
Step 1: reach a PHP site with a single request
The flaws are in the PHP engine, so a plain WordPress or custom PHP site can be exposed through code the site owner never wrote. A single crafted HTTP request to a reachable PHP site is the entry point. The report does not publish the request itself.

(Image source: Youtube - Under the Weights)
HTTP request is what your browser sends to a server when you open a page: a short text message asking for something. A crafted request is one built by hand, with unusual contents chosen on purpose. Reachable means the site can be contacted from the internet. The point of this step is that the attacker does not need a special feature or a badly written plugin; the vulnerable code is in the engine underneath everything.
Step 2: understand the shared root cause
Both vulnerabilities live in Zend and share a single root cause: PHP's fatal-error path jumps out of the current call stack with longjmp() without properly unwinding. When PHP hits a fatal error, such as running out of memory, it abandons what it was doing mid-task. If that jump happens while internal data is only half-built, cleanup code can later treat leftover bytes as if they were valid.

(Image : Claude)
Call stack is the list of functions currently running, one inside another, like a stack of half-finished tasks. Unwinding is the orderly process of finishing each task on the way out, closing what it opened and freeing what it reserved. longjmp() skips that. Fatal error is an error serious enough that PHP stops what it is doing. Bytes are the raw contents of memory; treating them as valid data when they are not is the heart of the bug.
Step 3: follow the request memory lifecycle
When a POST request is sent to the PHP server, it stores the required data in memory, and when the data is no longer required it is cleaned up so the space can be reused for another task. Many users share the server, and memory is given to each user according to their request, so the PHP server claims the memory before actually adding data. The cycle is constant:
ALLOCATED → DATA STORED → REMOVED → REUSED
Line by line:
ALLOCATED: the server reserves a block of memory for this request. It is like putting a name card on a table before the food arrives.DATA STORED: the actual data is written into that block.REMOVED: the data is no longer needed, so the block is marked free.REUSED: the next request gets that same block.
A POST request is an HTTP request that carries data in its body, typically used when you submit a form. The important detail is that the reservation happens before the filling. If something interrupts the process between those two moments, the block is reserved but not filled, and the bookkeeping and the real contents disagree.
Step 4: leave an incomplete key behind
A bug was found in this process: a trick that makes the PHP server run arbitrary commands. After the allocated data is set, the data stored is an incomplete key, which leads to writing the value of the key into memory but not considering it a valid entry, because the bookkeeping sees it as empty. The data is then replaced. This makes the space non-allocated, and that block of memory is used to hold new data.

(Image : Claude)
A key here means a label used to look up a value, like the name on a locker and the contents inside. Bookkeeping is the server's own record of what is stored where. The trick is to make the bookkeeping and the actual memory disagree: the record says "empty", the memory still holds something. That leftover is what the attacker later shapes.
Step 5: trigger out-of-memory deliberately
The idea is to manually allocate memory beyond the settings allowed, hence triggering the out-of-memory error. An out-of-memory error can trigger longjmp(), interrupting request processing while internal request data is only partially initialized. The failing request's own cleanup routine then reads and branches on those bytes.
Allocate means to reserve memory. Settings here are the limits the server enforces on how much a request may use. Cleanup routine is the code that runs when a request ends, successful or not, to free what it used. Branches means the code makes a decision based on the bytes it reads, and if those bytes are attacker-controlled, so is the decision.
Step 6: turn the half-built array into a function call
An out-of-memory error is not a big deal if it is handled properly; it happens all the time. What led to RCE here was how the PHP bookkeeping handled the elements. Once memory is full, PHP abandons the job halfway through, and in this case PHP is dealing with an array. It goes through what is initialized in memory to clean it, but the bookkeeping considers elements that are used and considers the array that was going to be written into memory as valid at first, before it actually fills the memory.
So PHP thinks it has valid data stored, but instead it has previously written data with a missing key. PHP considers it an array and tries to destruct the array. There is no array, only the data left behind earlier, carefully crafted to manipulate the pointer so the destructor points to a completely different function in the server. PHP then calls a function that allows commands written directly on the server, hence RCE.

(Image source : reflectiz)
An array is an ordered collection of values, like a shopping list. Destruct means to tear an object down and free its memory when it is no longer needed. A pointer is a memory address, effectively an arrow saying "the thing you want is over there". If an attacker can change where the arrow points, the cleanup code will call whatever sits at the new address. In this case that is a function that runs commands on the server.
Root cause
The mistake is in the engine's error handling, not in application code. longjmp() abandons the current call stack without unwinding it, so request memory can be left partially initialized. The bookkeeping then treats that leftover memory as a valid array, and the destructor path follows a pointer that the attacker has shaped through the leftover bytes. The vulnerable path is reached through a normal fatal error such as OOM, and the flaws are in the engine, so the site's own code does not have to be buggy.
In everyday terms: the fire escape is a legitimate part of the building, and using it is not itself an attack. The problem is that nobody checks the room afterwards, and the next person in trusts whatever was left on the table.
Impact
An attacker can run code on the server without any sign-in, and can steal and access user data and accounts. The flaws affect any reachable PHP site on an affected version, including the listed applications and, in some instances, arbitrary PHP scripts on them.
Fix
PHP published fixed releases on 21 October 2026: PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. No fixed builds had been reported for older branches such as PHP 7.4, 8.0 and 8.1 as of 24 October, so sites still running those versions need to upgrade to a supported branch. The author's advice is to update to the latest versions as soon as possible.
A branch is a line of development, such as the 8.2 line. Fixes are usually backported to supported branches only, which is why an old branch can stay vulnerable indefinitely.
Variants to test
Stale means old data that should have been thrown away but was not. Authentication is proving who you are, usually by logging in; pre-auth means that step is skipped.
Glossary
- AI-assisted auditing: using an AI tool to help review source code for mistakes.
- Allocate: to reserve a block of memory for use.
- Anonymized infrastructure: attacking machines hidden behind services that mask their real owner.
- Array: an ordered collection of values stored together.
- Authentication: proving who you are, typically by logging in.
- Bookkeeping: the server's internal record of what data is stored where.
- Branch: a line of software development, such as the 8.2 series of PHP releases.
- Call stack: the list of functions currently running, one inside another.
- Cleanup routine: code that runs at the end of a request to free what it used.
- CVE: a public catalogue number that uniquely names a known vulnerability.
- CVSS v4.0: a standard scoring system for the severity of a vulnerability.
- Crafted request: an HTTP request built by hand with unusual contents chosen on purpose.
- Destruct: to tear down an object and free its memory when it is no longer needed.
- Disclosure: the moment details of a vulnerability become public.
- Engine: the part of a language that actually executes code; Zend is PHP's engine.
- Fatal error: an error serious enough that the program stops what it is doing.
- Global state: data that lives for the whole program rather than for a single request.
- Honeypot: a decoy server that only attackers would contact.
- HTTP request: the message a browser sends to a server asking for something.
- Key: a label used to look up a stored value.
longjmp(): a low-level C function that jumps out of the current function without the normal tidy-up.- MadPot: Amazon's network of decoy systems for monitoring malicious activity.
- Patch: a small update that fixes a bug.
- PHP: a programming language used mainly to build web pages on the server.
- Pointer: a memory address that says where a value lives.
- POST request: an HTTP request that carries data in its body, typically from a form.
- Pre-auth: reachable without logging in first.
- Proof of concept (PoC): a small demonstration that a vulnerability really works.
- RCE (remote code execution): making a server run commands of your choosing over the network.
- Reachable: contactable from the internet.
- Stale: old data that should have been discarded but was not.
- Uninitialized memory: reserved memory that has not been filled with a known value.
- Unwinding: the orderly process of finishing each running function on the way out.
- Version: a numbered release of software.
- Worker: a long-running server process that handles requests one after another.