PHP2Shell: AI-Found PHP RCE Flaws Put Most of the Web at Risk

Release date:
Hero Vector
Abstract illustration of a cracked server stack glowing electric amber, with circuit lines spreading to connected agent nodes on a deep aubergine background
Vector ImageVector ImageVector Image
Blog detail
Vector ImageVector ImageVector Image

On 21 October 2026, Wiz Research published details of PHP2Shell, a set of critical vulnerabilities in the core PHP engine. Not in WordPress. Not in a plugin. In PHP itself, the language that Wiz estimates sits behind around 70% of websites. The same day, the PHP project shipped patched releases and told every PHP user to update immediately.

If your organisation is busy building AI assistants, agents and retrieval systems, it would be easy to file this under "web team problem" and move on. That would be a mistake. PHP2Shell is a useful lens on three things that matter for anyone building with AI right now: the old systems your new AI depends on, how quickly attackers can now weaponise a disclosure, and how much damage a compromised host can do once agents are connected to it.

You can read the full research on the Wiz blog. Here is the short version, and what we think it means for you.

What Wiz actually found

The bugs are memory safety flaws in how PHP handles fatal errors during a request, particularly out of memory errors. When a request dies at the wrong moment, PHP can leave internal state pointing at memory that has already been freed. The next request handled by the same worker can then pick up that stale state. Depending on the path, an attacker can read chunks of the worker's memory or corrupt it badly enough to run their own code.

The issues are grouped under two CVEs, both rated CVSS v4.0 9.2 according to the PHP project:

  • CVE-2026-109618, which the PHP advisory describes as RCE via out of memory corruption. Wiz's examples include a use-after-free in the session upload progress unserializer and a remote memory disclosure that leaks worker memory back in a PHPSESSID cookie, even if the application never starts a session.
  • CVE-2026-109619, described as RCE via stale global state. Wiz's examples include a use-after-free in fatal error backtraces and a type confusion in OPcache's shared memory.

A few details stand out. Exploitation is unauthenticated. It happens below the application, so even a "Hello World" page on an affected PHP version can be vulnerable, and application logs may show very little. Wiz says every PHP release going back to 5.4 is affected by at least one of the issues, and it demonstrated pre-authentication remote code execution against the latest WordPress, Drupal and Joomla container images. The memory disclosure alone can expose passwords, tokens, API keys and certificates belonging to other requests.

The PHP project says the risk covers all PHP installations serving web requests, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed, and it considers mod_php the highest risk.

The disclosure timeline

  • 19 August 2026: Wiz finds the first vulnerability.
  • 20 and 21 August: unauthenticated RCE confirmed against Drupal, then WordPress.
  • 24 August: Wiz reports the issues to the PHP security team.
  • 21 September: PHP acknowledges and starts a coordinated fix.
  • 21 October: patched releases and public disclosure.

Wiz credits the PHP team, Calif and OpenAI for discovery, coordination and patch verification, and a long list of cloud, CDN and hosting providers for preparing mitigations ahead of disclosure.

The part that should change how you plan

The most important line in the Wiz post is not about PHP. It is about effort. The vulnerable code had been sitting there for more than a decade. Turning it into a reliable exploit meant chaining several bugs and adapting to each target's memory layout, which is slow, specialist work. Wiz says frontier AI models made that practical, and that a single researcher did in about a week what would previously have taken a world class team months.

Wiz used AI to find and fix these bugs, which is good news for defenders. But the same capability is available to attackers. The practical consequence is simple: the gap between "a patch is released" and "working exploits are circulating" is getting shorter. Complexity used to buy you time. It buys you a lot less now.

If your patching cadence for internet facing systems is still measured in weeks, that is the first assumption to revisit.

Why this is an AI problem, not just a web problem

Your AI sits next to your legacy stack

Very few organisations build AI on a clean slate. The customer service agent reads from a CRM that has a PHP admin portal. The RAG pipeline indexes content from a WordPress intranet or a Drupal knowledge base. The internal tool that calls the model is a ten year old PHP app someone added an "Ask AI" button to. These are exactly the systems PHP2Shell targets, and they are often the least loved part of the estate.

Compromised hosts now hold more valuable secrets

The memory disclosure in PHP2Shell can leak API keys and tokens. On a server that talks to an AI platform, that may include your model provider keys, vector database credentials and service accounts for the tools your agents use. An attacker who lifts those does not just deface a website. They can run up your inference bill, read your embeddings, or impersonate your agent.

