PHP Vulnerability 2026: PHP2Shell Explained and How to Patch It
Oct 23, 2026 Software Development
Oct 23, 2026 Software Development
The latest PHP vulnerability is one of the most serious the language has faced. On October 20, 2026, the PHP security team announced an emergency security release for two critical flaws in the PHP runtime, and patches went out the next day. Tracked as CVE-2026-109618 and CVE-2026-109619, the flaws are together known as the PHP2Shell vulnerability.
Both are rated 9.2 (Critical) under CVSS v4.0, and both allow unauthenticated remote code execution. An attacker doesn’t need a login, a password or any access to your application to run code on a vulnerable server.
If your business runs a website, customer portal, CMS or internal application on PHP, this PHP security vulnerability needs your attention today. This guide explains what PHP2Shell is, who is affected, and how to apply the PHP patch.
A PHP vulnerability is a security flaw in the PHP runtime, its extensions, or in applications written in PHP that an attacker can exploit. Depending on where it sits, a flaw can let attackers read sensitive data, crash a server, or in the worst cases run their own code on it.
PHP vulnerabilities generally fall into two groups:
The PHP2Shell vulnerability is a runtime-level flaw, which is why it affects so many businesses at once.
PHP2Shell is the name given to two separate flaws in PHP’s core runtime. Both sit in the PHP engine itself, not in a plugin, framework or line of your own code. Even a well-written, fully updated application is exposed if it runs on a vulnerable version of PHP.
The first flaw is in how PHP handles an out-of-memory condition. When a request pushes PHP to its memory limit, the runtime is supposed to fail safely. Because of this flaw it doesn’t, and an attacker who triggers the condition on purpose can turn the failure into code execution on the server.
The second flaw involves internal state that outlives the memory it depends on. PHP keeps some data tied to each incoming request. If that data isn’t properly reset before its memory is released, PHP can later read memory that no longer belongs to it. This is known as a use-after-free bug, and an attacker can use it to execute code.
Security vendors have reported attack attempts since the disclosure, although CISA had not confirmed active exploitation as of its October 21 alert. Either way, unpatched internet-facing servers are a clear target.
Any PHP installation that serves web requests should be treated as at risk until it’s patched. That includes:
Apache with mod_php carries the highest risk, because the flaw can be triggered before your application code runs at all.
| PHP branch | Status | Upgrade to |
|---|---|---|
| PHP 8.5.x | Vulnerable before 8.5.12 | 8.5.12 |
| PHP 8.4.x | Vulnerable before 8.4.27 | 8.4.27 |
| PHP 8.3.x | Vulnerable before 8.3.36 | 8.3.36 |
| PHP 8.2.x | Vulnerable before 8.2.35 | 8.2.35 |
| PHP 8.1 and older | No official release | Upgrade to a supported branch |
PHP is often present in places you might not expect. Singapore’s Cyber Security Agency advises organisations to check for PHP inside third-party applications and components, even if their main website doesn’t use it. Include Docker containers, CI/CD images and staging servers in your review too.
Before you can apply the PHP patch, you need to know what you’re running.
On a server you manage, run:
php -v
This shows the CLI version. The version serving web traffic can be different, especially on servers with several PHP versions installed, so confirm it with one of the methods below as well.
Create a temporary file containing <?php phpinfo(); ?>, open it in a browser and check the version at the top. Delete the file right after, because it exposes server details.
Look for the PHP version in your hosting control panel (cPanel, Plesk or your provider’s dashboard). For WordPress sites, go to Tools → Site Health → Info → Server.
Check the base image tag in your Dockerfile and rebuild if it points to a vulnerable PHP version.
Work through these steps in order, starting with internet-facing systems.
If a server can’t be patched right away, reduce its exposure while you prepare the update:
These steps lower the risk but don’t remove it. The PHP team is clear that updating is the only complete fix.
This is the hardest situation. PHP 8.1 and older branches have reached end of life and receive no official release for PHP2Shell. The PHP security team has published minimal source-level backports for PHP 7.4, 8.0 and 8.1, but these only help teams that build PHP from source themselves.
For most businesses, there are three practical options.
The long-term fix is to move to a supported version (8.2 to 8.5) and apply the patch. Older codebases may need work first, such as replacing deprecated functions, updating dependencies, and testing for behavior changes between major versions. PHP 8.2’s security support ends on December 31, 2026, so 8.3 or later is the safer target.
Some vendors offer commercial extended-support patches for end-of-life PHP versions. This can buy time, but it isn’t a permanent fix, and it keeps you on an aging platform.
Restrict public access, put the application behind a web application firewall, or take non-essential systems offline until they can be upgraded.
PHP2Shell is the most severe PHP vulnerability of 2026, but not the only one. In July 2026, PHP released security updates (8.5.9, 8.4.24, 8.3.33 and 8.2.33) that fixed several PHP security vulnerabilities, including:
bccomp() function (PHP 8.4 and 8.5)Another round of security releases followed in September 2026. PHP ships security fixes regularly, and businesses that fall behind on updates build up risk with every release.
PHP2Shell won’t be the last critical PHP vulnerability. A few habits make the next one far easier to handle:
Xicom has been building and maintaining enterprise web applications for more than two decades, including large PHP codebases. Our engineers can assess your exposure to the PHP2Shell vulnerability, apply and verify patches across your servers and containers, and upgrade legacy applications from PHP 7.x or 8.1 to a supported version without disrupting your business. For applications that need more than a version bump, our software development services cover full modernization, from refactoring to re-architecture.
The PHP2Shell vulnerability is the most critical PHP security vulnerability of 2026, with no complete workaround. Check your PHP versions, apply the PHP security update, and plan an upgrade path for anything on an end-of-life branch.
Need help patching or upgrading your PHP applications? Contact Xicom to talk to our engineering team.
PHP2Shell is the name for two critical flaws in the PHP runtime, CVE-2026-109618 and CVE-2026-109619. Both are rated 9.2 under CVSS v4.0 and allow unauthenticated remote code execution on vulnerable servers.
The latest PHP vulnerability is PHP2Shell, disclosed and patched in October 2026. It affects the PHP runtime itself, so every application on a vulnerable PHP version is exposed.
The fixed versions are PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Any earlier release in these branches is vulnerable.
Security vendors have reported attack attempts, though CISA had not confirmed exploitation as of its October 21, 2026 alert. Because the flaws need no authentication, internet-facing servers should be patched immediately.
Not always. Automatic OS updates may not include PHP, and PHP services and long-running processes must be restarted to load the patched version. Always confirm the installed version after updating.
There is no official release for PHP 8.1 or older. The PHP team has published source-level backports for 7.4, 8.0 and 8.1, but the recommended path is to upgrade to a supported PHP branch.
Not always. Automatic OS updates may not include PHP, and PHP services and long-running processes must be restarted to load the patched version. Always confirm the installed version after updating.
Based on this article's topic