PHP2Shell: Critical PHP Flaws Allow Remote Code Execution

Two critical PHP core flaws rated CVSS 9.2 leaked early, forcing an emergency patch today. What is affected and what to do.

By Vivek • • 9 Min Read • 0 • Follow on Google News Add to Preferred Source
PHP2Shell vulnerability

PHP has patched PHP2Shell, two critical flaws that let an unauthenticated attacker run code on a PHP web server, and security vendors, Linux distributions and national cyber agencies are now racing to push fixes and stopgap protections to customers.

The bugs, CVE-2026-109618 and CVE-2026-109619, are rated 9.2 on the CVSS v4.0 scale and sit in PHP core, not in any one plugin, theme or framework. PHP released PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 on October 21, with its security advisory landing at about 12:59 UTC, an hour ahead of schedule, according to AlmaLinux. “There are no complete mitigations, updating is the only safe choice,” the PHP team wrote.

The flaws were found by researchers at Calif, Wiz and OpenAI, who used AI models to speed up both discovery and exploit development. The fix was due on October 22, but the disclosure was pulled forward after details leaked online on October 20.

What is PHP2Shell, and how does it work?

PHP2Shell is the name the researchers gave the pair: a crafted web request that ends with code running on the server. PHP’s advisory describes two separate memory-handling bugs.

  • CVE-2026-109618, RCE via out-of-memory corruption (GHSA-w8hw-w9fx-j79w): out-of-memory handling can interrupt PHP while internal request data is only partly set up, and request cleanup may then treat that invalid data as valid.
  • CVE-2026-109619, RCE via stale global state (GHSA-6wmf-4rv5-p3rp): internal state owned by one request can survive after its memory is freed, and a later request on the same worker may use it before it is reset.

In plain terms, an attacker can push PHP into running out of memory at exactly the wrong moment, leaving behind broken internal state that a later request then trusts. Both paths are reachable before any application code runs, so a fully patched WordPress or Laravel site is still exposed if the PHP underneath is not. Wiz says the bugs can also leak process memory, which may expose passwords, tokens and API keys. Affected code dates back to PHP 5.4, released in 2012.

Who discovered PHP2Shell?

Two teams found the bugs independently. Calif, working under OpenAI’s Patch the Planet initiative, made its first discovery on August 1 and reported it to PHP on August 11. It shared a working exploit on August 14, and PHP confirmed it the next day. Calif reported the second bug on August 21.

Wiz Research (Sagi Tzadik, Shir Tamari, Nir Ohfeld and Tomer Schwartz) found its first bug on August 19 and confirmed unauthenticated code execution against Drupal and WordPress within two days. It reported to PHP on August 24. OpenAI’s Codex Security team and Google’s Gemini team helped

Both teams credit AI with much of the speed. Wiz says it used its own Wiz Atlas plus Google’s Gemini 4 Argon and OpenAI’s GPT-5.6 Sol to adapt exploits across PHP versions and setups. The researchers say that cut months of specialist work to about a week for one person. Calif adds a caveat: “No model is simply capable of unearthing ‘all bugs’ with simple prompts.” Wiz calls the findings “among the most severe vulnerabilities discovered in PHP,” and runs a dedicated site.

Who is affected by PHP2Shell?

PHP says “all PHP installations serving web requests” are at risk: PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. It rates mod_php highest, with “a demonstrated exploit” triggered by a single unauthenticated request. Calif reported pre-authentication code execution on stock WordPress, Drupal, Joomla, MediaWiki, Roundcube, Magento, phpMyAdmin, Nextcloud, Laravel, Symfony and WHMCS.

PHP branchFixed versionFix source
8.58.5.12Official release
8.48.4.27Official release
8.38.3.36Official release
8.28.2.35Official release (branch ends December 31, 2026)
8.1, 8.0, 7.4No releasePHP security team source backports, or a distribution/LTS vendor
7.3 and older, 5.4+No fix from PHPVendor backport (e.g. Ubuntu Pro) or upgrade

