PHP shipped emergency fixes for two critical flaws that can let an attacker run code on your server. Here is who is affected and exactly what to do.
Two critical flaws in PHP, nicknamed PHP2Shell, can let an attacker run their own code on a web server without logging in. PHP released fixes on October 21 and 22, 2026, in versions 8.5.12, 8.4.27, 8.3.36 and 8.2.35. If your website runs on PHP, which includes WordPress, WooCommerce, Laravel and most older custom sites, the fix is to update PHP on the server. Updating WordPress, a plugin or a theme does not fix it, and a firewall such as Cloudflare's lowers the risk but does not replace the update.
Update, October 25: PHP has since disclosed a third issue, CVE-2026-115560, which the October 21 and 22 releases do not fix. It is much narrower than the first two and calls for one setting to be changed; see "A third PHP issue" below. The rest of this post is current as of October 25, 2026. It is still developing, so check the sources at the end for changes.
Update, November 5: PHP has not released anything newer than 8.5.12, 8.4.27, 8.3.36 and 8.2.35, and the full advisory for CVE-2026-115560 is still pending, so the advice below stands.
What happened
Details of the flaws leaked a day or two before the planned announcement, and PHP published an emergency release. Cloudflare, Amazon and the security firm watchTowr have all reported attack attempts, some of them before the fixes were public.
Reports differ on whether attacks are succeeding. watchTowr says it has seen exploitation in the wild. CISA, in an alert last revised on October 23, said it had not observed successful exploitation. Public proof-of-concept code exists but, according to Rapid7, it works only on specific combinations of operating system, PHP version and web server. Treat that as a short window to patch, not a reason to wait: a more reliable exploit could appear at any time.
The two flaws in plain terms
| CVE | What goes wrong | Severity |
|---|---|---|
| CVE-2026-109618 | When PHP runs out of memory while setting up a request, it can leave internal data half-built, and later code then trusts it. A crafted request can trigger this within normal size limits. | 9.2 (critical) |
| CVE-2026-109619 | PHP keeps some internal state between requests handled by the same worker process. That state can point to memory that has already been freed, so the next request can act on leftover data. | 9.2 (critical) |
Severity is the CVSS v4.0 score. Either flaw can allow unauthenticated remote code execution with the privileges of the web server process. PHP's own advisories are GHSA-w8hw-w9fx-j79w and GHSA-6wmf-4rv5-p3rp.
Are you affected?
Very likely, if PHP serves your website. CISA's alert says the flaws affect all PHP installations serving web requests, including Apache with mod_php, PHP-FPM, php-cgi, FrankenPHP and LiteSpeed, and PHP considers mod_php the highest risk. The application on top does not matter: it is the PHP version on the server that counts.
| Your PHP version | Status | What to do |
|---|---|---|
| 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or later | Fixed | Restart PHP if you have just updated |
| An older release of 8.5, 8.4, 8.3 or 8.2 | Vulnerable | Update to the fixed release of the same branch |
| 8.1, 8.0 or 7.4 | Vulnerable, no official release | Move to a supported branch, or use a vendor or distribution package that carries the fix |
| 7.3 or older | Vulnerable, no fix | Upgrade to a supported branch |
PHP 8.2 stops receiving security fixes on December 31, 2026, so if you are on 8.2, plan the move to 8.3 or 8.4 now rather than patching and forgetting.
How to check your PHP version
- Hosting panel. Most hosts show the PHP version under a PHP settings page. It usually shows the branch, such as 8.3, and not the patch level, so ask support to confirm that the build with the October fix is installed.
- WordPress. Open Tools, then Site Health, then the Info tab, and look under Server.
- Command line. On a server you manage,
php -vshows the command-line version. The web server may use a different PHP, so also check the one that serves your site. - Linux distributions. They often backport a fix without changing the version number. Look for your distribution's security notice instead of judging by the number alone.
- A phpinfo page also shows the version, but delete it straight away. A public phpinfo page gives attackers useful detail.
How to fix it
- Update PHP to the fixed release for your branch. On shared hosting, use the PHP version setting or ask support. On a VPS, update the PHP packages from your distribution or vendor repository. With Docker, pull the patched image and rebuild.
- Restart PHP so the fix loads. Restart PHP-FPM or Apache and make sure every worker process is replaced. An updated package that is still running the old process is still vulnerable.
- Turn off session upload progress until PHP's next release. Set
session.upload_progress.enabledto 0 in php.ini, the PHP-FPM pool or the server configuration, and restart. PHP recommends this for the third issue, and it also closes the known paths for the second flaw. If your application tracks upload progress with PHP sessions, check with whoever built it before you switch it off. - If you are on 8.1 or older, plan the upgrade. Test on a staging copy, update plugins and themes first, then switch the version. The steps in our guide to updating WordPress safely apply to any PHP site.
- Look for signs of a break-in, especially if the site was exposed before you patched: new or changed PHP files in upload folders, admin users you do not recognize, PHP processes starting shells or downloading tools, unexpected scheduled tasks and spam pages. Compare against a clean backup, and restore if anything looks wrong.
- If you find or suspect a compromise, clean the site first and then change the database, admin, hosting and API credentials.
Our website security guide covers backups, access control and what to do after a hack in more detail.
If you cannot update today
- Taking the site offline. CISA advises taking PHP systems offline until they are patched if they cannot be updated promptly, or if they run PHP 8.1 or earlier. For a brochure site, a day behind a maintenance page costs less than a compromised server.
- Configuration changes do not fix it. PHP states that no configuration change fully mitigates the flaws, and that updating is the only complete remedy.
- One setting reduces the known paths. Setting
session.upload_progress.enabledto 0 closes the confirmed paths for the second flaw, according to Rapid7, and PHP recommends it for the third issue. It must be set in php.ini, the PHP-FPM pool or the server configuration, followed by a restart. Setting it from application code or a.user.inifile is too late, and it does not cover every possible variant. - Request limits. Rapid7 also advises limiting request size, the number of multipart parts and nesting depth at the web server or proxy, and blocking multipart requests where your site has no use for them.
- A firewall in front of the site. See the next section.
Option: put Cloudflare in front of your site
Cloudflare says it built firewall protection for these flaws starting in early October, and that it went live on October 21 at 03:02 UTC, about nine hours before the public disclosure. In its own post it says every customer with the WAF is covered by default. The Free plan uses the Cloudflare Managed Free Ruleset and does not need to do anything. Pro, Business and Enterprise plans should confirm that the Cloudflare Managed Ruleset is in block mode. The rules are named "PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619)", numbered 1 to 7. That makes it the quickest protection available if you cannot touch the server today, because it works from outside it.
To use it:
- Create a Cloudflare account and add your domain on the Free plan.
- Check the DNS records Cloudflare imports against your current ones before you switch, especially the mail records (MX, SPF and DKIM). A missing record can break email.
- Change the nameservers for your domain to the two Cloudflare gives you, at your registrar or host. It can take from a few minutes to a few hours to take effect.
- Make sure the website records are proxied. The A, AAAA or CNAME records for the site should show the orange cloud. A record set to DNS only is not filtered.
- Set SSL/TLS to Full (strict) if your server has a valid certificate, which avoids redirect loops.
- Check the firewall settings. Free plan rules apply automatically. On paid plans, confirm that the Cloudflare Managed Ruleset is on and that no override changes the action from block. Menu names in the dashboard change from time to time. Afterward, open Security Analytics, look at Events, and filter by the rule names to see blocked requests.
Know the limits before you rely on it:
- It is a filter, not a fix. Rules match known attack patterns, and attackers change their requests. Cloudflare itself says to patch.
- Going around it still works. Anyone who can reach your server's IP address directly skips Cloudflare. Where your host allows it, accept web traffic only from Cloudflare's address ranges.
- It covers web traffic only. Other ways into the server are not affected by it.
- It is a real change to your setup. Moving DNS affects email and other services, so do it carefully and not in the middle of a busy day.
Other web application firewalls, and some hosting providers, have published rules for these flaws as well. If you already use one, ask the provider whether the rules are on.
What this means for WordPress and other CMS sites
The flaw is in PHP, not in WordPress, so WordPress core, plugin and theme updates do not fix it. Security plugins that run inside WordPress cannot stop an attack that lands before any application code has run, which is the concern with mod_php. Do both jobs: update PHP on the server, and keep WordPress, plugins and themes current as usual. Our post on website maintenance costs lists what a care plan should include, and this is the kind of event it exists for.
A third PHP issue: CVE-2026-115560
On October 23, PHP published a short advisory for a third issue, CVE-2026-115560, in its session upload progress feature. It is separate from PHP2Shell, and the October releases do not fix it: Cloudflare says it affects fully patched releases, including 8.5.12. It only matters for applications set up in an unusual way. An application has to set session.serialize_handler to php_binary or php_serialize in its configuration, switch it to php while running, with ini_set(), before starting the session, and leave session upload progress on.
PHP is treating it as a routine fix, not an emergency, and has not published the affected versions or a severity score. It recommends setting session.upload_progress.enabled to 0 until its next regular release; if you already did that for the second flaw, you need nothing more. No exploitation of this issue has been reported. Cloudflare says its rule number 6 covers it when your site uses PHP's default upload progress field name, and does not cover sites that changed session.upload_progress.name.
Until the full advisory arrives with PHP's next release, check php.net and your host's status page, and apply PHP updates promptly in future instead of waiting for a maintenance window. When we re-checked on November 5, php.net still listed 8.5.12, 8.4.27, 8.3.36 and 8.2.35 as the current releases and described CVE-2026-115560 as an "unlikely RCE vector", still with no fixed version.
One related change for Windows servers: on October 26, PHP reissued its Windows builds as 8.5.12-1, 8.4.27-1, 8.3.36-1 and 8.2.35-1 with an updated Brotli library, which fixes a separate flaw in that library, CVE-2026-111497. The PHP source releases and runtime versions did not change. If you run PHP on Windows, install the rebuild.
If you would like help checking your PHP version, updating it safely or looking for signs of a break-in, our website development team can help, and you can reach us through the contact page.
Sources
- CISA alert: critical vulnerabilities in PHP require immediate patching (October 21, revised October 23)
- PHP 8 changelog on php.net: the fixed releases and advisory IDs
- Rapid7 analysis: how the flaws work and the configuration limits
- watchTowr FAQ: affected versions and exploitation reports
- Cloudflare's post on its protection: plans covered, rules and the third issue
- Cloudflare WAF changelog: the emergency rules
- The Hacker News: the conditions for CVE-2026-115560
- PHP.net news: the October 23 informational advisory on session upload progress and the October 26 Windows rebuilds
Last checked: November 5, 2026.
Frequently asked questions
Is my WordPress site affected by PHP2Shell?
If it runs on a vulnerable PHP version, yes, because the flaw is in PHP and not in WordPress. Updating WordPress, plugins or themes does not fix it. Update PHP on your server, or ask your host to confirm that the patched build is installed.
Which PHP version should I upgrade to?
Any fixed release: 8.5.12, 8.4.27, 8.3.36 or 8.2.35 or later. Choose the newest branch your site supports, because PHP 8.2 stops receiving security fixes on December 31, 2026.
Does Cloudflare protect me from PHP2Shell?
Partly. Cloudflare added firewall rules for these flaws, including on the Free plan, and they apply once your site is proxied through Cloudflare. It is a filter and not a fix, so you still need to update PHP.
How do I know if my site has been hacked?
Look for new or changed PHP files in upload folders, admin users you do not recognize, unexpected scheduled tasks, spam pages and PHP processes starting shells. No scan can prove a site is clean, so if in doubt, restore from a known good backup and change your credentials.
Do the October PHP updates fix everything?
They fix the two PHP2Shell flaws. A third issue, CVE-2026-115560, was disclosed on October 23 and is not fixed in them. It affects only applications configured in an unusual way, and PHP recommends setting session.upload_progress.enabled to 0 until its next regular release.