PHP2Shell (CVE-2026-109618 and CVE-2026-109619): how to check and fix your PHP today
Two critical flaws in PHP itself allow unauthenticated code execution on any site running an affected build, WordPress included. What changed on October 21, 2026, and the steps we take on every server.

In one paragraph: PHP2Shell is the name given to two critical flaws in PHP itself, CVE-2026-109618 and CVE-2026-109619, both rated 9.2 on CVSS v4.0. An attacker with no login can get code running on the server through a plain HTTP request, before WordPress, Laravel or any other application code is involved. The fix is PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, released on October 21, 2026. Check the version that actually serves your site (not only the one on the command line), update it, restart the PHP workers, and look for files that appeared since October 20.
Last updated: October 21, 2026, 21:30 UTC. We will update this page as hosting vendors ship patched builds.
What is PHP2Shell
PHP2Shell is a pair of memory safety bugs in the PHP engine that the PHP security team fixed in an emergency release. They are not a WordPress or plugin vulnerability. Any site running an affected PHP build is exposed, whatever it runs on top of PHP.
| CVE-2026-109618 | CVE-2026-109619 | |
|---|---|---|
| Type | Remote code execution through out-of-memory corruption | Remote code execution through stale request state (use after free) |
| Severity | Critical, CVSS v4.0 9.2 | Critical, CVSS v4.0 9.2 |
| Login needed | No | No |
| What goes wrong | PHP runs out of memory while request data is half built, and cleanup treats that data as valid | Memory owned by one request is freed but still referenced, and the next request on the same worker uses it. It can also leak memory contents |
| Advisory | GHSA-w8hw-w9fx-j79w | GHSA-6wmf-4rv5-p3rp |
The PHP project says every installation that serves web requests is at risk: PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. The risk is highest with mod_php, where a working exploit fires before any application code runs. Researchers at Calif and Wiz reported unauthenticated code execution against WordPress, Drupal, Joomla and Magento, and Wiz also showed a path that leaks memory, which can include passwords, tokens and API keys.
Which PHP versions are affected and which are fixed
| Branch | Fixed in | Notes |
|---|---|---|
| PHP 8.5 | 8.5.12 | Official release |
| PHP 8.4 | 8.4.27 | Official release |
| PHP 8.3 | 8.3.36 | Official release |
| PHP 8.2 | 8.2.35 | Official release. The branch reaches end of life on December 31, 2026 |
| PHP 7.4, 8.0, 8.1 | No official release | The PHP team published minimal source patches. Linux distributions and vendors such as CloudLinux ship their own builds |
| PHP 5.4 to 7.3 | No fix from the PHP project | Upgrade, or take the site off the public internet |
Linux distributions often backport the fix and keep the old version number, so on a Debian, Ubuntu or RHEL server the vendor’s security tracker is the reference, not the number alone.
Timeline
- October 20, 2026: the CVE numbers leaked on Hacker News and social media. The PHP team announced a security release and moved it forward from October 22.
- October 21, 2026: PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 published with the advisory.
- October 21, afternoon: Calif and Wiz published technical write-ups. Cloudflare reported early attacks and deployed WAF rules. watchTowr reported exploitation attempts in its honeypots. Huntress had not yet seen exploitation on its partners’ systems.
How to check the PHP version that really serves your site
This is where most people get it wrong. On cPanel and other shared hosts, the php command in the terminal is often a different build from the one that runs the site. On a server we look after, the terminal reported one version while the site ran through a separate alt-php handler set in .htaccess. Check the web side:
- Create a temporary file in the site root with a random name, for example
v-8f3k2.php:<?php echo PHP_VERSION, ' | ', php_sapi_name(), ' | upload_progress=', var_export( (bool) ini_get( 'session.upload_progress.enabled' ), true ); - Open it in the browser, write down the result and delete the file right away.
- In WordPress, Tools, Site Health, Info, Server shows the same PHP version without creating any file.
- On a server you manage, check every build that serves sites, not only the default one:
for b in /opt/cpanel/ea-php*/root/usr/bin/php /opt/alt/php*/usr/bin/php; do [ -x "$b" ] && echo "$b $($b -r 'echo PHP_VERSION;')" done
How to fix it
On a server you manage
- Update through your package manager or panel:
dnf updateorapt upgradefor distribution packages,yum update 'alt-php*'for CloudLinux alt-php, and EasyApache updates for cPanel ea-php once the packages are out. - Restart PHP. Workers that are already running keep the old code in memory: restart PHP-FPM, Apache or LiteSpeed (or kill the lsphp processes) after updating.
- Run the version check again through the browser, for every PHP version that serves a site.
On shared hosting
You cannot update PHP yourself. Open a ticket asking whether the build behind your site already has the fix for CVE-2026-109618 and CVE-2026-109619. If the panel offers several versions, a version number is not proof by itself: on the evening of October 21, CloudLinux still listed its alt-php 8.2 to 8.5 builds as in testing, and cPanel ea-php packages had not been published yet.
If you cannot update today
The PHP team lists interim measures and is clear that they do not make a server safe. Updating is the only complete fix.
- CVE-2026-109619: set
session.upload_progress.enabled = 0inphp.ini, in the FPM pool or in the server configuration, and restart every worker. Do not rely onini_set()or a.user.ini, since they apply too late. On PHP 8.5, also setfatal_error_backtraces = 0. Few sites use upload progress bars built on this feature, so the side effect is usually nil. - CVE-2026-109618: the advisory suggests
memory_limit = -1in a way applications cannot override, withpost_max_sizeat 8M (32M if the site needs uploads), and says not to useRLIMIT_ASorRLIMIT_DATA. An unlimited memory limit lets a runaway script take the server’s RAM, so do this only with a container or cgroup limit around PHP, and revert it after updating. - WAF: Cloudflare deployed rules for the known vectors, and Imunify360 ruleset 8.83 blocks the public exploit on Apache and Nginx. On LiteSpeed, that Imunify360 rule only logs. Both are a stopgap, and the Cloudflare rules only protect traffic that actually goes through Cloudflare.
- Confirm with the test file above that
upload_progressnow readsfalseon the web side.
Signs your site was already hit
No confirmed indicators had been published at the time of writing. What attackers do after getting code execution on a PHP site is well known, and it is what we found in every cleanup this month:
- PHP files created or changed since October 20:
find ~/public_html -name '*.php' -newermt '2026-10-20' -printf '%TY-%Tm-%Td %TH:%TM %pn' | sort - PHP files in
wp-content/uploadsorwp-content/upgrade, and folders with random names three levels deep. - Administrators nobody recognises, new cron jobs, and
.htaccessfiles that suddenly allow PHP in folders that never had it. - On servers with process monitoring: PHP workers (php-fpm, lsphp, httpd) starting
sh,bash,curl,wgetornc.
Because of the memory leak in CVE-2026-109619, a site that ran an unpatched build after October 20 should also change its database password, salts and API keys once it is updated.
Checklist
- Find the PHP version that serves each site, through the web, not the terminal.
- Update to 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or the vendor build with the backport.
- Restart PHP-FPM, Apache or LiteSpeed so workers load the new build.
- If the update has to wait:
session.upload_progress.enabled = 0at server level plus a WAF rule. - Look for new PHP files, unknown admins and cron jobs since October 20.
- Rotate database passwords, salts and API keys after updating.
- Plan to leave PHP 8.2 and older before December 31, 2026.
Questions we get about this
Is my WordPress site affected by PHP2Shell?
If it runs on a PHP version earlier than 8.5.12, 8.4.27, 8.3.36 or 8.2.35 without a vendor backport, yes. The flaw is in PHP, so updating WordPress, plugins or the theme does not fix it. Researchers confirmed unauthenticated code execution against WordPress.
Does updating WordPress or using a security plugin protect me?
No. The attack can run before WordPress loads, so a security plugin never sees it. Only an updated PHP build fixes it, and a WAF in front of the site reduces the risk while you wait.
Am I protected because my site uses Cloudflare?
Partly. Cloudflare deployed WAF rules for the known attack vectors, but they only cover requests that pass through Cloudflare and new variants can get around them. Anyone who finds the server’s real IP address can reach it directly.
My host says the site runs PHP 8.2.34. Is that vulnerable?
The upstream fix for the 8.2 branch is 8.2.35, so 8.2.34 is vulnerable unless your host’s build carries a backported patch. Ask the host to confirm the fix for both CVE numbers in writing.
Is there a fix for PHP 7.4 or PHP 5?
The PHP team published source patches for 7.4, 8.0 and 8.1, which only help if you or your vendor compile PHP. Versions 5.4 to 7.3 get nothing. In practice the answer is to move the site to a supported PHP version.