ThreatBeaconXSubscribe
CriticalRemote Code Execution · 8 min read

PHP2Shell: Two Critical PHP Vulnerabilities Enable Unauthenticated Remote Code Execution

The PHP development team released emergency security updates on October 21, 2026, to address two critical vulnerabilities that could allow unauthenticated attackers to execute arbitrary code on affected servers. The vulnerabilities, tracked as CVE-2026-109618 and CVE-2026-109619, received CVSS scores of 9.2. Security researchers have referred to the vulnerabilities collectively as PHP2Shell. The flaws involve memory corruption during out-of-memory handling and the use of stale internal state after memory has been freed. Under vulnerable conditions, a specially crafted request can trigger these issues and potentially enable remote code execution. The vulnerabilities affect PHP installations serving web requests, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP, and LiteSpeed. PHP released patched versions 8.5.12, 8.4.27, 8.3.36, and 8.2.35. CERT-In and other security authorities have advised organizations to prioritize remediation, especially on internet-facing systems.

Written by Jakka Lakshmi Koumudi·Published Oct 23, 2026


1. Description

PHP is a widely used server-side scripting language that powers websites, content management systems, and web applications. It processes requests on web servers and commonly interacts with databases, authentication systems, and other backend services.

The PHP2Shell vulnerabilities affect the PHP runtime itself rather than one specific website or content management system. Consequently, applications using vulnerable PHP installations may be exposed even when the application code has no known vulnerability of its own.

The two vulnerabilities concern different memory-management problems. One involves improper handling of an out-of-memory condition, while the other involves stale request-specific state that can remain accessible after its backing memory has been released.

The PHP project released emergency updates on October 21, 2026. Systems running unsupported PHP branches require particular attention because they may not receive upstream security fixes. Organizations should verify their exact PHP version and any security backports provided by their operating-system or hosting vendor. 

2. Technical Description

The PHP2Shell vulnerability group contains two critical remote code execution flaws.

  • CVE-2026-109618 — Out-of-memory handling: When PHP encounters an out-of-memory condition, request processing may be interrupted while internal request data is only partially initialized. Cleanup routines can then process invalid state and access memory incorrectly.

  • CVE-2026-109619 — Stale global state: Request-specific internal state can remain referenced after its underlying memory has been freed. A later request handled by the same worker may access that stale state before normal initialization resets it.

Both vulnerabilities have a reported CVSS score of 9.2. Under vulnerable conditions, the memory-management flaws can be exploited to achieve remote code execution without authentication.

Affected deployment models include PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP, and LiteSpeed. The PHP team identified mod_php as a particularly high-risk configuration because a demonstrated exploit could trigger the attack before application code runs. 

3. Attack Overview

The potential exploitation sequence is:

  1. An attacker identifies an internet-facing server running a vulnerable PHP version.

  2. The attacker sends a specially crafted HTTP request to the PHP-powered service.

  3. The request triggers vulnerable memory-handling behavior.

  4. PHP encounters an invalid memory state during out-of-memory handling or accesses stale request data.

  5. If exploitation succeeds, the attacker may achieve remote code execution with the privileges of the affected PHP worker.

  6. Depending on those privileges and the server configuration, the attacker may attempt to access application files, interact with databases, install malicious components, or move further into the environment.

The sequence describes the potential exploitation path. It does not establish that every vulnerable server has been attacked or that successful exploitation has occurred in every affected deployment.

4. Technical Analysis

4.1 CVE-2026-109618: Memory corruption during out-of-memory handling

PHP enforces memory limits to prevent requests from consuming excessive resources. When a request exceeds its configured memory_limit, PHP can interrupt processing and initiate error handling.

The vulnerability arises when this interruption occurs while internal request data is only partially initialized. Cleanup routines may treat the incomplete data as valid and attempt to free memory that was never correctly initialized.

That memory may contain remnants of earlier allocations, potentially including attacker-controlled data. Under the required conditions, incorrect memory handling can create a path to remote code execution.

The issue demonstrates how error-handling routines can become security-critical when they process inconsistent internal state. 

4.2 CVE-2026-109619: Stale request state

The second vulnerability involves internal state that remains referenced after the memory backing it has been freed.

A later request handled by the same worker may access the stale state before PHP's normal initialization process resets it. This creates a use-after-free condition that can affect the integrity of memory handling and potentially be exploited for remote code execution.

The impact depends on the execution environment and the conditions under which the stale state can be triggered. It should not be assumed that every PHP application has an identical exploitation path. 

4.3 Affected versions and emergency patches

The PHP project published the following fixed releases on October 21, 2026.

PHP BranchFixed VersionRequired Action
PHP 8.58.5.12Upgrade to 8.5.12 or a later fixed release
PHP 8.48.4.27Upgrade to 8.4.27 or a later fixed release
PHP 8.38.3.36Upgrade to 8.3.36 or a later fixed release
PHP 8.28.2.35Upgrade to 8.2.35 or a later fixed release

The affected versions are releases before the corresponding fixed version in each supported branch. PHP 8.1 and older branches are no longer supported upstream. Administrators should consult their operating-system vendor or hosting provider for backported fixes and should plan to move unsupported deployments to a maintained release. 

4.4 Public exploit research and exploitation risk

Following the release of technical details and security updates, proof-of-concept research began circulating publicly. Security reporting has described exploitation paths involving PHP-based applications, although exploitability depends on the PHP execution model, version, configuration, and application behavior.

