---
title: "PHP2SHELL (CVE-2026-109618): What It Is and How to Patch | Digital Hosting"
url: https://digitalhosting.com/php2shell
description: "PHP2SHELL is a critical remote code execution flaw in PHP. See the affected versions, the fixed releases, and how to check and patch your site."
lang: en
---

Security advisory

# PHP2SHELL: the critical PHP flaw, and how to patch it

A critical remote code execution flaw in PHP, patched on 21 October 2026. It lives in the PHP runtime, not in WordPress or your plugins, so the server's PHP has to be updated.

On 21 October 2026 the PHP project shipped an emergency release for two vulnerabilities that together are being called PHP2SHELL. Both are tracked as critical, at CVSS 9.2. An attacker can run code on a server with a single web request, without logging in and before any of your application code runs.

If you run a site on PHP, read the "How to check your site" section below. If a hosting company runs PHP for you, the short version is to ask them which PHP build you are on and whether it carries the fix. Our host patch-status study (https://digitalhosting.com/php2shell-host-status) tracks where the major hosts stand, and our exposure checker (https://digitalhosting.com/php2shell-check) gives you a quick read on your own site.

## What PHP2SHELL actually is

PHP2SHELL is two separate bugs in how PHP handles memory during a request, disclosed together. **CVE-2026-109618** can leak memory from the server, including things like session tokens and private keys, and can lead to remote code execution. **CVE-2026-109619** can lead to remote code execution through reuse of internal state between requests. You do not need the technical detail to act on this: the flaw lives in PHP, it needs no authentication, and the only real fix is a patched PHP version.

## Which versions are affected

The vulnerable code has been present since PHP 5.4, so in practice every PHP version is affected unless it is one of the fixed releases below or carries a vendor backport. Servers running Apache with mod_php or PHP-FPM are the most exposed.

| PHP branch | Fixed in | Notes |
| --- | --- | --- |
| 8.5 | 8.5.12 | Update to this build or later. |
| 8.4 | 8.4.27 | Update to this build or later. |
| 8.3 | 8.3.36 | Update to this build or later. |
| 8.2 | 8.2.35 | Update to this build or later. |
| 8.1, 8.0, 7.4 | No php.net release | End of life. The fix comes from your Linux distribution, an LTS vendor, or a source backport. A backported package keeps its old version number, for example 8.1.34. |
| 7.3 and older | No fix | Upgrade to a supported, patched branch. |

The PHP project published the fixed builds on 21 October 2026. There is no configuration change that fully closes the hole, so a patched PHP version is the fix.

## Are you affected?

Assume yes if any of these is true and you have not updated PHP since 21 October 2026:

- You run a server with PHP installed, such as a VPS, a dedicated server, or a cloud instance you manage.
- You run WordPress, Drupal, Joomla, Laravel, Magento, or any PHP application on hosting you control.
- You maintain a custom PHP site.

You are likely covered already, but should confirm, if a managed host runs PHP for you and has deployed the patch.

## How to check your site

**If you manage the server yourself**, check the installed PHP version against the table above, then confirm the patch is actually in your package. On Debian or Ubuntu:

zgrep CVE-2026-109618 /usr/share/doc/php*-common/changelog.Debian.gz

On RHEL, AlmaLinux, or Rocky:

rpm -q --changelog php-common | grep CVE-2026-109618

A match means the fix is installed. After updating, restart every PHP worker (PHP-FPM, or Apache if you use mod_php), or the old code stays in memory.

**If a hosting company manages PHP for you**, you usually cannot read the exact patch level from outside. Ask your host directly whether they have applied the 21 October PHP security release, or check their status page. Our study (https://digitalhosting.com/php2shell-host-status) collects what the major hosts have said so far.

## How to fix it

1. **Update PHP** to the fixed build for your branch. This is the fix. Nothing else closes the hole on its own.
2. **Restart your PHP workers** after updating.
3. **On an end-of-life branch (8.1, 8.0, 7.4)**, get the backport from your distribution or an LTS vendor, or upgrade to a supported branch. On 7.3 or older, upgrade.
4. **If a host runs PHP for you**, confirm they have patched rather than assume it.

## If you cannot patch immediately

A few stopgaps reduce exposure, but none is a substitute for the update, and some can break your site:

- A web application firewall can block known attack patterns. Cloudflare, for example, pushed rules for these CVEs on 21 October to all plans, including the free tier. Keep a firewall on while you patch, but do not treat it as the fix.
- The UK's National Cyber Security Centre advises taking any system that cannot be patched quickly offline until it can be.

Blocking file-upload requests or changing PHP session settings only reduces the risk partially and can stop uploads from working, so patch as the real remedy.

## Is it being exploited?

Exploitation attempts have been reported in the wild since disclosure, and one honeypot logged an attempt four days before the public announcement. Researchers disagree on how easily the flaw can be weaponised against a default setup. As of 22 October 2026 neither CVE is in the US CISA Known Exploited Vulnerabilities catalog. The safe assumption is to patch now rather than wait for that to change.

## FAQ

Does updating WordPress or my plugins fix PHP2SHELL?

No. The flaw is in the PHP runtime, so only a patched PHP version fixes it. Keep your applications updated for other reasons, but that is separate.

I'm on managed hosting. Do I need to do anything?

Confirm your host has deployed the patch. Many have, some are still rolling it out, and on unmanaged plans it is your responsibility. See our host patch-status study for where each host stands.

Which PHP versions are safe?

8.5.12, 8.4.27, 8.3.36, 8.2.35, or a build from your distribution or LTS vendor that carries the backport for an older branch.

Can a firewall protect me instead of patching?

It helps while you patch. It is not a replacement, because the flaw is in PHP itself.

**Keep reading:** Which hosts have patched PHP2SHELL (https://digitalhosting.com/php2shell-host-status) and the exposure checker (https://digitalhosting.com/php2shell-check).

By W. Miller (https://digitalhosting.com/about#authors) · Editor, Digital Hosting · Updated October 22, 2026

## Structured data

```json
[
  {
    "@context": "https://schema.org",
    "@type": "WebSite",
    "name": "Digital Hosting",
    "url": "https://digitalhosting.com"
  },
  {
    "@context": "https://schema.org",
    "@type": "Organization",
    "name": "Digital Hosting",
    "url": "https://digitalhosting.com",
    "logo": "https://digitalhosting.com/og-image.png",
    "email": "hello@digitalhosting.com",
    "description": "Independent hosting review site — comparisons for web hosting, VPS, WordPress hosting, business email, and domain registration. Not a hosting provider.",
    "parentOrganization": {
      "@type": "Organization",
      "name": "TetraCore",
      "address": {
        "@type": "PostalAddress",
        "addressRegion": "OH",
        "addressCountry": "US"
      }
    }
  },
  {
    "@context": "https://schema.org",
    "@type": "Article",
    "headline": "PHP2SHELL: the critical PHP flaw, and how to patch it",
    "description": "PHP2SHELL is a critical remote code execution flaw in PHP. See the affected versions, the fixed releases, and how to check and patch your site.",
    "datePublished": "2026-10-22",
    "dateModified": "2026-10-22",
    "mainEntityOfPage": "https://digitalhosting.com/php2shell",
    "image": "https://digitalhosting.com/og-image.png",
    "author": {
      "@type": "Person",
      "name": "W. Miller",
      "jobTitle": "Editor, Digital Hosting",
      "description": "Founder of TetraCore, LLC, publisher of Digital Hosting. 35 years in software development, technology and related services, including cloud and hosting.",
      "knowsAbout": [
        "Web hosting",
        "Managed WordPress hosting",
        "VPS and cloud infrastructure",
        "Business email hosting",
        "Domain registration and renewal pricing",
        "Uptime and availability monitoring"
      ],
      "url": "https://digitalhosting.com/about#authors",
      "mainEntityOfPage": "https://digitalhosting.com/about#authors",
      "worksFor": {
        "@type": "Organization",
        "name": "TetraCore, LLC",
        "url": "https://digitalhosting.com"
      }
    },
    "publisher": {
      "@type": "Organization",
      "name": "Digital Hosting",
      "logo": {
        "@type": "ImageObject",
        "url": "https://digitalhosting.com/og-image.png"
      }
    }
  },
  {
    "@context": "https://schema.org",
    "@type": "FAQPage",
    "mainEntity": [
      {
        "@type": "Question",
        "name": "Does updating WordPress or my plugins fix PHP2SHELL?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "No. The flaw is in the PHP runtime, so only a patched PHP version fixes it. Keep your applications updated for other reasons, but that is separate."
        }
      },
      {
        "@type": "Question",
        "name": "I'm on managed hosting. Do I need to do anything?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Confirm your host has deployed the patch. Many have, some are still rolling it out, and on unmanaged plans it is your responsibility. See our host patch-status study for where each host stands."
        }
      },
      {
        "@type": "Question",
        "name": "Which PHP versions are safe?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "8.5.12, 8.4.27, 8.3.36, 8.2.35, or a build from your distribution or LTS vendor that carries the backport for an older branch."
        }
      },
      {
        "@type": "Question",
        "name": "Can a firewall protect me instead of patching?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "It helps while you patch. It is not a replacement, because the flaw is in PHP itself."
        }
      }
    ]
  }
]
```