PHP2Shell Was Found by AI First, and Attackers Moved Just as Fast

PHP shipped emergency releases on October 21, 2026 for PHP2Shell, two critical flaws that let an attacker run code on a web server without logging in. Researchers using AI models found them and reported them privately in August, so the discovery was proactive. Attackers still got there before the fix: Amazon logged an exploitation attempt four days before the public disclosure.

PHP2Shell Is Two Bugs in PHP Itself, Not in Any One App

PHP2Shell is the name for CVE-2026-109618 and CVE-2026-109619. Both sit in the PHP runtime, the layer underneath WordPress, Drupal, Joomla, Magento and most custom PHP code, so an application can be fully up to date and still be exposed. PHP's security team rates both 9.2 out of 10 under CVSS v4.0, and Wiz, one of the teams that found them, says PHP powers about 70 percent of websites.

The first bug is in out-of-memory handling. If PHP runs out of memory partway through setting up a request, cleanup code can later treat the half-built data as valid. The second is a use-after-free: internal state from one request can outlive the memory behind it, and the next request on the same worker uses it before it's reset. Both can lead to code execution without a login. On Apache's mod_php, which PHP's security advisory rates as the highest risk, the demonstrated exploit fires before any application code runs.

Detail What's known
CVEs CVE-2026-109618, RCE via out-of-memory corruption; CVE-2026-109619, RCE via stale global state
Severity 9.2 Critical under CVSS v4.0, as rated by PHP
Affected Nearly every PHP version back to 5.4
Server setups PHP-FPM, Apache mod_php, php-cgi, FrankenPHP and LiteSpeed
Fixed in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, released October 21, 2026 at 14:00 UTC
Older versions No official releases for 8.1 and earlier; PHP published source backports for 7.4, 8.0 and 8.1
Memory exposure Worker memory, which can hold passwords, tokens and API keys, can be read without full code execution

Defenders Found It First, With AI Doing Much of the Work

PHP2Shell was a proactive discovery. Security researchers found the flaws, reported them privately and gave PHP's maintainers time to build a fix before anything went public.

Calif, a security firm working with OpenAI under its Patch the Planet program, reported the root cause to PHP's security team on August 11. Wiz Research found its first bug on August 19, showed unauthenticated code execution against Drupal the next day and against WordPress the day after that, and reported more attack paths on August 24. Wiz says it used Gemini 4 Argon, GPT-5.6 Sol and its own Wiz Atlas tool throughout, from finding the bug to building exploits and checking the patch, and that one researcher did in a week what would previously have taken a team of specialists months.

The flaws weren't new. Researchers say they had been in PHP for more than a decade, and a PHP core developer saw signs of the memory bug during an external audit in 2024 without finding a way to turn it into code execution. What changed in 2026 was how fast a model could help a researcher get from an odd behavior to a working exploit. In Wiz's words, "Frontier AI models substantially reduced that barrier, turning a longstanding flaw into an exploit."

Attackers Reached It Before the Patch Did

A private report didn't mean a quiet fix. Amazon's threat intelligence team says its MadPot honeypots recorded a PHP2Shell exploitation attempt on October 17, four days before disclosure, from an address on a commercial anonymization network. Amazon says it's unclear how that actor got the exploit details.

The disclosure came apart over the last two days. On October 20, a post on Hacker News named both CVE numbers, and PHP responded with an advance notice moving the release up to October 21 at 14:00 UTC. That evening Calif mistakenly posted a video of its working proof of concept. Amazon saw the first proof-of-concept exploits around 02:00 UTC on October 21, twelve hours before the release, with varied payloads that point to several separate actors. Cloudflare turned on firewall rules by default at 03:02 UTC and reported attackers changing their payloads to get around them.

Amazon now describes PHP2Shell as broadly exploited in the wild, based on attempts against its sensors, and says it hasn't determined how many would succeed against real systems. As of October 21, the US Cybersecurity and Infrastructure Security Agency said it hadn't observed exploitation, and no confirmed break-in at a named organization had been reported. Several organizations took sites offline as a precaution, including Dutch and Finnish government services.

