Jason Burns / jasonburns.co.uk
Available - taking new work Contact

PHP2Shell: how to patch PHP, fixed versions and steps

PHP2Shell (CVE-2026-109618, CVE-2026-109619): fixed PHP versions and how to patch each host. On CISA's exploited list since 26 October. Status 4 November.

Key takeaways

  • PHP2Shell is the name for two critical PHP vulnerabilities that can let an attacker run their own code on your server without logging in. PHP rates both 9.2 out of 10 on CVSS v4.0. Both are on the US exploited list.
  • The fix is PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, released on 21 October 2026. Updating WordPress or your plugins does not fix it.
  • After updating, PHP has to be restarted properly. On Apache with mod_php, a graceful reload leaves the old PHP running.
  • PHP 8.1 and older get no official release. Fixes come from your vendor (Ubuntu, Debian, cPanel, CloudLinux, Plesk and others) or from a source backport.
  • Keep session.upload_progress.enabled=0 after patching. A third issue, CVE-2026-115560, has no fix until PHP's next release.
Updated What changed on

Fact-checked On 4 November 2026 I re-read the PHP releases and ChangeLog, the CISA catalogue, the Ubuntu, Debian, Red Hat, Rocky Linux, AlmaLinux and Alpine notices, Docker Hub, FrankenPHP, Palo Alto, Censys, cPanel, Plesk, CloudLinux, Forge, Zend, Freexian, the hosts named below and the WAF vendors, each by two routes. Not checked by two routes: NCSC-NL (its GitHub repo and README, both through Firecrawl), Sophos (its page times out on a direct fetch), TuxCare (403 to automated fetches) and Imunify360 (403 to direct fetches, so the post and its feed were both read through Firecrawl). I did not check the AlmaLinux errata pages. This site's own server was checked read-only on 4 November: PHP 8.4.27.

  • Re-checked the facts on 4 November. No newer PHP release exists, and both PHP2Shell CVEs are still on the CISA list. The SimpleXML crash fix is in PHP's code (22 October) but in no release yet.
  • CVE-2026-115560 is still not on the CISA list in its 3 November catalogue. Censys now shows 29,311,837 services on an affected version and 13,847,743 moved to a fixed one.
  • Rocky Linux's errata now checked: fixes for Rocky 8, 9 and 10 were published on 22 October, with none listed for php:8.4 on Rocky 9.
  • Added a picture of the fixed versions at the top, a diagram of where the bug sits on a request, a timeline of events, and a chart of what Censys sees by fix status.

Status at 11:45 UK time, 4 November 2026. Both PHP2Shell CVEs have been on the US CISA list of exploited vulnerabilities since 26 October. A third, narrower issue (CVE-2026-115560) was announced on 23 October and has only a settings stopgap. No newer PHP release exists. PHP 8.4.27 and 8.5.12 have a SimpleXML crash bug, fixed in PHP's code but not yet in a release. Need it done for you? Tell me which site.

PHP2Shell: the fixed PHP versions. Released 21 October 2026. Both flaws are on the CISA exploited list. PHP 8.5: 8.5.12. PHP 8.4: 8.4.27. PHP 8.3: 8.3.36. PHP 8.2: 8.2.35. 8.1 and older: No official fix. Check yours: php -v. That shows the command-line PHP. Your site may run another one. Sources: php.net, 21 October 2026; CISA exploited list, 26 October 2026.
The fixed versions, released on 21 October 2026. Sources: php.net news archive and the CISA catalogue, read 4 November 2026. The same list is in the table under "Which version fixes PHP2Shell".

Also this month: NGINX. A week before PHP2Shell, NGINX fixed five vulnerabilities of its own. F5, which owns NGINX, rates three of them 9.2 out of 10. NGINX is the web server in front of PHP on many sites, so a typical server needs both updates. Read the NGINX post, updated on 4 November: who is exposed and how to patch.

