PHP2Shell: the critical PHP flaws, and what to do today

By the NexusSec team · 5 min read · Published
Short version: CVE-2026-109618 and CVE-2026-109619, nicknamed PHP2Shell, are critical flaws in the PHP engine itself that can let an attacker run code on a web server without logging in. PHP fixed them on 21 October 2026 in versions 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Update PHP on every server, internet-facing ones first, restart every PHP worker afterwards, and ask your hosting provider and appliance vendors for their fix. Updating WordPress or plugins does not fix this.

Most website security advice is about the application: keep WordPress, plugins and themes up to date. This one is different. The flaws are in PHP, the language runtime underneath, so every PHP application on an affected server is exposed, however well it is maintained. This post reflects what was published up to 23 October 2026.

What happened

On 20 October 2026 the PHP project gave notice of an upcoming critical security release, and on 21 October it published PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, fixing two vulnerabilities that PHP rates 9.2 out of 10 under CVSS v4.0:

PHP's advisory says the risk is highest for Apache's mod_php, but that every web setup is at risk: PHP-FPM, mod_php, php-cgi, FrankenPHP and LiteSpeed. The US agency CISA describes the flaws as affecting all PHP installations serving web requests, and the UK's NCSC warns they may allow attackers to execute commands on web servers running PHP.

Is it being exploited?

When CISA published its alert on 21 October, it had not observed exploitation. Since then, several security companies have reported public proof-of-concept code and attack attempts aimed at the flaws. Treat it as urgent either way: these are unauthenticated, remote flaws in software that runs a large share of the web, and reports of attack traffic tend to grow quickly after a fix is published.

Which versions fix it

PHP branchFixed inNote
8.58.5.12Supported
8.48.4.27Supported
8.38.3.36Supported
8.28.2.35Security fixes end on 31 December 2026
8.1, 8.0, 7.4 and olderNo official releaseOut of support. PHP has published minimal source backports for 7.4, 8.0 and 8.1, and some vendors ship backported fixes

If your PHP comes from a Linux distribution's packages, the fixed package may carry a different version number. Linux distributions received the patches in advance, so check your vendor's security notice rather than comparing version numbers alone.

What to do today

  1. Find every PHP installation. Websites and web applications, intranet tools, hosting control panels, and appliances or software that bundle PHP internally. The NCSC points to an inventory of potentially affected products published by NCSC-NL.
  2. Check the version on each. On a server, php -v or the package manager shows it. Do not leave a phpinfo() page public to check: it gives attackers the same information.
  3. Update, internet-facing servers first, then internal ones.
  4. Restart every PHP worker after updating: PHP-FPM pools, Apache or the web server, so that no worker keeps running old code.
  5. On shared or managed hosting, ask your provider whether their PHP builds include the fix, and switch your site to a fixed version in the control panel if they offer a choice.
  6. Ask vendors of any appliance or product that bundles PHP when their fix ships.

If you cannot update yet

PHP is plain that there are no complete mitigations and that updating is the only safe choice. Its advisory lists settings that reduce exposure, including disabling session upload progress in php.ini or the FPM pool configuration and then restarting every worker. A web application firewall may help as a stopgap. If you cannot update or mitigate quickly, CISA and the NCSC both suggest considering taking the system offline. Systems still on PHP 8.1 or older are the hardest case, because they receive no official fix.

On anything left exposed, look for signs of compromise: PHP worker processes starting shells or downloading tools, unexpected new files in web directories, and administrator accounts nobody recognises.

WordPress and other applications

Updating WordPress, Joomla, Drupal, Magento or their plugins does not fix PHP2Shell, because the flaws sit below them in PHP itself. The application can be fully up to date and still exposed. The fix is the PHP runtime on the server.

A follow-up advisory

On 23 October PHP published a further, informational advisory, CVE-2026-115560, which needs an unusual session configuration to matter. Its suggested setting, disabling session upload progress until the next regular release, is the same one listed for PHP2Shell.

The longer lesson

The businesses that fix this fastest are the ones that already know where PHP runs and what is exposed to the internet. If this week was a scramble, see what the internet can see and a patching routine that actually happens. Our VAPT services include checking web servers for exactly this kind of exposure.

Sources

Frequently asked questions

Is my WordPress site affected by PHP2Shell?

If it runs on an unpatched version of PHP, yes. The flaws are in PHP itself, so updating WordPress or plugins does not help. Update PHP, or ask your hosting provider whether they have.

Which PHP versions fix CVE-2026-109618 and CVE-2026-109619?

PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, released on 21 October 2026. Distribution packages may use different version numbers, so check your vendor's security notice.

What if we are still on PHP 8.1 or 7.4?

Those branches receive no official release. PHP has published minimal source backports and some vendors ship backported fixes, but the lasting answer is moving to a supported version.

Is there a workaround for PHP2Shell?

PHP lists settings that reduce exposure, such as disabling session upload progress and restarting every worker, but says there are no complete mitigations. Updating is the only safe choice.

Need your PHP servers found and patched quickly?

We inventory where PHP runs, update or isolate what is exposed, and check internet-facing servers for signs of compromise.

Book a free consultation