PHP2Shell series, 4 parts
Read in order, or jump to the part you need.
  1. What PHP2Shell is
  2. How the two bugs work
  3. How it was found, and the leak
  4. How to patch and protect your servers

Bonus: watch it in 3D

In October 2026, two serious flaws were disclosed in PHP, the programming language that runs a very large share of the web. They were given the nickname PHP2Shell. This is part 1 of a 4-part series. It explains what happened without assuming you know any programming. Part 2 goes deep on how the bugs work, part 3 covers how they were found (AI played a part), and part 4 is the patching guide.

The short answer
PHP2Shell is two bugs in PHP itself, tracked as CVE-2026-109618 and CVE-2026-109619. Both are rated 9.2 out of 10 for severity. They can let a stranger on the internet run commands on a web server, with no password. The fix is to update PHP to 8.5.12, 8.4.27, 8.3.36 or 8.2.35 (or your provider's patched build).

First, what is PHP, and why does a bug in it matter?

PHP is a programming language that websites use to build pages on the fly. WordPress, which runs a huge number of websites, is written in it. So are Drupal, Joomla, Magento, Laravel, Nextcloud and phpMyAdmin. Wiz, one of the companies that found the flaws, puts PHP at roughly 70 percent of websites (its own estimate, as reported by The Next Web). Qualys, a security company, counted about 167 million PHP installations in data from around 12,000 of its customers. See the Qualys write-up.

Most security news is about a mistake in one product, such as one plugin or one app. This one is different. The mistake is in the engine underneath. Every website that runs on a vulnerable PHP version is exposed, even if the website's own code is perfect.

What does "RCE" or "shell" mean?

RCE means remote code execution: someone far away makes your server run instructions of their choosing. A shell is a command line, the kind of text window where you type commands to a computer. "PHP2Shell" is the nickname because the end goal of an attack is a shell on your server.

The PHP project's advisories describe the result as unauthenticated code execution as the web worker account, meaning the low-privilege user the web server runs as. That is not "full control of the machine" on its own. It is still enough to read the site's files, read its settings (which often include database passwords and API keys), change pages, and use the server as a stepping stone.

A visitor sends a requestThe web server (Apache, nginx)The PHP engineThe flaw is hereYour app: WordPress, Laravel, etc.Logins and plugins live here
The flaw sits in the PHP engine, which handles a request before your own code runs. That is why a strong login page does not help.

The two bugs, simply put

Both bugs come from the same kind of problem: PHP is interrupted in the middle of a job, and something later trusts the unfinished work as if it were complete.

Bug 1 (CVE-2026-109618): running out of memory

When PHP handles a request, it builds things in memory, like a chef building a dish. Every request is allowed a fixed amount of memory (the memory_limit setting). If PHP runs out partway through building something, it does not stop politely. It jumps straight out of what it was doing. If that happens at the wrong moment, the half-built thing is left behind, and a cleanup step that runs afterwards treats it as finished.

Step 1: a chef is building a dish(PHP is building a list in its working memory,one piece at a time)Step 2: the kitchen runs out of counter spaceThe chef drops everything and walks out,leaving the dish half builtStep 3: the cleaner arrivesThe cleaner sees a plate and assumes it is finished.They pick it up and follow what is on it.A stranger decided what was on that plate.
An analogy, not the exact code: a half-built thing that something else later trusts as complete.

The key point: the attacker can choose when the kitchen runs out of space, by sending a request designed to use up memory at a precise moment. The advisory lists three ways to do that with an upload-style request. You will find them in part 2.

Bug 2 (CVE-2026-109619): leftovers from a previous visitor

A PHP worker is like a hotel receptionist who serves one guest after another. A good receptionist wipes the desk between guests. In this bug, a first request can leave a note on the desk pointing at a drawer that has since been emptied. If the next guest's request reads that note before the desk is wiped, it follows the pointer into a drawer that now holds something else. The attacker needs both requests to land on the same worker. More workers makes that harder, not impossible.

Who is affected?

A worrying detail from the Qualys data: of the installations with a known version, about 44 million run supported branches (8.2 to 8.5), and about 110 million run branches that are already past end of life. Those are one vendor's estimates, not a census of the web.

What could an attacker actually do?

Three things are documented:

  1. Run code on the server as the web worker account (the PHP advisories).
  2. Read memory from the PHP worker. Sansec says this can leak passwords, session tokens, API keys and TLS private keys. Sansec says this works through the session cookie (PHPSESSID), and Datadog describes the same technique.
  3. Crash workers (denial of service), which is what a failed attempt often looks like.

To make that concrete, here is an illustrative example, not a real incident. A small company runs a WordPress marketing site on an old PHP version, with a chatbot plugin that holds an API key for an AI model. If an attacker reads the worker's memory, that key could be in it. They could then run up the company's AI bill or read what the chatbot sends. The site's login page and security plugins would not have stopped any of it, because the attack happens before they run.

How worried should you be?

Honestly: very serious, but not "everything is hacked tonight."

Attackers only need to get reliable on the most common setups. Time is on the defenders' side only if they patch quickly.

Where to go next

Need help with PHP2Shell?
This is the kind of fix we help with. GreyScript AI helps teams find where PHP runs behind their websites and AI products, patch it in the right order, and secure what sits around it: where model keys and other secrets live, how the AI integration is built, and which credentials to rotate. We start with an inventory, then give you a short, ordered patch-and-rotate plan, backed by our AI governance and security audit. Book a 30-minute scoping call and tell us what you run.

Sources: PHP advisory for CVE-2026-109618, PHP advisory for CVE-2026-109619, CISA alert, Qualys write-up, Alexandre Daubois, PHP security team, Daniele Berardinelli's analysis, Sansec, Datadog Security Labs, The Next Web, Cloudflare. Read 23 October 2026. Examples marked illustrative are not real incidents