The exposure is large. PHP runs on about 70% of websites whose server-side language is known, according to W3Techs. Mallory counted about 884,000 internet-facing hosts whose banners report PHP 8.1 or older, and VirusTotal estimates over 5.1 million exposed PHP hosts. These are estimates, not counts of confirmed vulnerable systems.

Which companies have released PHP2Shell advisories?

The response is one of the largest in years. The Dutch NCSC’s public tracker lists 635 PHP-dependent products from 430 suppliers that may be affected. Most are still under investigation; 31 entries had a vendor-confirmed fix or vulnerable status when we checked. The tables below list the organisations that have published advisories, patches or protections so far, grouped by type.

Upstream and researchers

OrganisationWhat it released
PHP security teamAdvisory; PHP 8.2.35, 8.3.36, 8.4.27, 8.5.12; source backports for 7.4, 8.0, 8.1; interim settings
CalifTechnical write-up, disclosure timeline, interim settings
WizResearch blog, php2shell.com, Threat Intel advisory, Wiz Sensor 1.0.12768 response policy
OpenAIPatch the Planet coordination post and a Codex skill to spot vulnerable PHP versions (per Precursor Security)
watchTowrFAQ; reproduced CVE-2026-109618 before release

Linux distributions and package sources

OrganisationWhat it released
Canonical (Ubuntu)USN-8948-1 and USN-8948-2; 22.04 to 26.10, and 14.04 to 20.04 via Ubuntu Pro ESM
DebianDSA-6574-1; trixie fixed in php8.4 8.4.27-1~deb13u1
Red HatRHSA-2026:87072; RHEL 9 php:8.2 module fixed in 8.2.35
AlmaLinuxPatches rolling out for AlmaLinux 8, 9 and 10 streams
Arch Linuxphp 8.5.12-1 in the Extra repository
Docker Official ImagesOfficial php images rebuilt on 8.2.35, 8.3.36, 8.4.27 and 8.5.12
Remi repositoryNo updates on October 21, per PHP

Hosting, control panels and platforms

OrganisationWhat it released
PleskAll shipped PHP affected; Linux 8.2 to 8.5 fixed; 7.4 to 8.1, Windows and sw-engine hotfixes pending
CloudLinux / TuxCareImunify360 ruleset 8.83 virtual patch; alt-php, ea-php and TuxCare ELS PHP confirmed affected, fixes in preparation
GoDaddyCustomer warning about data theft, defacement and full compromise (per Endor Labs)
Google App EngineStandard PHP 8.2+ runtimes patched automatically (per NCSC-NL)
NextcloudDeployments on affected PHP confirmed vulnerable; AIO container rebuild pending
FrankenPHPStatic builds embed affected PHP; rebuilds pending
BrefAWS Lambda PHP images confirmed affected; updates pending

CDN, WAF and cloud providers

OrganisationWhat it released
CloudflareWAF rules on by default for all plans, including Free, plus response-side blocking
FastlyNext-Gen WAF virtual patch; customers must apply it
ImpervaCloud WAF covered by default; on-premises WAF needs updates
Akamai, AWS, Google Cloud, MicrosoftNamed by Wiz as having prepared customer guidance and built-in mitigations

Security, detection and scanning vendors

OrganisationWhat it released
CrowdStrikeCustomer protection post for Falcon
DatadogWorkload Protection rule for PHP spawning shells, plus a hunt query
TenableFAQ and plugin IDs to find PHP installs
QualysQID 45110 to discover PHP servers
JFrogBoth CVEs in Xray and Catalog
Endor LabsCritical-severity analysis and upgrade guidance
HuntressDetection guidance; Sigma and YARA rules planned
CorelightZeek and Suricata detections (per Precursor Security)
SansecGuidance for Magento, Shopware and WooCommerce stores
PatchstackWordPress alert; claims active exploitation
AikidoAdvisory and compromise-check guidance
SOCRadarThreat intelligence brief
ZafranExposure guidance
IONIXAttack-surface exposure checks
HadrianVulnerability alert

Government and national CERTs

