CC.
All posts

By ··7 min read

PHP2Shell: what WordPress and PHP site owners should do this week

Two critical flaws in PHP itself put WordPress and PHP sites at risk. The fixed versions, how to check yours and what to do if you can't update yet.

  • Security
  • PHP
  • WordPress

Key takeaways

  • PHP2Shell is two critical remote code execution flaws in PHP itself (CVE-2026-109618 and CVE-2026-109619), so a site can be exposed even when its own code is fine.
  • The fixes are PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. PHP 8.1 and older get no regular release from the PHP project.
  • Update PHP or get your host to, restart PHP, then plan to leave PHP 8.2, which stops getting security fixes on 31 December 2026.

On 21 October 2026 the PHP project shipped an emergency security release for two flaws now known as PHP2Shell. Both are rated 9.2 out of 10 on CVSS v4.0, both can let an attacker run code on a server without logging in, and both sit in PHP itself, not in WordPress or a plugin. If your website runs on PHP, and every WordPress and WooCommerce site does, this applies to you.

The short version: make sure your site runs PHP 8.5.12, 8.4.27, 8.3.36, 8.2.35 or a host-patched build, and restart PHP after updating. The rest of this post covers how to check, what to ask your host and what to do if you can't update today.

What happened

The two vulnerabilities are CVE-2026-109618 and CVE-2026-109619. In plain terms, both are memory bugs in how PHP tidies up around a request. One is triggered when PHP runs out of memory while it is still setting a request up, which leaves the clean-up code working with half-built data. The other lets data from one request outlive its memory and get picked up by the next request on the same worker. Rapid7 says either can lead to remote code execution with the privileges of the web server's PHP worker.

PHP's advisory says there are no complete mitigations: updating is the fix. It names Apache with mod_php as the highest-risk setup, because an attack can succeed before any of your own code runs. Rapid7 lists PHP-FPM, php-cgi, LiteSpeed and FrankenPHP as affected too.

Is anyone exploiting it?

Attackers are trying. watchTowr reports exploitation in the wild since 21 October through its honeypot network, after details leaked on social media on 20 October. Rapid7 has seen multiple reports of exploitation attempts. It also found that the public proof-of-concept exploits only work against particular combinations of operating system, PHP version and web server, and none was broadly reliable when it published. As of 22 October, CISA had not added either CVE to its Known Exploited Vulnerabilities catalogue.

That is not a reason to wait. Rapid7 expects a more portable exploit to appear, and when it does, automated scanners will try it against every PHP site they can find. For comparison, Patchstack found that heavily exploited WordPress vulnerabilities reached mass exploitation a median of about five hours after disclosure.

Which versions are fixed

  • PHP 8.5: fixed in 8.5.12.
  • PHP 8.4: fixed in 8.4.27.
  • PHP 8.3: fixed in 8.3.36.
  • PHP 8.2: fixed in 8.2.35. This branch reaches end of life on 31 December 2026.
  • PHP 8.1, 8.0 and 7.4: no regular release. The PHP project published minimal source patches, and Linux distributions and long-term-support vendors ship their own fixed packages.
  • PHP 7.3 and older, including PHP 5: no fix at all. watchTowr confirmed these are affected too, so the only answer is to upgrade.

One catch: Linux distributions often backport security fixes without changing the version number. A server reporting an older 8.3 release from Ubuntu or Debian might be patched, while one built from source might not. If your server uses distribution packages, check the vendor's security advisory, not just the number.

How to check your site

On WordPress

Go to Tools → Site Health → Info and open the Server section. It shows the PHP version your site is running and the server software. It's the quickest check for anyone without server access.

On shared hosting such as Hostinger

On shared hosting, the host patches PHP and you choose the branch. In Hostinger's hPanel, that's PHP Configuration in the website's dashboard, and the setting applies to every site on the plan. Hostinger's support article says versions below 8.2 are no longer available to select. Choose 8.3 or 8.4 if your theme and plugins support it, and ask support to confirm that the build your site runs on includes the 21 October fixes.

On your own server or VPS

# Version of the command-line PHP
php -v

# On Debian or Ubuntu: installed PHP packages and their versions
dpkg -l | grep php

The command-line PHP and the PHP serving your website can be different installs. To see the one the web server uses, upload a temporary file that calls phpinfo() and open it in a browser. The 'Server API' line also tells you whether you're on Apache's mod_php ('Apache 2.0 Handler'), PHP-FPM or LiteSpeed. Delete the file straight afterwards, because it shows attackers a lot about your server.