Also this month: Rank Math PRO. Some copies of the Rank Math PRO WordPress plugin, version 3.0.123, carried malware between 15 and 16 October. The free plugin is not affected. Check whether your site is affected and what to do.

On 21 October 2026 the PHP team released emergency updates for two critical vulnerabilities in PHP itself. Researchers call them PHP2Shell. They are tracked as CVE-2026-109618 and CVE-2026-109619, and PHP rates both 9.2 out of 10.

In plain terms: someone can send your web server a specially built request and run their own code on it. The standard name for that is remote code execution. They do not need a login.

PHP's own advisory says the risk is highest for Apache with mod_php, where a demonstrated exploit fires "before any application code runs". So your WordPress security plugin never gets a look at the request.

PHP runs most of the web. Cloudflare puts it at almost 70% of websites, including WordPress, WooCommerce, Laravel, Drupal, Joomla and Magento.

  1. VisitorSends itOne specially built request. No login needed
  2. Web serverPasses it onApache, NGINX or LiteSpeed. A firewall rule here blocks known patterns, not the bug
  3. PHPThe flawA request that ends badly leaves PHP's memory broken. With Apache and mod_php it can fire before any application code runs
  4. Your siteYour codeWordPress or Laravel code, its plugins and the database. With mod_php they run after the flaw
Where PHP2Shell sits on a typical request. Source: PHP's own advisory on php.net (21 October 2026), read 4 November 2026.

What happened, in order#

  1. Details of the two vulnerabilities leaked online before the planned disclosure. The same day, the PHP team announced an emergency release for 21 October.
  2. CERT-EU and the UK's National Cyber Security Centre (NCSC) published warnings. The NCSC said that if you cannot mitigate, you should "consider taking the system offline".
  3. PHP released 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Cloudflare reported attack traffic and attackers changing payloads to get past its rules.
  4. PHP announced a third issue, CVE-2026-115560. CERT-EU updated its advisory to say there will be no emergency release for it.
  5. A researcher, Adel Karimi, recorded working shell commands on honeypots (decoy servers set up to catch attackers).
  6. CISA added both CVEs to its Known Exploited Vulnerabilities list. PHP also rebuilt its Windows packages (8.5.12-1, 8.4.27-1, 8.3.36-1, 8.2.35-1) for an unrelated bug in a bundled library.
  7. Dream reported 25 servers taken over with PHP2Shell, including Palo Alto firewalls (updated 29 October).

What the two vulnerabilities are#

Both come from the same root problem. When a PHP request ends badly, PHP can leave its memory in a broken state.

Vulnerability What goes wrong
CVE-2026-109618 PHP runs out of memory while some internal request data is only half set up. The clean-up code then treats that half-built data as valid.
CVE-2026-109619 Internal state from one request survives after its memory has been freed (a use-after-free bug). The next request handled by the same PHP worker can use it before PHP resets it.

PHP lists every setup that serves web requests as at risk: PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. Red Hat says remote code execution is "difficult in practice" on its standard PHP-FPM installs. Do not read that as safe.

The third issue: CVE-2026-115560#

This one is narrower. It only applies when two things are true:

  • Upload progress is on. It is on by default. It is a feature that lets a page track how far a file upload has got, for a progress bar.
  • The application switches the session format at runtime. It sets the format to php_binary or php_serialize, then changes it to php with ini_set() before session_start().

It affects fully patched releases, including 8.5.12. PHP will fix it in its next regular release. NCSC-NL gives the same advice as below.

The Cloudflare rule for it only covers PHP's default field name. A site that renamed the upload progress field is not covered. CVE-2026-115560 is not in CISA's exploited list catalogue of 3 November.

Is PHP2Shell being exploited?#

