PHP2Shell: What the New PHP Vulnerability Means for Your Website

PHP2Shell is a pair of critical flaws in PHP itself, rated 9.2 out of 10, that can let a stranger run code on a web server without logging in. On October 21, 2026, the PHP project released fixed versions and told all PHP users to update immediately. If your website runs on WordPress, WooCommerce, Joomla, Drupal, or most shared hosting, this PHP vulnerability applies to you, and updating WordPress or your plugins does not fix it. The fix happens one layer down, in the PHP version your server runs.
This guide explains what PHP2Shell is in plain terms, which PHP versions are safe, why sites on old PHP 7.4 are in a harder spot, and a checklist any site owner can work through this week.
What PHP2Shell is, in plain terms
PHP is the programming language that runs most content management systems, including WordPress. Every time someone loads a page, PHP builds it on the server. PHP2Shell is the name researchers gave to two bugs in that engine, tracked as CVE-2026-109618 and CVE-2026-109619.
According to the official PHP security advisory:
- CVE-2026-109618 is a remote code execution flaw caused by out-of-memory handling. If PHP runs out of memory while it is still setting up a request, the cleanup step can treat half-built data as valid.
- CVE-2026-109619 is a remote code execution flaw caused by stale data. Information from one request can survive after its memory has been freed, and a later request handled by the same server process can use it. The NVD entry describes the same “stale global state” problem.
The PHP security team rates both 9.2 on the CVSS v4.0 scale, which is critical, per CERT-EU’s advisory. The bugs were reported by researchers at Calif.io, Wiz, OpenAI, and Quarkslab, according to Cloudflare, and the earliest affected code dates back to PHP 5.4.0, per Tenable’s FAQ.
What “remote code execution” means for a business owner: an attacker who succeeds can run their own commands on your server with the permissions of the web server account. From there they can plant hidden files, add administrator accounts, inject spam links or redirects, or steal data stored on the site.
Who is affected by the PHP vulnerability
The short answer is almost every PHP website. The PHP advisory lists every common way PHP is served: PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP, and LiteSpeed. The PHP team considers the risk highest for mod_php, where it has a demonstrated exploit that fires before any of your site’s code runs.
That last detail matters. A security plugin such as Wordfence is itself PHP code that loads with WordPress. If the attack fires before WordPress loads, a plugin cannot be the thing that stops it. Plugins and firewalls still help, but the real fix is the server’s PHP version.
Is PHP2Shell being exploited?
Yes, attempts are already widespread. Here is what was public as of October 22, 2026:
- Amazon’s threat intelligence honeypots recorded the first exploit attempt on October 17, four days before the patches, SiliconANGLE reported.
- Cloudflare saw tens of thousands of attempts within 45 minutes of the announcement, hundreds of thousands within two hours, and millions after that (same source).
- Wordfence reported blocking more than 74,000 exploit and probing attempts across more than 5 million WordPress sites, with no confirmed compromise at that point (same source).
- CISA, the US cybersecurity agency, urged immediate patching on October 21.
“No confirmed compromise yet” is not the same as safe. Automated scanners are testing every PHP site they can find, and the sites that get hit first are the ones nobody is watching.
Which PHP versions fix PHP2Shell
The PHP project released four fixed versions on October 21. The table below shows where each PHP branch stands, using the PHP project’s supported versions and branch data:
| PHP branch | Support status | PHP2Shell fix |
|---|---|---|
| 8.5 | Supported | Update to 8.5.12 |
| 8.4 | Supported | Update to 8.4.27 |
| 8.3 | Supported | Update to 8.3.36 |
| 8.2 | Security fixes only, ends December 31, 2026 | Update to 8.2.35 |
| 8.1 | End of life since December 31, 2025 | No official release |
| 8.0 | End of life since November 26, 2023 | No official release |
| 7.4 | End of life since November 28, 2022 | No official release |
| 7.3 and older | End of life | No fix |
For PHP 8.1 and older, the PHP project says it no longer ships updates. Its security team did publish minimal source code patches for 7.4, 8.0, and 8.1, but those are for people who compile PHP themselves. Linux distributions and long-term support vendors received fixes in advance, so some hosts may have backported patches. A typical small business owner on shared hosting cannot confirm that, and should treat PHP 8.1 and older as unprotected.
Note that PHP 8.2 is safe once updated to 8.2.35, but it stops receiving security fixes at the end of 2026. If you are moving off an old version anyway, WordPress recommends PHP 8.3 or greater.
The PHP 7.4 problem
Old PHP is more common than most owners realize. In a July 2026 scan of about 316,500 public WordPress sites, Censys found that over 70% ran an outdated PHP version, and PHP 7.4 was the single most common version, at more than 20% of sites.
Sites stay on PHP 7.4 for one reason: something breaks when they move. Old themes, outdated page builders, and abandoned plugins often use code that PHP 8 no longer accepts. Flip the switch on a live site and the result can be a blank white page or a “critical error” message in front of your customers.
Some hosts, SiteGround among them, said they applied server-level protection across their servers hours before the official fix shipped. That kind of mitigation buys time. The PHP advisory is clear that only an update is a complete fix, so a site on PHP 7.4 still needs a plan to move to a supported, patched version.
What we did for the sites we host
27 Online Media hosts and maintains websites for small businesses, so this one landed on our desk the day it was announced. The same night, we checked the PHP version on every site we host. Most were already on a patched release.
Sites that were still on PHP 7.4 did not get switched blind. We copied each one to a staging site, ran it under PHP 8.2, and fixed the PHP 8 compatibility errors that turned up, which came mostly from older themes. Once the staging copy ran cleanly, we switched the live site over. That is the same process we recommend to any owner below.
A PHP2Shell checklist for website owners
Work through these in order. The first three close the PHP vulnerability itself. The rest are WordPress security basics that limit the damage if anything got in during the window before you patched.
- Check your PHP version. Log in to your hosting control panel (cPanel, Site Tools, Plesk, or similar) and look for “PHP Manager,” “PHP Version,” or “MultiPHP.” In WordPress, Tools, then Site Health, then Info, then Server also shows it. You want 8.5.12, 8.4.27, 8.3.36, 8.2.35, or newer.
- Update to a supported, patched branch. If your host manages PHP versions for you, confirm in writing that your site runs a fixed release. If you are on 8.1 or older, plan the move to 8.3 or newer now.
- Test on staging first. Most hosts offer one-click staging. Change PHP on the staging copy, then click through your home page, contact forms, checkout, and any page built with a page builder. Old themes and page builders are the usual breaking points. Fix or replace what breaks, then switch the live site.
- Remove plugins you do not use. Every inactive plugin is code sitting on your server. Delete, do not just deactivate, anything you are not using. File manager plugins deserve special attention: they let anyone with access browse and edit server files from the dashboard, which is exactly what an attacker wants.
- Review administrator accounts. In WordPress, go to Users and filter by Administrator. Remove any account you do not recognize and downgrade anyone who does not need full access.
- Rotate passwords and WordPress salts. Change passwords for WordPress admins, hosting, FTP or SFTP, and the database. Then replace the security keys and salts in wp-config.php, which signs everyone out and invalidates any stolen login cookies.
- Confirm you have backups. Check that your host or a backup plugin keeps daily copies stored off the server, and that you know how to restore one. Keep a copy from before October 17, the first reported exploit attempt.
- Run a malware scan. Wordfence and similar plugins scan the files on your server. Sucuri SiteCheck is a free outside check for visible malware, spam, and blocklist status. Sucuri notes that remote scanners have limited access, so use both kinds of scan, not one or the other.
What not to rely on
A few things will not fix PHP2Shell on their own:
- Updating WordPress core, themes, or plugins. Good practice, but the flaw is in PHP, not WordPress.
- A security plugin alone. It runs after the attack point on mod_php servers.
- A web application firewall alone. Cloudflare and others deployed rules for known attack patterns, and Cloudflare itself described its rules as a stopgap. New variants can slip past filters.
- Interim PHP settings. The PHP advisory lists configuration changes that reduce exposure, and says plainly they do not make an installation safe.
The bottom line
PHP2Shell is a serious PHP vulnerability because it sits underneath everything else on the server. The fix is simple to describe: run PHP 8.2.35, 8.3.36, 8.4.27, 8.5.12, or newer. The hard part is for sites still on PHP 7.4 or 8.1, where the upgrade needs testing so the site does not break. Do that work on staging, then use this week to clean up old plugins, unknown admin accounts, and stale passwords.
If 27 Online Media hosts your website, this is already handled: your site is on a patched PHP version and you do not need to do anything. If your site is hosted somewhere else and you are not sure where it stands, see our web, hosting, and SEO services or ask us to check your site. We will tell you which PHP version it runs and what it would take to get it current.
Facts and dates above are from the PHP project and the security advisories linked in the text.