The availability of technical details increases the urgency of patching because attackers may use the released information to develop or adapt exploits against unpatched systems.

Organizations should distinguish public proof-of-concept availability from confirmed exploitation of their own environments. Both warrant attention, but neither alone proves that a particular server has been compromised. 

4.5 Detection opportunities

Security teams should investigate unusual activity involving PHP worker processes and their child processes, especially when web-facing PHP services unexpectedly launch shells, scripting interpreters, or download utilities.

Other useful signals include:

  • Unexpected file creation or modification in web roots.

  • New web shells or unfamiliar PHP files.

  • Unusual outbound connections from PHP processes.

  • Unexpected cron jobs, scheduled tasks, or system accounts.

  • Suspicious application errors or repeated requests associated with exploitation attempts.

  • Unexplained changes to application files, configuration, or database records.

These are general defensive hunting opportunities for potential post-exploitation activity, not confirmed indicators unique to PHP2Shell. A lack of such signals does not prove that a server is safe.

5. Potential Impact

  • Remote code execution: An attacker may execute code with the privileges of a vulnerable PHP worker.

  • Application compromise: Web applications and their underlying server processes may be exposed to unauthorized control.

  • Sensitive data exposure: Depending on permissions, attackers may attempt to access application files, database credentials, session data, or other sensitive information.

  • Web-shell deployment: Successful exploitation may provide an opportunity to establish persistent access through malicious server-side files.

  • Further compromise: An attacker may attempt to use the compromised web server as a starting point for additional activity within the environment.

  • Service disruption: Exploitation attempts or subsequent malicious activity may affect server availability and application reliability.

  • Supply-chain exposure: Third-party products that embed PHP may be affected even when administrators are unaware that PHP is part of the product.

These are potential consequences of successful exploitation. Actual impact depends on the deployment, the PHP worker's privileges, additional security controls, and whether an attacker successfully exploited the vulnerability.

6. Recommendations

Immediate Actions

  1. Inventory PHP deployments: Identify PHP installations across public-facing websites, internal applications, containers, virtual machines, appliances, and managed hosting environments.

  2. Apply the official security updates: Upgrade supported branches to PHP 8.5.12, 8.4.27, 8.3.36, or 8.2.35, as applicable, or install a verified vendor-provided security update.

  3. Prioritize internet-facing systems: Address publicly accessible PHP services first, particularly deployments using mod_php.

  4. Review embedded PHP components: Check whether third-party software, control panels, or vendor appliances include their own PHP runtime.

  5. Isolate systems that cannot be patched promptly: Where feasible, remove vulnerable internet-facing services from public access or restrict them behind approved access controls until remediation is complete.

  6. Inspect PHP process activity: Investigate unexpected shell execution, download tools, new files, or suspicious child processes originating from PHP workers.

  7. Review web and system logs: Search for unusual requests, PHP errors, unexpected file changes, and suspicious outbound connections.

  8. Investigate suspected compromise: Isolate affected systems, preserve forensic evidence, and check for web shells, new scheduled tasks, unauthorized accounts, and modified application files.

Preventive Actions

  1. Maintain an accurate inventory of software versions and exposed web services.

  2. Establish a timely vulnerability-management process for critical internet-facing components.

  3. Use supported PHP branches and verify vendor security backports when relying on distribution-managed packages.

  4. Apply least-privilege permissions to PHP worker processes and restrict their access to unnecessary files and system functions.

  5. Deploy web application firewalls and network controls as additional defensive layers, without treating them as substitutes for patching.

  6. Monitor process execution and outbound connections from PHP workers.

  7. Maintain centralized web-server, application, and operating-system logging.

  8. Regularly review third-party products that bundle server-side runtimes.

  9. Test patch deployment and recovery procedures in a controlled environment before broad rollout where operational requirements demand it.

  10. Reassess security controls after remediation and investigate any evidence of exploitation during the period of exposure.

7. Conclusion

PHP2Shell highlights the security risks created by critical memory-management flaws in widely deployed server-side software. CVE-2026-109618 and CVE-2026-109619 can enable unauthenticated remote code execution under vulnerable conditions, potentially putting websites and backend systems at risk.

The PHP project released patched versions on October 21, 2026, and security authorities have urged organizations to apply the fixes promptly. Administrators should identify all PHP deployments, prioritize internet-facing systems, and verify that third-party products containing PHP have also been addressed.

Patching should be accompanied by investigation for suspicious process activity, unauthorized file changes, and other signs of possible compromise. Public exploit research increases the urgency of remediation, but organizations must use their own telemetry to determine whether their systems were actually affected.

Sources

  1. Official PHP security release:
    https://www.php.net/

  2. CERT-In Vulnerability Note CIVN-2026-0510: Critical remote code execution vulnerabilities in PHP.
    https://www.cert-in.org.in/s2cMainServlet?VLCODE=CIVN-2026-0510&pageid=PUBVLNOTES01

  3. CERT-EU Security Advisory 2026-018: Critical Vulnerabilities in PHP.
    https://cert.europa.eu/publications/security-advisories/2026-018/

  4. UK National Cyber Security Centre: Critical security issue affecting PHP.
    https://www.ncsc.gov.uk/news/critical-security-issue-affecting-php

MITRE ATT&CK Mapping

T1190 — Exploit Public-Facing Application