Yes. Most of what is recorded is scanning and failed attempts, but there are confirmed break-ins.

  • CISA lists both CVEs as exploited since 26 October.
  • Firewalls. On 26 October Dream reported 25 servers taken over by chaining PHP2Shell with a Linux kernel bug, including Palo Alto PAN-OS firewalls and systems in a US government-linked network. Palo Alto confirms active exploitation of PAN-OS management pages exposed to the internet.
  • Honeypot shells. On 24 October, Adel Karimi recorded 35 shell executions across three honeypots from two IP addresses. They ran PHP 8.4.26 on Apache with mod_php and a single worker. Wiz calls that a favourable setup, so it does not prove an ordinary site would fall.
  • Wiz (27 October) had not seen successful end-to-end exploitation in its own data. It saw failed attempts from the same two addresses that hit the honeypot (listed in the checks below).
  • CrowdSec recorded 10,073 matching attempts from 1,187 IP addresses between 21 and 25 October. Attempts, not compromises.
  • Wordfence counted about 77,600 related requests from over 2,000 IP addresses between 23 and 27 October, and knew of no compromised WordPress site on 28 October.

A public research repository called php2shell exists. I am not linking it.

Which version fixes PHP2Shell#

Start with an inventory of every PHP runtime you run, including staging sites and old projects. Then match each one:

You run Update to
PHP 8.5 8.5.12
PHP 8.4 8.4.27
PHP 8.3 8.3.36
PHP 8.2 8.2.35. PHP 8.2 reaches end of life on 31 December 2026.
PHP 8.1, 8.0, 7.x or 5.x No official release. Use a vendor build or a source backport, or move to a supported version.

Three traps here.

1. The command line may not be your site's PHP. A server can have three PHP versions installed. php -v in a terminal tells you about the command-line one. Your website may run a different one through PHP-FPM or mod_php. Check the one that serves the site.

2. Linux distributions patch their own older builds. Ubuntu's notice (USN-8948-1) fixes Ubuntu 24.04's PHP 8.3 as package 8.3.6-0ubuntu0.24.04.13. That build is patched even though php -v still says 8.3.6. Go by your vendor's notice, not by the version number alone.

3. PHP 8.4.27 and 8.5.12 have a SimpleXML crash bug. Some SimpleXML code can crash PHP during garbage collection ("zend_mm_heap corrupted"), for example after get_object_vars() on the object. The fix went into PHP's code on 22 October but is in no release yet (php-src issue GH-24488).

Do not go back to the vulnerable versions. Patch, test your SimpleXML code, and watch for worker crashes.

For PHP 8.1 and older, the PHP security team supplied minimal source backports for 7.4, 8.0 and 8.1, for people who build from source. Everyone else should use a vendor build: Ubuntu, Debian (including Debian LTS), Freexian, Red Hat, cPanel, CloudLinux, Plesk, TuxCare and Zend all ship fixes for old branches. Moving to 8.3 or newer is the lasting answer.

How many sites are still exposed? At 10:15 UTC on 4 November 2026 the Censys live tracker showed 29,311,837 PHP services still reporting an affected version. It showed 13,847,743 that had moved to a fixed one since 21 October.

That counts services that report a version, not confirmed unpatched sites. Distributions backport fixes without changing the number, and 62% of detected PHP services hide theirs. The chart below counts differently: every service seen in the last nine days that reports a version, including those that were never on an affected one.

Affected, PHP 8.1 or older
Services
24m services affected on PHP 8.1 or older, no official fix
On a fixed version
Services
16m services on a fixed version
Affected, fix available
Services
5.1m services affected on a branch with a fix available
PHP services seen in the last nine days that report their version, 46 million in total, with Censys's own rounding. Bars are scaled to 50 million. Source: Censys PHP2Shell tracker, 4 November 2026, 10:15 UTC. The figures move, and the count excludes the 62% that hide their version.

Most affected services are on PHP 8.1 or older, where no official fix exists.

If you cannot patch today#