Agents widen the blast radius

An agent with tool access is effectively a set of pre-authorised actions. If an attacker gets code execution on a host that the agent trusts, they can tamper with the data the agent retrieves, poison a knowledge source, or call the same downstream APIs the agent uses. If the agent also trusts the content it reads from that host, the compromise can travel further through prompt injection. The more tools you connect, the more a single compromised web server is worth.

Inventory has not kept up with adoption

Most organisations we talk to can list their AI use cases. Far fewer can list every system those use cases touch, with versions. When a bug like this lands, the first question is "where do we run PHP?", and the honest answer is often "we are not sure".

What to do this week

These steps come from the Wiz research and the PHP project's security advisory. Read both before acting.

  1. Patch. Update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35. Linux distributions and LTS vendors received the fixes in advance, so check your vendor's packages. Both PHP and Wiz are clear that updating is the only complete fix.
  2. Deal with old versions. PHP 8.1 and earlier no longer get official releases. The PHP security team has published minimal source backports for 7.4, 8.0 and 8.1, and some vendors provide backported packages. Otherwise, upgrade. Note that 8.2 reaches end of life on 31 December 2026.
  3. Apply interim mitigations if you cannot patch today. The PHP advisory lists several, including disabling session.upload_progress.enabled in server level configuration and restarting every worker, setting fatal_error_backtraces=0 on PHP 8.5, lowering post_max_size, and enforcing request size and multipart limits at the web server or proxy. These reduce exposure to known paths. They do not make you safe.
  4. Check your edge. Wiz notes that major cloud, CDN and hosting providers have prepared mitigations for customers who cannot update immediately. Confirm whether yours applies to you, and that it is switched on.
  5. Hunt. Until you are patched, Wiz suggests watching for unusual multipart requests followed by memory limit errors or repeated HTTP 500s, oversized or malformed PHPSESSID cookies, and unexplained PHP worker churn.
  6. Rotate secrets on exposed hosts. If an internet facing PHP server held API keys, tokens or certificates, including AI platform credentials, plan to rotate them after patching.

An AI era security checklist

Once the immediate fire is out, use it as a prompt to check your wider posture:

  • Map AI dependencies. For each AI use case, list the systems it reads from, writes to and runs on, including runtimes and versions.
  • Tighten patch windows for internet facing systems. Assume exploitation within days of disclosure, not months.
  • Scope agent credentials narrowly. Give each agent its own identity, least privilege access and short lived tokens, so one leaked key is not a skeleton key.
  • Treat retrieved content as untrusted. Anything an agent reads from a web system could have been tampered with. Design for that.
  • Log tool calls and watch for anomalies. You should be able to answer "what did this agent do, and on whose behalf?" quickly.
  • Use AI for defence too. The same models that shorten exploit development can help with code review, variant hunting and triage. PHP2Shell itself is proof of that.

How TruFyre helps

Most of the AI work we do is less about models and more about everything around them. PHP2Shell is a good example of why. The interesting part of your AI program is the model. The risky part is often a server nobody has looked at in years.

At TruFyre we help organisations in Australia and beyond navigate that:

  • AI strategy and roadmaps that start from what you actually run, so priorities reflect real dependencies and real risk.
  • AI governance and security, including risk assessments, policies and controls that hold up when a disclosure like this lands.
  • Secure agent and RAG architecture, with scoped identities, permissioned tools and retrieval designed to cope with untrusted content.
  • MLOps and DevSecOps pipelines that keep runtimes patched, secrets rotated and AI workloads observable.

If this week has you asking where PHP runs in your estate and what your agents can reach from there, we are happy to help you work it through. Get in touch with our team.

Source: PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet, Wiz Research, 21 October 2026. Patch and mitigation details from the PHP project's 21 October 2026 security advisory.

BG Image
Vector ImageVector ImageVector Image
We’re here to help
Vector ImageVector ImageVector Image

Ready to put AI to work in your business?

Talk to an AI expert about your goals.
Arrow Icon
Smart process automation
Arrow Icon
Direct access to our team. No bots.
Arrow Icon
We ask smart questions fast.

Book a Discovery Call

Your form has been submitted successfully. Thank you!
Please double-check your information and try again. If the issue continues, email us at info@trufyre.ai