PHP2Shell: is your PHP website at risk, and how to fix it
Two critical flaws in PHP, together nicknamed PHP2Shell, can let an attacker run code on a web server without logging in. What they are, who is exposed, how to check your server, and how to fix it.

What PHP2Shell is: CVE-2026-109618 and CVE-2026-109619
PHP is the programming language behind a large share of websites, including every WordPress and Laravel site. On 21 October 2026 the PHP project fixed two flaws in PHP itself, CVE-2026-109618 and CVE-2026-109619, together nicknamed PHP2Shell. Both are rated critical, with a CVSS v4.0 score of 9.2 each.
Both allow remote code execution with no login: an attacker who can send a web request to a PHP site may be able to run their own code on the server. No account or password is needed, only the ability to reach the site, which for a public website means anyone on the internet.
They are different bugs with the same outcome. CVE-2026-109618 is in how PHP handles running out of memory while it is still reading a request: request data that was only partly set up is treated as valid during the clean-up that follows. CVE-2026-109619 is state left over from one request being carried into a later one handled by the same PHP worker.
PHP's own advisory says full code execution was proven over the web against Apache with mod_php at default settings.
Is my PHP site vulnerable? Who is at risk
Any server that runs a PHP without the fix and accepts web requests. That covers WordPress, Laravel and plain PHP sites alike: the flaws are in the language runtime, not in any application, theme or plugin, so keeping WordPress up to date does not close this hole. The PHP underneath it has to be updated.
Apache with mod_php is the highest-risk setup, and the one the proof was shown against. PHP-FPM, php-cgi, FrankenPHP and LiteSpeed are also affected. Running something other than mod_php is no reason to assume you are safe.
Whether the flaws are being exploited is disputed. Security firms have reported attempts (watchTowr and Cloudflare both did). Against that, Bitdefender had seen none by 22 October, the PHP team knew of no working exploits at release, Tenable says the exploit code claimed online is unverified, and as of 26 October 2026 the flaws are not on CISA's Known Exploited Vulnerabilities list. Do not wait to find out.
How to check whether your server has the fix
The fix was released on 21 October 2026 in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. If you run PHP from the PHP project's own releases, one of those versions or newer means you have it. Most servers do not work that way: they run the PHP packaged by their Linux distribution, and Debian, Ubuntu and Red Hat ship the fix as a security update that keeps the old version number. So php -v cannot tell you whether you are protected.
What settles it depends on how PHP got onto the server:
- Your own server, distribution PHP: read the installed PHP package's changelog and look for CVE-2026-109618 and CVE-2026-109619. If both are listed, the fix is in the package.
- Your own server, PHP from php.net or built from source: you need 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or a build with the fix applied.
- Shared or managed hosting: ask your host whether their PHP has the fix for the two CVEs, and whether PHP has been restarted since.
That last question matters on every server.
How to fix PHP2Shell: update, restart, and what to do on older PHP
The only complete fix is the update: the PHP security update from your distribution, or PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35 if you run PHP from the PHP project's own releases.
Then restart PHP. The running processes keep the old code in memory, so until Apache (for mod_php) or PHP-FPM is restarted, the server is still executing the vulnerable code, even though the files on disk have been replaced. Applied but not restarted is not fixed yet.
PHP 8.1 and older get no official release with the fix. For PHP 7.4 the PHP project published only a minimal source patch, not a release. A site still on one of these versions needs either a patched PHP built for it, where a patch exists, or a move to a server with a supported PHP. Both are real work; the second also means future security fixes arrive as ordinary updates.
Several vendors have named stop-gaps for servers that cannot be updated straight away. None of them is complete:
- Turning off PHP's session upload progress feature (named by Qualys).
- A web application firewall rule that blocks request bodies larger than 8 KB (named by AWS).
- Setting memory_limit to -1, described as partial. It also removes PHP's protection against one script using all of the server's memory, so it trades one risk for another.
Do these while the update is being arranged, not instead of it.
What we have done, and how we can help
We have already patched our own main servers, including two older ones still running PHP 7.4, for which no official update exists. There we built the patched version ourselves from the PHP project's source patch.
If you are not sure where your site stands, we can check whether your server or hosting is affected. Where the server is yours, we can apply the update and restart PHP. Where it runs an older PHP with no official update, we can build a patched PHP for it. Or we can move the site to one of our own up-to-date servers in Perth.
One plain limit: on shared hosting the host patches the server, not us. There we can check whether the fix is in place, chase the host for an answer, and move the site if that answer does not come.
Need it looked at today?
Our emergency check for one site: an assessment, a diagnosis and a proposed fix, within 24 hours of your payment.
PHP2Shell emergency check
$349 for one site, within 24 hours
Order- An assessment of your site and its server
- A diagnosis: whether PHP2Shell affects it, and how
- A proposed fix
The fix itself is included when it takes up to 2 hours of work. When it needs more, we advise its total cost first.
Pay in 4
To have us check your site, or do the fix for you, send us the details below.
Ask us to check your server
Tell us a little about your site and we will take a look.