OrganisationWhat it released
UK NCSCUpdate now, or take systems offline until fixed
NCSC-NL (Netherlands)Operational repository tracking affected products; took its own site offline as a precaution
CERT-EUSecurity Advisory 2026-018: prepare to patch, isolate apps that cannot be patched
Australian Cyber Security CentreIdentify PHP systems, patch and monitor (per Endor Labs)

Some organisations went further. HR software firm BambooHR took its service offline in the US, Canada and Ireland as a precaution, and several Dutch government and education sites went dark, The Hacker News reported.

Is there a PHP2Shell PoC, and is it being exploited?

More than 100 PHP2Shell-related repositories appeared on GitHub after disclosure, including claimed exploits, Docker labs and detection rules, according to Precursor Security’s live blog. Tenable said it could not verify that any circulating PoC works, and warns that unverified exploit code may carry malware. The researchers’ own working exploits have not been released.

Cloudflare says it saw attack traffic before disclosure and watched attackers change payloads to slip past its first rules. Patchstack claims active exploitation but has published no evidence. No successful break-in had been publicly confirmed, the Dutch NCSC reported no abuse, and neither flaw was in CISA’s Known Exploited Vulnerabilities catalog at the time of writing. With the advisories now public, that could change quickly.

What should you do now?

  1. Update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or install your distribution’s patched package. Then restart PHP-FPM, Apache and any long-running PHP workers, or the old code keeps running.
  2. Inventory every PHP install, including copies inside cPanel, Plesk, Docker images, FrankenPHP builds, vendor appliances and Windows software. On shared hosting, ask your host when the patched build is live.
  3. On PHP 8.1, 8.0 or 7.4, use a vendor backport or PHP’s source backports as a bridge, and plan an upgrade to a supported branch.
  4. If you cannot update yet, apply PHP’s interim settings and restart every worker. These “do not make an installation safe,” PHP says.
  5. If you can do neither, follow the UK NCSC and CERT-EU advice: take the system offline or isolate it until it is fixed. A WAF from Cloudflare, Fastly, Imperva or Imunify360 buys time but does not fix PHP.

PHP’s interim settings, from the official advisory:

  • For CVE-2026-109618: set memory_limit=-1 in a way applications cannot override, such as php_admin_value; set a low post_max_size (8M without uploads, 32M with them); and enforce request-size limits at the web server or proxy. Calif warns that removing the memory cap raises the risk of the server running out of memory.
  • For CVE-2026-109619: set session.upload_progress.enabled=0 in php.ini or the FPM pool, not via ini_set() or .user.ini. On PHP 8.5, also set fatal_error_backtraces=0. PHP says this blocks the confirmed session paths, but not other variants.

Then hunt for earlier compromise. Wiz suggests watching for unusual multipart requests followed by memory-limit errors, repeated HTTP 500 responses, unusually large or malformed PHPSESSID cookies, and unexplained PHP worker churn. Also check for web shells, new files in the web root, new cron jobs, new admin accounts and PHP workers spawning shells or tools like curl and wget. On Linux hosts without endpoint monitoring, Florian Roth’s free process-watcher can help.

Updates

2026-10-21, 17:35 UTC: Expanded the advisory list to 42 organisations in six groups, added the Dutch NCSC product tracker (635 products, 430 suppliers), and added fixes from Debian, Red Hat, Arch Linux, Docker and Google App Engine.

2026-10-21, 16:50 UTC: Added discovery credits and timelines from Calif and Wiz, a table of vendor and government advisories, GitHub PoC activity, Wiz’s detection signs and precautionary shutdowns. Corrected the release time to about 12:59 UTC.

2026-10-21, 13:45 UTC: PHP published its advisory and fixed releases. Added official root causes, affected server setups, source backports and interim mitigations.

2026-10-21, 11:35 UTC: Published ahead of the PHP release.

Community Discussion

Join the conversation. Ask questions, share solutions, and help others.

0 Comments

Be the first to start the discussion!

Leave a Comment

Your email address will not be published. Required fields are marked *

We respect your privacy, your information is safe with us.

Latest Articles

View all