PHP is clear that only the update fixes this. These settings from its advisory reduce exposure to the known attack paths. They do not make the server safe.

  • Set session.upload_progress.enabled=0 in php.ini or the FPM pool config, then restart every PHP worker. A .user.ini file or ini_set() is not enough. This setting also covers the third issue, so keep it after you patch.
  • Set memory_limit=-1 in a way the site cannot override, such as php_admin_value in the FPM pool. Then check nothing else sets a limit again.
  • Set a low post_max_size: 8M if the site takes no file uploads, 32M if it does. Keep upload_max_filesize below it.
  • On PHP 8.5 only, set fatal_error_backtraces=0 and restart the workers.
  • If you use Cloudflare, keep the WAF on (see the firewall section below).

If none of that is possible, the NCSC says to consider taking the site offline until it is fixed. CISA goes further: if you cannot update, or you are on PHP 8.1 or older, take the site offline until it is patched.

How to patch PHP on your hosting#

Shared hosting (cPanel, Plesk, most UK web hosts)#

You cannot update PHP yourself on shared hosting. Your host does it. Your job is to check two things and get one answer in writing.

  1. In your control panel, find the PHP version for each site. In cPanel this is the "MultiPHP Manager" page. Other panels have a similar PHP settings page.
  2. If any site is on PHP 8.1 or older, move it to 8.2 or newer. Test the site afterwards, because old plugins can break on newer PHP.
  3. Ask your host: "Has the PHP my site uses been patched for CVE-2026-109618 and CVE-2026-109619, and when?"

cPanel and WHM servers#

EasyApache 4 release 25.91 shipped on 21 October. It carries upgrades for ea-php82 to ea-php85, and backports for ea-php74, ea-php80 and ea-php81. cPanel's security article lists the patched builds as ea-php74 7.4.33-19, ea-php80 8.0.30-12 and ea-php81 8.1.34-5. CloudLinux put fixed alt-php builds for 5.2 to 8.5 into its stable repositories by 00:07 UTC on 22 October.

If you run the server: update through EasyApache 4 in WHM, restart Apache, PHP-FPM or LSAPI, and check every PHP version your sites use.

Plesk servers#

Plesk lists fixes for PHP 8.2 to 8.5, and backports for 8.1.34, 8.0.30 and 7.4.33 built on 21 October. The panel's own PHP (sw-engine) is fixed in Plesk Obsidian 18.0.80 Update 11 and 18.0.81 Update 4.

Managed WordPress hosting (GoDaddy, WP Engine, Kinsta, SiteGround, Cloudways, Hostinger)#

Managed hosts update PHP for you, and they say they have. These are each host's own statements, not something I tested:

  • Kinsta: all environments covered by 22 October, no evidence of successful breaches.
  • SiteGround: official fixes applied on 21 October.
  • GoDaddy: Managed WordPress on 21 October, Web Hosting on 22 October. VPS owners update themselves.
  • WP Engine: says all customer sites run fully patched PHP.
  • Cloudways: rollout complete on 22 October.
  • Hostinger: complete on 22 October for every plan except VPS.

Still ask your host to confirm in writing.

Laravel Forge#

Forge says its automatic security updates do not patch PHP. To patch:

  1. Open the server dashboard and click the PHP tab.
  2. Open the menu next to an installed version and click Update PHP X.X.
  3. Repeat for every installed version.

Each update restarts PHP-FPM for that version.

Your own Ubuntu or Debian server#

Update every PHP package, then restart PHP-FPM:

# see what is installed
dpkg -l 'php*' | awk '/^ii/ {print $2, $3}'

# update (example for PHP 8.3)
sudo apt update
sudo apt install --only-upgrade 'php8.3*'
sudo systemctl restart php8.3-fpm

Ubuntu's fixed packages (USN-8948-1): 26.04 php8.5 8.5.4-0ubuntu1.5, 24.04 php8.3 8.3.6-0ubuntu0.24.04.13, 22.04 php8.1 8.1.2-1ubuntu2.28. Ubuntu 20.04 and older need Ubuntu Pro (USN-8948-2).