We Think AI Is Helping Attackers as Much as Defenders

The models that helped Calif and Wiz find a decade-old bug also help whoever reads the advisory next. Amazon says AI-assisted analysis now lets an attacker turn a patch or an advisory into a working exploit within hours, sometimes minutes, and that the old habit of waiting for someone else to publish a proof of concept is fading. Sansec, which tracks attacks on online stores, predicted mass attacks within 15 minutes of the release.

This is the second time this year. In July, a researcher at Searchlight Cyber used GPT-5.6 Sol to find wp2shell, a chain that let an attacker take over a WordPress site without logging in. WordPress patched it on July 17, and Wiz later found attackers using it to plant webshells on sites that hadn't updated.

Our view is that AI is helping attackers about as much as it's helping defenders. Defenders find old flaws faster, and the process around PHP2Shell held up well enough that patched packages, firewall rules and vendor backports were ready on release day. Attackers get the same speed on the other side of the announcement, and the time between a disclosure and the first attack is now counted in hours. That makes patching speed the thing that decides which sites are exposed.

We Swept Our Fleet Within Hours of the Announcement

Within hours of the announcement, we checked every server we manage for the sites we build and support and confirmed each one was running a PHP build with both fixes in place, with its PHP workers restarted so the fixed code was actually the code serving requests.

The version number alone wouldn't have told us that. On our cPanel servers the fixes arrived as CloudLinux backports under the old version numbers, so a server still reporting PHP 8.2.34 or 8.5.11 is patched if its package changelog lists CVE-2026-109618 and CVE-2026-109619. That covered the PHP 7 builds a few older client sites still need, which PHP itself no longer releases.

What to Do If Your Site Runs on PHP

  • Update PHP NowMove to 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or your vendor's patched build, and restart PHP-FPM or the web server so the new code loads. PHP calls updating the only safe choice.
  • Check for the CVEs, Not the Version NumberDebian, Ubuntu, Red Hat, cPanel and CloudLinux often ship fixes under an older version number. Look for CVE-2026-109618 and CVE-2026-109619 in the package changelog.
  • Updating WordPress Won't Fix ItThe flaw is in the server's PHP, so core, plugin and theme updates don't touch it. On shared or managed hosting, ask the host to confirm the fix by CVE number.
  • Plan for Old PHPPHP 8.1 and older get no official releases, and PHP 8.2 reaches end of life on December 31, 2026.
  • If You Can't Update TodayPHP's advisory lists settings that reduce exposure: memory_limit=-1 set at the administrator level, a low post_max_size, session.upload_progress.enabled=0 and, on PHP 8.5, fatal_error_backtraces=0, with every worker restarted. PHP is clear that none of them makes a server safe.
  • Look Back to October 17Amazon recommends starting any investigation from October 17, not the disclosure date. Warning signs include unusual multipart requests followed by memory-limit errors or repeated 500 errors, oversized PHPSESSID cookies and unexplained PHP worker restarts.

Frequently Asked Questions

Is WordPress Affected by PHP2Shell?

Yes, along with any other PHP application. The flaws are in PHP itself, and Wiz demonstrated code execution against default installs of WordPress, Drupal and Joomla. Updating WordPress, its plugins or its theme doesn't fix it; the PHP on the server has to be patched.

Was PHP2Shell Exploited Before the Patch?

Attempts were. Amazon recorded an exploitation attempt on October 17, four days before disclosure, and proof-of-concept attacks from around 02:00 UTC on October 21, twelve hours before the release. As of October 21, no confirmed break-in at a named organization had been reported.

Who Found PHP2Shell?

Calif and Wiz Research found it, both using AI models. Calif was working with OpenAI under its Patch the Planet program. Calif reported the root cause to PHP on August 11, and Wiz reported further attack paths on August 24. PHP released the fixes on October 21, 2026.

Which PHP Versions Fix PHP2Shell?

PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Vendor builds may carry the fix under an older version number, so check the package changelog for CVE-2026-109618 and CVE-2026-109619.

See Where You Stand

We will review your current search visibility and show you what buyers find when they look for what you do.

Contact Us