What to do, in order

  1. Update PHP to a fixed release, or install your distribution's patched packages. On shared hosting, ask your host to confirm in writing that your server has the fix.
  2. Restart every PHP process: PHP-FPM, Apache or LiteSpeed. A patched file on disk does nothing while old workers are still running.
  3. If you run Apache with mod_php, plan a move to PHP-FPM. It's the setup PHP's advisory calls the highest risk.
  4. Take a fresh backup, then look for signs of compromise since 20 October: admin users you don't recognise, PHP files in upload folders and changed .htaccess files.
  5. Update WordPress, themes and plugins while you're there. PHP2Shell is in PHP, but most WordPress break-ins still come through plugins.

If you can't update today

PHP published interim settings that reduce exposure. They don't make a server safe, and both PHP and Rapid7 say so plainly, so treat them as a bridge of hours or days. They have to go in php.ini or the PHP-FPM pool configuration, followed by a restart of every worker. ini_set() calls and .user.ini files take effect too late to help.

; Interim only. Update PHP as soon as you can.
session.upload_progress.enabled = 0

; Keep request bodies small (raise to 32M only if you need uploads)
post_max_size = 8M
upload_max_filesize = 6M

On PHP 8.5, the advisory also asks for fatal_error_backtraces = 0. It describes a memory-limit change as well, but that one is only safe alongside container memory limits, so leave it to whoever manages the server.

If your site sits behind Cloudflare or your host's firewall, cap request sizes there too, and block multipart uploads on any path that doesn't need them.

There's also a follow-up: on 23 October PHP published an advisory for a third issue, CVE-2026-115560. It only affects unusual session configurations, the session.upload_progress setting above already covers it, and a full fix is due in the next regular release.

Use this as the push to leave PHP 8.2

PHP 8.2 got this fix, but it stops receiving security releases on 31 December 2026. The next bug like this one after that date won't be patched for 8.2 at all. PHP 8.3 is supported until 31 December 2027, 8.4 until 31 December 2028 and 8.5 until 31 December 2029.

For a WordPress or WooCommerce site, the upgrade is usually routine. Test on a staging copy, switch the PHP version, then click through the shop, checkout and contact forms while watching the error log. The real work is in old or abandoned plugins that were never updated for newer PHP. If a plugin blocks the upgrade, that plugin is already a security risk, and replacing it is part of the job.

Checklist

  • Site Health or phpinfo() shows a fixed version, or your host has confirmed the patch.
  • PHP workers were restarted after the update.
  • Interim settings are in place if you're still waiting for a patch.
  • No unexpected admin users, PHP files in uploads or .htaccess changes since 20 October.
  • A date is booked to move off PHP 8.2 before 31 December.

Frequently asked questions

What is PHP2Shell?

PHP2Shell is the name for two critical vulnerabilities in PHP itself, CVE-2026-109618 and CVE-2026-109619, disclosed on 21 October 2026. Both are rated 9.2 on CVSS v4.0 and can let an attacker run code on a server without logging in.

Which PHP versions fix PHP2Shell?

PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. For PHP 8.1, 8.0 and 7.4 there are only minimal source patches and vendor packages, and PHP 7.3 and older have no fix.

Is my WordPress site affected by PHP2Shell?

Yes, if it runs on an unpatched PHP version, even when WordPress and every plugin are up to date, because the flaws are in PHP itself. Check the version under Tools → Site Health → Info → Server, and ask your host to confirm the patch.

Do the php.ini mitigations make a server safe?

No. PHP and Rapid7 both say the interim settings only reduce exposure. Updating PHP and restarting every PHP worker is the only complete fix.

If your site is down or acting strangely while you work through this, how to find out why a website is down covers the checks I run first. If you'd rather hand it over, I offer WordPress maintenance and security.

Sources

  1. PHP — News: security releases and advisories (October 2026)
  2. PHP — Supported versions
  3. Rapid7 — CVE-2026-109618 and CVE-2026-109619: Critical unauthenticated remote code execution in PHP
  4. watchTowr — PHP2Shell FAQ
  5. Patchstack — State of WordPress Security in 2026
  6. Hostinger — How to change the PHP version of your hosting plan

Written by

· Full stack web developer

I'm a full stack web developer who has spent the last few years helping founders, agencies and local businesses turn ideas into products people enjoy using. Find me on GitHub and LinkedIn.