Debian 13 (trixie) is fixed in DSA-6574-1 as php8.4 8.4.27-1~deb13u1. Debian 12 (bookworm) is fixed through Debian LTS (DLA-4848-1) as php8.2 8.2.35-1~deb12u1. Make sure the security repository is enabled.

If your PHP comes from a third-party repository, check that repository's notice, and confirm php-fpm8.x -v shows the fixed version.

RHEL, AlmaLinux and Rocky#

Run sudo dnf update 'php*', then sudo systemctl restart php-fpm. Red Hat shipped fixes on 21 October for RHEL 10, RHEL 9 (php:8.2, php:8.3) and RHEL 8.

On 4 November Red Hat's data still lists RHEL 9 php:8.4 as affected with no fix, so check its notice if you run that stream. AlmaLinux says patched packages for every stream were live on 21 October. Rocky Linux's errata list fixes published on 22 October: Rocky 10 (php, php8.4), Rocky 9 (php, php:8.2, php:8.3) and Rocky 8 (php:8.2, php:7.4). I found no php:8.4 fix for Rocky 9, the same gap as Red Hat's. I did not check the AlmaLinux errata pages.

Alpine and Docker#

Alpine 3.23 and 3.24 fix this in php83 8.3.36-r0, php84 8.4.27-r0 and php85 8.5.12-r0. Alpine 3.22 also fixes php83 and php84 at the same versions, plus php82 8.2.35-r0. Alpine 3.21 has php82 8.2.35-r0.

Official php Docker images for 8.2.35 to 8.5.12 were rebuilt by 31 October. The 8.1 tags were last rebuilt on 2 January 2026, so they are not fixed.

Pull the new image, rebuild your own images with docker build --pull, then recreate the containers. Restarting an old container leaves the old PHP in it. Run php -v inside the new container to check.

Restart PHP properly#

This is the step people miss. A running PHP process keeps the old, vulnerable code in memory until it restarts. This table is based on Mattias Geniar's guide of 21 October, which says every command was tested in containers:

How PHP runs What to do after updating
PHP-FPM (nginx, Caddy, or Apache with proxy_fcgi) systemctl restart php8.x-fpm. A reload also works.
Apache with mod_php Full systemctl restart apache2 (or httpd). A graceful reload leaves the old PHP running.
LiteSpeed or OpenLiteSpeed Update the lsphp packages, then pkill lsphp. Restarting LiteSpeed alone does not restart PHP.
FrankenPHP Install FrankenPHP 1.13.2 or later. 1.13.4 (26 October) is the newest and also fixes FrankenPHP's own security bugs. PHP is built in, so apt and dnf do not fix it.
Queue workers, Octane, Supervisor jobs Restart them too.

Then check the site's PHP version from the web side, not the command line. A one-line phpinfo() file works. Delete it as soon as you have read it.

Firewall rules help, but do not fix it#

A web application firewall (WAF) blocks known attack patterns. It does not remove the bug.

  • Cloudflare: managed rules have covered free and paid plans since 03:02 UTC on 21 October. Ruleset IDs: free 77454fe2d30c4220b5701f6fdfb893ba, paid efb7b8c949ac4650a09736fc376e9aee. On paid plans, check the Managed Ruleset is in block mode. Rule #6 also covers the third issue, but only with PHP's default upload progress field name.
  • AWS WAF: AWSManagedRulesPHPRuleSet added PHP2Shell rules in version 2.3 (21 October), then 2.4 and 2.5.
  • Imunify360: ruleset 8.88 (23 October) added rule 77049357. Imunify360 says no rule blocks the out-of-memory path of CVE-2026-109618 yet.

After patching: check nobody got in first#

Patching stops new attacks. It does not remove anything an attacker already left behind. A compromised site stays compromised after patching.

