PHP2Shell: two critical security vulnerabilities discovered in PHP
Two critical vulnerabilities attributed to PHP2Shell raise important questions about web application security. Learn how they work, the risks of remote code execution, the affected versions, and recommended measures to protect your PHP servers.

Contents
- PHP2Shell: two critical vulnerabilities in PHP allow remote code execution
- 1. Understanding the role of PHP in a web application
- 2. The two vulnerabilities discovered
- 3. First flaw: CVE-2026-109618 and memory corruption
- 3.1. What is an Out of Memory error?
- 3.2. Where is the problem?
- 3.3. What are the possible consequences?
- 4. Second flaw: CVE-2026-109619 and invalid memory references
- 4.1. Understanding the concept of use-after-free
- 4.2. How does this issue affect PHP?
- 4.3. Why is this particularly dangerous on a web server?
- 5. Why are these two vulnerabilities so concerning?
- 5.1. Lack of prior authentication
- 5.2. A vulnerability located in the engine itself
- 5.3. Potentially insufficient application protections
- 6. Which versions of PHP are affected?
- 7. How to check if a server is using a vulnerable version?
- 7.1. Verification in the terminal
- 7.2. Verification of the version actually used
- 8. How to fix PHP2Shell vulnerabilities?
- Step 1: identify the affected applications
- Step 2: identify the versions actually running
- Step 3: prepare the update
- Step 4: install the official patch
- Step 5: Restart the affected services
- Step 6: Check the result
- Step 7: Examine for possible signs of compromise
- 9. Are Laravel and WordPress apps affected?
- Laravel
- WordPress
- Other PHP applications
- 10. What can developers do to limit long-term risks?
- Conclusion: PHP engine security is as important as code security
- References
PHP2Shell: two critical vulnerabilities in PHP allow remote code execution
Published on October 23, 2026 | Computer Security | Dealmood & Solutions
Two critical vulnerabilities affecting the PHP engine were made public on October 21, 2026. Referenced under the identifiers CVE-2026-109618 and CVE-2026-109619, they can allow a remote attacker, under certain conditions, to execute arbitrary code on a server without first having a user account.
These vulnerabilities, collectively referred to as PHP2Shell in several security advisories, concern the internal functioning of PHP, including memory error handling and the internal state used during HTTP request processing.
The risk is particularly significant for servers that expose PHP applications on the Internet. A site can indeed contain properly developed application code while remaining vulnerable if the PHP engine running it is not up to date.
In this article, we will understand what these two vulnerabilities are, how they work technically, which applications may be affected, and what measures developers and system administrators should take.
1. Understanding the role of PHP in a web application
PHP is a programming language mainly used to develop server-side web applications. It notably allows processing HTTP requests, interacting with databases, managing sessions, and producing HTML pages or JSON responses.
Platforms like WordPress, Drupal, and many applications developed with Laravel rely on PHP.
When a user views a dynamic web page, processing generally follows this path:
- The browser sends an HTTP request to the server.
- The web server forwards the request to the PHP engine, depending on the configuration used.
- PHP processes the received data and executes the application's code.
- The application can query a database or call other services.
- PHP produces a response that the server sends back to the browser.
PHP therefore plays a central role in query processing.
It is important to distinguish two levels of security:
- Application security concerns the code developed by the team: authentication, permissions, input validation, SQL queries, and session management.
- The security of the PHP engine concerns the environment that runs this code: memory management, error handling, query analysis, and the internal operation of the engine.
PHP2Shell vulnerabilities mainly concern the second layer. This is precisely what makes them concerning: protection implemented only in application code may not be sufficient.
2. The two vulnerabilities discovered
Both vulnerabilities were published under the following identifiers:
| CVE-2026-109618 | Internal state corruption when handling insufficient memory error | Remote code execution |
| CVE-2026-109619 | Retention of internal references that became invalid after memory is freed | Remote code execution |
These vulnerabilities have one thing in common: they concern how PHP handles its internal state when query processing ends abnormally.
To understand their importance, you need to examine some fundamental concepts of system programming.
3. First flaw: CVE-2026-109618 and memory corruption
3.1. What is an Out of Memory error?
When a program is running, it uses RAM to temporarily store data: variables, objects, strings, internal structures, and computational results.
An Out of Memory error, often abbreviated as OOM, occurs when an operation can no longer obtain the memory needed to execute it.
In PHP, this situation can occur when a query requires too much memory compared to configured limits or available resources.
Let's take a simplified example:
<?php
$data = str_repeat('A', 1024 * 1024);
echo strlen($data);This program creates a string of about one megabyte, then displays its length.
In an environment where available memory is sufficient, it operates normally. If an application tries to handle much larger amounts of data, it may encounter a memory limit.
The problem is not limited to allocation failure. The engine must also properly handle operation stoppage, free up necessary resources, and maintain a consistent internal state.
3.2. Where is the problem?
The CVE-2026-109618 vulnerability concerns the handling of certain insufficient memory errors.
When such an error abruptly interrupts processing, some internal structures may become incomplete or inconsistent. The following cleanup can then handle data that was not properly initialized.
In system programming, this type of situation is particularly dangerous.
A program may, for example, expect a structure to contain a valid pointer when it was never properly defined. If the program then uses this value as if it were valid, its behavior can become unpredictable.
The flaw therefore lies in managing the internal state of the engine after a fatal error, and not simply in the fact that an application consumes too much memory.
3.3. What are the possible consequences?
Under certain conditions, this memory corruption can be exploited to achieve remote code execution.
The term Remote Code Execution (RCE) refers to a situation in which an attacker can have instructions of their choice executed by a remote system.
If a farm succeeds, the consequences may include:
- executing commands with PHP process privileges;
- access to files accessible to this process;
- data used by the application compromised;
- alteration of files or hosted content;
- a broader server compromise if other protections are insufficient.
The actual impact depends in particular on process privileges, server isolation, and the resources it can access.
4. Second flaw: CVE-2026-109619 and invalid memory references
The second vulnerability concerns another classic system programming issue: the use of an internal state that has not been properly reset.
4.1. Understanding the concept of use-after-free
The English term use-after-free refers to an error that occurs when a program uses a memory area after it has been freed.
To understand this problem, imagine a program that allocates memory to store information about an object.
The normal procedure is as follows:
- The program reserves a memory area.
- It stores information there.
- It uses this information.
- It frees memory when it is no longer needed.
- He stopped using references that pointed to this area.
The problem occurs when the program frees memory but keeps a reference to it.
This reference then becomes invalid. The memory area can then be reused to store other data.
If the program still tries to read or manipulate old data through this reference, it may access unexpected content.
4.2. How does this issue affect PHP?
PHP uses internal structures and global variables to handle different stages of query processing.
Some of these structures may temporarily reference data specific to an HTTP request.
However, this data must be released and the corresponding references must be reset at the right time.
The CVE-2026-109619 vulnerability concerns situations where this internal state may remain invalid after memory is freed or be incorrectly restored.
The engine can then keep a reference to a memory area that is no longer valid.
If this reference is then used before the internal state has been properly reset, the engine may handle unexpected data.
4.3. Why is this particularly dangerous on a web server?
A web server often processes a large number of successive requests.
The engine must therefore properly manage the lifecycle of the data associated with each query, including when certain operations fail.
An error in this handling can have significant consequences, as the PHP process may continue to process other requests while handling an incorrect internal state.
Depending on operating conditions, a use-after-free vulnerability can cause crashes, memory corruption, or, in the most severe cases, allow arbitrary code execution.
In the case of CVE-2026-109619, the documented risk is serious enough for PHP officials to recommend an immediate update to a patched version.
5. Why are these two vulnerabilities so concerning?
Several factors explain the severity of these vulnerabilities.
5.1. Lack of prior authentication
Security advisories indicate that successful operation can allow remote code execution without prior authentication.
This means an attacker does not necessarily need to have an account on the targeted application to attempt to exploit the vulnerability.
However, two concepts must be distinguished: an exploitable vulnerability without authentication does not mean that all servers will be automatically compromised. Exploitation depends notably on the PHP version, configuration, and technical conditions.
5.2. A vulnerability located in the engine itself
When a vulnerability affects the PHP engine, it can affect different applications that use the same environment.
A WordPress site, a Laravel API, and a custom-developed PHP application can thus be exposed if their runtime environment uses a vulnerable version.
This does not mean that all these applications have a flaw in their own code. The problem may lie in the common layer that executes their instructions.
5.3. Potentially insufficient application protections
A developer can set up strong authentication, validate user input, use prepared SQL queries, and apply security best practices.
These measures remain essential, but they do not fix a memory error present in the PHP engine.
Similarly, adding an application firewall can help reduce certain risks, but it does not replace installing the official patch.
The lesson to remember: an application's security depends on its code, its dependencies, and the environment in which it runs.
6. Which versions of PHP are affected?
On October 21, 2026, the PHP team released maintenance releases including fixes for both vulnerabilities.
The announced fixed versions are as follows:
| PHP 8.5 | 8.5.11 | 8.5.12 | | PHP 8.4 | 8.4.26 | 8.4.27 | | PHP 8.3 | 8.3.35 | 8.3.36 | | PHP 8.2 | 8.2.34 | 8.2.35 |
Earlier versions of these branches are also affected.
PHP 8.1 and earlier branches require special attention, as they no longer all receive regular security updates from the PHP project. Some vendors may release specific patches, but their availability depends on the environment used.
It is therefore recommended to check the actual installed version and the security advisories of the platform provider.
7. How to check if a server is using a vulnerable version?
The first step is to identify the version of PHP in use.
7.1. Verification in the terminal
On a Linux server or development machine, run:
php -vThe command displays the version of the PHP engine available in the terminal.
Example result:
PHP 8.4.26 (cli) ...In this example, the displayed version is earlier than the patched version 8.4.27.
However, it should be noted that the command php -v generally displays the PHP version on the command line. This may be different from the version used by the web server.
7.2. Verification of the version actually used
A server can have multiple versions of PHP installed simultaneously.
For example:
- PHP 8.4 for scripts run in the terminal;
- PHP 8.3 for a web application;
- a separate version used by PHP-FPM;
- a version managed directly by the host.
It is therefore necessary to also check the web server configuration and the versions associated with the hosted applications.
In an environment using PHP-FPM, the active service version must be controlled.
On shared or managed hosting, the control panel can display the version assigned to each site.
8. How to fix PHP2Shell vulnerabilities?
The priority measure is to install a patched version of the PHP engine.
Step 1: identify the affected applications
List websites, APIs, and services that use PHP.
Check development, test, and production environments, as well as any secondary servers.
Step 2: identify the versions actually running
Don't limit yourself to the version indicated by your device. Also check the PHP-FPM services, web server modules, and versions configured with your host.
Step 3: prepare the update
Before any production update, check the compatibility of your applications with the patched version.
Check the Composer dependencies, framework requirements, and PHP extensions used.
Make an appropriate backup and, if possible, test the update in a separate environment.
Step 4: install the official patch
Use a patched version suited to your PHP branch and operating system.
Avoid downloading executables from untrusted sources.
The versions released by the PHP team on October 21, 2026 are as follows:
- PHP 8.5.12;
- PHP 8.4.27;
- PHP 8.3.36;
- PHP 8.2.35.
Official documentation and downloads are available on the PHP website.
Step 5: Restart the affected services
After the update, restart or reload the relevant services according to your environment's procedure.
This ensures that processes are actually using the corrected engine.
Step 6: Check the result
Check the installed versions again and test the application's operation.
Check the server logs and ensure that the relevant services are using the patched version.
Step 7: Examine for possible signs of compromise
If an exposed server was running a vulnerable version, the update is not necessarily sufficient to demonstrate that no exploitation has occurred before.
If suspicious, check available logs, modified files, system accounts, unusual processes, and outgoing connections.
If a compromise is confirmed or strongly suspected, apply an incident response procedure. This may notably require server isolation, evidence retention, secret rotation, and rebuilding the environment from a trusted source.
9. Are Laravel and WordPress apps affected?
This is an important question because PHP is used by many platforms.
Laravel
Laravel is a PHP framework that provides tools for developing web applications and APIs.
It provides useful security mechanisms, but it runs on the PHP engine installed in the environment.
Therefore, a Laravel application using a vulnerable version of PHP may be exposed to a problem that lies within the engine itself.
Updating Laravel is therefore not necessarily enough to fix these vulnerabilities: the PHP version must also be checked and fixed.
WordPress
WordPress uses PHP to run its code and that of its extensions.
A WordPress site can be properly configured from the perspective of user accounts and extensions, while using a vulnerable version of the engine.
Updating WordPress and its extensions remains necessary, but it does not replace updating PHP.
Other PHP applications
The same principle applies to applications developed with Drupal, Joomla, or native PHP.
The essential question is which version of the engine actually executes HTTP requests.
10. What can developers do to limit long-term risks?
PHP2Shell vulnerabilities recall several important principles in software development.
Keep environments up to date. Language versions, libraries, and system components must be tracked and updated regularly.
Automate dependency checking. Compose manages PHP dependencies, but package checking does not replace updating the PHP engine itself.
Separate responsibilities. An application should not have system privileges higher than those it actually needs.
Isolate services. Using containers, dedicated service accounts, and restrictive permissions can limit the impact of a compromise.
Monitor production environments. Logs, alerts, and detection mechanisms can help identify unusual behaviors.
Prepare an update procedure. An organization must know how to identify a vulnerable version, test a patch, deploy it, and verify its application.
These practices do not make a system invulnerable. However, they help reduce the likelihood of exploitation and limit the consequences of an incident.
Conclusion: PHP engine security is as important as code security
Vulnerabilities CVE-2026-109618 and CVE-2026-109619 show that an issue located at the execution engine level can expose many web applications, even when their application code does not directly present the weakness in question.
The first vulnerability concerns corruption of the internal state during the handling of an insufficient memory error. The second concerns internal references that may remain invalid after memory is freed.
Under certain conditions, these errors can be exploited to execute code remotely without prior authentication.
For developers, system administrators, and application managers, the priority is clear: identify the versions used, install official patches, and verify that all relevant services are actually running a patched version.
Security doesn't stop at the code you write. It also depends on the components that run it, their configuration, and their ability to keep them up to date.
At Dealmood & Solutions, we consider technology watch and security maintenance as essential elements of the software application lifecycle.
References
- PHP Team: Announcement of patch versions for October 21, 2026.
- Official PHP documentation: history of changes in branches 8.2, 8.3, 8.4, and 8.5.
- NHS England Digital: security advisory dedicated to PHP2Shell vulnerabilities.
- Canadian Centre for Cybersecurity: alert regarding CVE-2026-109618 and CVE-2026-109619.
