PHP2Shell: what the October 2026 PHP security flaw means for your website
By Tom · Last reviewed · 6 minute read
If your website runs on PHP (that includes every WordPress site), it needs updating to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35 now. Attackers are already trying the flaw. Anything on PHP 8.1 or older gets no official fix, so the real fix there is moving to a supported version.
On this page
On 21 October 2026 the PHP project released emergency updates for two critical security flaws, now known as PHP2Shell (CVE-2026-109618 and CVE-2026-109619). PHP is the programming language that runs most of the web, including every WordPress site, so this affects a lot of small business websites.
This guide explains what's happened in plain English, how to tell if your site is affected, and what to do about it. There's a more technical section at the end for anyone who manages their own server.
What happened
PHP's own team rates both flaws 9.2 out of 10 for severity. In short, they let an attacker run their own code on your web server just by sending it a specially crafted request. They don't need a password, and it happens before WordPress or any of your site's own code even starts.
If that works, the attacker effectively controls your website. They can add spam pages, redirect visitors to scam sites, steal form submissions or customer data, or use your server to attack others.
A few things make this one more urgent than the usual security update:
- Attacks have already started. Amazon's threat researchers recorded an attempt on 17 October, four days before the fix was released. By 21 October they reported the flaw was being "broadly exploited in the wild", and Cloudflare said it was seeing early attacks.
- It goes back a long way. The vulnerable code dates back to PHP 5.4, released in 2012, so older sites are affected too.
- The details leaked early. The flaw identifiers circulated online the day before the fix, and the PHP project brought its release forward by a day as a result.
Is my website affected?
Your site is likely affected if all of these are true:
- It runs on PHP. This includes WordPress, WooCommerce, Joomla, Drupal, Magento and most sites built by agencies or freelancers before around 2020.
- Its PHP version is older than the fixed versions below.
- It's running on a normal web server setup (PHP-FPM, Apache with mod_php, php-cgi, LiteSpeed or FrankenPHP). That's almost all of them.
Sites built on Wix, Squarespace or Shopify don't run PHP that you control, so there's nothing for you to do. Those platforms handle it themselves.
The fixed versions
| Your PHP version | What to do |
|---|---|
| 8.5 | Update to 8.5.12 or later |
| 8.4 | Update to 8.4.27 or later |
| 8.3 | Update to 8.3.36 or later |
| 8.2 | Update to 8.2.35 or later |
| 8.1, 8.0 or 7.4 | No official fix. Move to 8.3 or 8.4 |
| 7.3 or older | No fix of any kind. Move to 8.3 or 8.4 |
How to check your PHP version
- Quickest: try my free PHP security check. Enter your web address and it tells you which PHP version your site shows, if it shows one, and whether that version has the fix.
- WordPress: go to Tools → Site Health → Info → Server. It shows the PHP version.
- cPanel or Plesk: look for "Select PHP Version" or "PHP Settings" in your hosting control panel.
- Not sure who hosts your site? That's worth finding out today. Your web designer, or whoever you pay for hosting, will know.
What to do now
If someone else manages your hosting
This is most small businesses. Your job is to make sure it's actually been done:
- Ask your host or web designer, in writing, whether PHP on your server has been updated to a fixed version, and when. A good host will have done it already or will tell you when it's scheduled.
- Check which PHP version your site is set to in your control panel. Many shared hosts offer several versions side by side. They'll patch each one, but if your site is set to 7.4 or 8.1, it stays vulnerable until you switch.
- If you're on 8.1 or older, plan the move to 8.3 or 8.4 now. Take a backup first, then switch the version and check the site. Old plugins or themes can break on newer PHP, which is the usual reason sites are left on old versions in the first place.
If your site is on one of my care plans, this is already in hand. PHP and server updates are part of what you pay for.
If you manage your own server
Update PHP through your package manager, then restart PHP. The update doesn't protect anything until the running processes have been replaced. More detail is in the technical section below.
Check your site hasn't already been hit
Because attacks started before the fix was public, it's worth a quick check even after updating. Updating closes the door, but it won't remove anything an attacker has already left behind. Look for:
- Admin users you don't recognise (in WordPress, under Users).
- Files modified since 17 October that you or your developer didn't change.
- New pages, spam links, or redirects to sites you don't know, especially when visiting from Google on a phone.
- Warnings in Google Search Console, or your host suspending the account.
- A sudden jump in server load or outgoing email.
If anything looks wrong, don't just delete the odd file. Follow my guide on what to do when your website gets hacked, and make sure you have a clean backup from before 17 October.
Need a hand with this?
If you're not sure whether your site is affected, can't work out who hosts it, or you're stuck on an old PHP version because something breaks when you update, get in touch. I can check which PHP version your site is running, update it safely, fix any plugins or themes that fall over on a newer version, and look for signs it's been tampered with.
You don't need to be an existing client. Email me at hello@webcardiff.co.uk with your website address, and I usually reply within about an hour during the working day.
Technical notes for anyone running their own server
The two flaws:
- CVE-2026-109618: out-of-memory handling can interrupt PHP while internal request data is only partly set up. Request cleanup then treats the invalid data as valid.
- CVE-2026-109619: request state can outlive the memory behind it (a use-after-free), so a later request handled by the same worker may use stale state. PHP's advisory also confirms memory disclosure.
Affected setups are PHP-FPM, Apache with mod_php (rated the highest risk), php-cgi, FrankenPHP and LiteSpeed.
Updating:
- Check both the CLI and FPM versions, as they can differ:
php -vandphp-fpm8.3 -v(swap in your version).ls /etc/phplists every version installed. - On Debian and Ubuntu with the Ondřej Surý packages:
sudo apt update && sudo apt install --only-upgrade 'php8.3*'. Repeat for every installed PHP version, including ones no site currently uses. - If your distribution backports security fixes, the version number may not change. Look for the CVE numbers in the package changelog instead.
- At the time of writing, the Remi repository for RHEL-based systems hadn't published updated packages. Use your distribution's packages or build from source.
- Restart afterwards. Restart PHP-FPM, and Apache too if you use mod_php. Long-running PHP processes such as queue workers, Laravel Horizon, Octane or Reverb keep the old code in memory until they're restarted. Rebuild any Docker images that bundle PHP.
If you can't patch straight away, these settings reduce the risk. They don't remove it, so they're a stopgap until you update:
memory_limit=-1, set so applications can't override it (for CVE-2026-109618).session.upload_progress.enabled=0(for CVE-2026-109619). On PHP 8.5, alsofatal_error_backtraces=0.- Apply both together, as each covers a different flaw, then restart every PHP worker.
- If the site doesn't need file uploads, block
multipart/form-dataPOST requests before they reach PHP, and keeppost_max_sizelow. - Cloudflare has added firewall rules for the known attack patterns on all plans, including free. Cloudflare itself calls these a stopgap, and they only protect traffic that actually goes through Cloudflare.
For the full detail, see the PHP 8.x changelog and Tenable's PHP2Shell FAQ.
Questions people ask
Is my WordPress site affected by PHP2Shell?
Almost certainly, unless your host has already updated PHP. WordPress runs on PHP, and the flaws are in PHP itself, not in WordPress or your plugins. The researchers who found them confirmed attacks working against WordPress, Drupal, Joomla and Magento. Updating WordPress alone does not fix it.
Do I need to do anything if my host manages my server?
Probably not much, but don't assume. Check your host's status page or ask them in writing whether PHP has been updated to a fixed version, and check which PHP version your site is set to in your control panel. If you're on PHP 8.1 or older, you'll need to switch to a newer version yourself.
My site is on PHP 7.4. Is there a fix?
Not an official one. The PHP project only released fixed versions for 8.2 and newer. Its security team published rough patches for 7.4, 8.0 and 8.1, but these are for people who compile PHP themselves. For almost everyone, the answer is to move the site to PHP 8.3 or 8.4, which may mean updating old plugins or themes first.
Will updating PHP break my website?
A patch update within the same version (for example 8.3.30 to 8.3.36) is very unlikely to break anything. Jumping between versions (for example 7.4 to 8.3) can break old plugins and themes, so take a backup and test first.
Has my site already been hacked?
Probably not, but attempts were seen from 17 October 2026, before the fix was public. Look for admin users you don't recognise, files changed recently that you didn't change, and unexpected redirects or spam pages. If anything looks wrong, follow my hacked website recovery guide or get in touch.