Attacks were recorded within days, so check. These checks are leads. A clean result does not prove safety.

Logs

  • In the web server access log, look for bursts of POST requests with multipart/form-data from one address, especially to pages that take no uploads.
  • Search the logs for PHP_SESSION_UPLOAD_PROGRESS, PHP's default upload progress field name.
  • In the PHP error log, look for "Allowed memory size exhausted" errors and for worker crashes or restarts around the same times.

Processes and files

  • Check whether the web server user (www-data, apache, nginx or your pool user) has started a shell, curl or wget. In the honeypot report, Apache workers started the shells.
  • Look for PHP files in places that should only hold images, such as wp-content/uploads, and for new files in /tmp and /dev/shm.
  • Check for admin users you do not recognise, new cron jobs, and SSH keys in authorized_keys that you did not add.
  • Wiz named 15.204.59.70 and 162.35.99.94 on 27 October as scanners. Addresses change, so treat a match as a lead and no match as nothing.
  • If your site runs on NGINX, check that it has the October 2026 NGINX fixes too.

If anything looks wrong, change your database password, API keys and admin passwords, then get the site properly cleaned.

Get it done for you#

PHP security fix

I will patch your site and tell you plainly what I found.

  • Find which PHP version each of your sites really runs, not just the one on the command line.
  • Update it on your server, or chase your host until they confirm the fix in writing.
  • Restart PHP the right way for your setup, then check from the outside that the new version is live.
  • Turn on the stopgap settings if the update has to wait.
  • Move sites off PHP 8.1 or older and test that nothing breaks.
  • Check for signs of a break-in and send you a short written note of what was done.

This site runs on PHP too. Its server runs the fixed PHP 8.4.27, checked on 4 November. Tell me your site and who hosts it, and I will tell you what it needs and what it costs before I start.

Ask me to patch your site

Sources#

All checked on 4 November 2026 by two routes unless a line says otherwise. Read by one route only: NCSC-NL (repo and README, both through Firecrawl), Sophos and TuxCare (direct fetches time out or return 403) and Imunify360 (page and feed, both through Firecrawl).

Frequently asked

Is my WordPress site affected by PHP2Shell?
If it runs on unpatched PHP, assume yes. The vulnerability is in PHP itself, so it affects WordPress, WooCommerce, Laravel, Drupal, Magento and any other PHP site. Updating WordPress or plugins does not fix it. The server's PHP has to change. Most big hosts say they have patched shared and managed plans. VPS owners update their own.
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, all released on 21 October 2026. Linux distributions ship patched builds with older version numbers, so check your vendor's notice. 8.4.27 and 8.5.12 have a SimpleXML crash bug, fixed in code but not released. Do not go back to a vulnerable version.
I am on shared hosting. What do I need to do?
Your host updates PHP, not you. Check your site's PHP version in your control panel, move off PHP 8.1 or older, then ask your host in writing to confirm the fix for both CVEs.
Does Cloudflare protect me?
Partly. Cloudflare says its managed firewall rules are switched on automatically for every plan with the WAF, including Free, and that you still need to patch PHP. A firewall rule blocks known attack patterns. It does not remove the bug.
Is PHP2Shell being exploited?
Yes. Both CVEs are on the US CISA exploited list. On 26 October Dream reported 25 servers taken over with PHP2Shell, including Palo Alto firewalls. Most attempts seen by Wiz, CrowdSec and Wordfence failed, and Wordfence knew of no compromised WordPress site on 28 October. Patch now.
What is CVE-2026-115560?
A third PHP vulnerability, announced on 23 October. It only applies when upload progress is on and an application switches the session format at runtime. PHP will not issue an emergency release. Set session.upload_progress.enabled=0 and keep it after you patch.
Can you patch my site for me?
Yes. I check which PHP your site really runs, update it or get your host to, restart it properly, and check for signs that someone got in first. Use the contact form and pick PHP security fix.