bestai

PHP2Shell: Patch PHP Now, AI Found These Server Flaws

PHP2Shell is a pair of critical PHP flaws, CVE-2026-109618 and CVE-2026-109619, that let attackers run code on a web server without logging in. PHP fixed them on 21 October 2026 in 8.5.12, 8.4.27, 8.3.36 and 8.2.35. AI models helped find them, and Cloudflare already sees attacks.

B
By BestAI Editorial Team · Published · 5 min read
Share:Xin

Key points

  • • Both bugs come from how PHP recovers when a request fails badly, for example when it runs out of memory.
  • • The flaws existed for years; turning them into a working attack took a long chain of steps.
  • • India's CERT-In warned on 15 October that criminals already use AI agent kits to attack Indian firms within hours, as our report on the [CERT-In advisory](/news/cert-in-advisory-ai-agents) explains.

If your website runs on PHP, which includes most WordPress, Drupal and Joomla sites, this is the update not to postpone. Two flaws in PHP itself, nicknamed PHP2Shell, let an attacker take over a web server with crafted web requests, no password needed. Patches have been out since 21 October 2026, details leaked before release, and attacks have started. The other reason the story matters here: AI models found the bugs.

Key points

  • PHP's security advisory lists CVE-2026-109618 and CVE-2026-109619 as critical remote code execution flaws, rated 9.2 on CVSS v4.0. Every PHP setup that serves web requests is affected, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed.
  • Fixed versions: 8.5.12, 8.4.27, 8.3.36 and 8.2.35. PHP calls updating "the only safe choice."
  • A related flaw, CVE-2026-115560, published on 23 October, also affects patched versions. PHP's advice until the next release: set session.upload_progress.enabled=0.

What PHP2Shell does

Both bugs come from how PHP recovers when a request fails badly, for example when it runs out of memory. According to PHP, one lets out-of-memory handling interrupt PHP while internal request data is only half set up; the other lets request data survive after its memory has been freed. Wiz, one of the teams that found them, showed unauthenticated code execution on the latest WordPress and Drupal images in its lab, and says the flaws can also leak server memory that may hold passwords, API keys and tokens.

The age is what makes it serious. Wiz says every PHP version released in the last decade is affected by at least one of the bugs, going back to PHP 5.4.

How AI found PHP2Shell

The flaws existed for years; turning them into a working attack took a long chain of steps. OpenAI says the security firm Calif found a critical flaw using its GPT-5.6 Sol model, and that Wiz found and reported both independently. Wiz says its researchers used Gemini 4 Argon and GPT-5.6 Sol for discovery, exploit development and patch testing. Wiz found the first bug on 19 August and reported it on 24 August; the fix shipped on 21 October.

OpenAI's own warning is the uncomfortable part: the "same capabilities can also help attackers rapidly develop offensive tools and exploits," and it expects such findings to rise sharply. Our guide to AI reverse engineering covers the same shift from the analysis side.

Is PHP2Shell being exploited?

Yes. Cloudflare says the details "leaked before the official release date" and that it has seen attack traffic against its customers, with attackers changing their payloads to slip past its rules. Its firewall blocks known attempts only on sites that use PHP's default upload-progress field name, and it tells customers to patch anyway.

How to check and patch your site

  1. Find your PHP version. In WordPress, open Tools, then Site Health, then the Info tab, and look under Server. On your own server, run php -v. On shared hosting, check the PHP version selector in your control panel.
  2. Update to a fixed release: 8.5.12, 8.4.27, 8.3.36 or 8.2.35 or later. On shared hosting, ask your host to confirm in writing that its PHP builds include the 21 October fixes.
  3. If you are on PHP 8.1 or older, the PHP project no longer ships updates. Ask your Linux distribution or hosting vendor for a backported fix, or upgrade. PHP published minimal source backports for 7.4, 8.0 and 8.1.
  4. Turn off upload progress with session.upload_progress.enabled=0 in php.ini or your FPM pool, then restart PHP workers. It blocks the newest flaw and is part of PHP's workaround for one of the original two.
  5. Watch for signs of attack. Wiz lists unusual multipart uploads followed by memory-limit errors, repeated HTTP 500 responses, oversized or malformed PHPSESSID cookies, and PHP workers restarting without reason.
Your PHP branch Fixed in Status
8.5 8.5.12 Supported
8.4 8.4.27 Supported
8.3 8.3.36 Supported
8.2 8.2.35 Ends 31 December 2026
8.1 and older No official update Vendor backport or upgrade

What it means beyond this patch

India's CERT-In warned on 15 October that criminals already use AI agent kits to attack Indian firms within hours, as our report on the CERT-In advisory explains. PHP2Shell shows the same speed on the defending side: AI found decade-old bugs, and the patch arrived before most attackers had them. The gap between a fix and an attack is now days, so small businesses on cheap shared hosting should check who patches their PHP, and how fast. For finding issues in your own code, our ranking of AI coding tools lists agents that can review a codebase.

FAQ

What is PHP2Shell?

The nickname for two critical PHP flaws, CVE-2026-109618 and CVE-2026-109619, disclosed on 21 October 2026. They let an attacker run code on a PHP web server without logging in.

Which PHP versions fix PHP2Shell?

PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. PHP 8.1 and older get no official update; use a vendor backport or upgrade.

Is my WordPress site affected by PHP2Shell?

If it runs on an unpatched PHP version, yes. Wiz demonstrated unauthenticated code execution on WordPress in its lab. Check your PHP version under Tools, Site Health, Info, Server, and update or ask your host.

Was PHP2Shell found by AI?

AI models helped. OpenAI says Calif used GPT-5.6 Sol to find a critical flaw, and Wiz says it used Gemini 4 Argon and GPT-5.6 Sol. Human researchers led the work and the disclosure.

Is there a workaround if I cannot update PHP today?

PHP suggests setting session.upload_progress.enabled=0 and restarting PHP workers, plus memory-limit changes for one flaw. These reduce risk but are not a complete fix; updating is.

Source: https://www.php.net/archive/2026.php

Related tools

We may earn a commission if you buy through our links. This doesn't affect our rankings. Learn more about our affiliate disclosure.

ChatGPT
ChatGPT logo

ChatGPT

The most widely used AI chatbot for writing, coding, and research.

4.74.7 out of 5 stars
Freemium
Visit site
Gemini
Gemini logo

Gemini

Google's multimodal AI assistant integrated across Search, Workspace, and Android.

4.44.4 out of 5 stars
Freemium
Visit site

See more of BestAI.in in Google's Top Stories: add us as a preferred source.