PHP2Shell: critical PHP flaws are being exploited - update PHP

PHP runs most of the web, and in October 2026 its developers fixed two flaws that let an attacker with no account run commands on a web server just by sending it a crafted request. The pair is nicknamed PHP2Shell. Attackers were already trying it before the fix came out, and since 26 October the US cyber agency CISA lists both flaws as exploited.

For a home lab the catch is that PHP hides inside other software: Nextcloud, WordPress, phpMyAdmin, many NAS apps. Updating "PHP" can mean updating five different places.

9.2

CVSS 4.0 score of both flaws

4days

attack seen before the fix existed

6weeks

since the fix (21 Oct)

31 Dec

PHP 8.2 loses security support

The short version#

TRUE

No login is needed

Both flaws can be triggered before any application sign-in, says QNAP.

TRUE

It is being exploited

CISA put both CVEs on its exploited list on 26 Oct. A researcher's honeypot recorded working code execution.

LIKELY

Apache with mod_php is hit hardest

CISA and PHP name it the highest-risk setup. PHP-FPM, php-cgi, FrankenPHP and LiteSpeed are affected too.

FALSE

The Docker image updates itself

A running container keeps its old PHP until you pull a new image and recreate it.

FALSE

A third bug is still unpatched

Early reports said CVE-2026-115560 had no patch. It was fixed on 19 Nov.

What happened#

PHP's memory handling had two weak spots. CVE-2026-109618 comes from out-of-memory handling: when PHP runs out of memory it jumps out of the request, and some code paths leave memory half-prepared. CVE-2026-109619 comes from "stale state": a later request can read memory that an earlier request already freed. Both can end in remote code execution (RCE), meaning the attacker runs their own commands.

  • Other
  • Official

Other

First attack attempt

Amazon's honeypot sees an attempt four days before disclosure.

Official

Fixes released

PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. The CVE records and CISA say 21 Oct; the php.net changelog lists 22 Oct.

Official

Docker and QNAP respond

Docker says its Official Images are already updated. QNAP publishes QSA-26-18 and marks QTS fixes as resolved on 24 Oct.

Official

CISA adds both CVEs to its exploited list

BleepingComputer reports the first confirmed working code execution, seen in researcher Adel Karimi's honeypot.

Official

Kernel bug joins the list

CISA adds Fragnesia (CVE-2026-46300), a Linux flaw that attackers chain with PHP2Shell to reach root.

Official

PHP 8.5.13, 8.4.28, 8.3.37, 8.2.36

More security fixes, including the patch for CVE-2026-115560.

Who saw what - and a correction. Several firms, including Cloudflare, Hadrian, watchTowr, Previdian and Patchstack, detected attempts before disclosure but judged them unsuccessful (BleepingComputer, 26 Oct). The first successful run came from Karimi's honeypot: Apache with mod_php, PHP 8.4.26, one worker process. He warned this is not a measure of how reliable the exploit is on other setups. Wiz said on 27 Oct that it had seen only failed attempts in its own data. So: real attacks, but not every attempt works.

Science cornermod_php, PHP-FPM, and why the setup matters

PHP can run in different ways. With mod_php, PHP lives inside the Apache web server itself. With PHP-FPM, a separate pool of PHP processes handles requests for a web server such as NGINX. The flaws affect both; the public attack was shown on mod_php. Every home-lab PHP app uses one of these - often inside a Docker image.

The chain to root. PHP2Shell gives the attacker the rights of the web account only. CISA lists the Linux kernel bug Fragnesia (CVE-2026-46300) as one that "can be chained with CVE-2026-109618 and CVE-2026-109619 to implant PHP webshells and run commands as root." CSO Online reported, citing Dream Security, an attack that reached root on vulnerable Palo Alto Networks firewalls this way. That kernel part is Linux only - fix it with a kernel update and reboot.

Am I affected?#

Almost certainly, if you host anything in PHP. Safe means a version at or above the fixed line in the same branch:

Your PHPStatusUpdate to
8.5.x below 8.5.12Vulnerable8.5.13 (current)
8.4.x below 8.4.27Vulnerable8.4.28
8.3.x below 8.3.36Vulnerable8.3.37
8.2.x below 8.2.35Vulnerable8.2.36, then plan to leave 8.2 (security support ends 31 Dec 2026)
8.1, 8.0, 7.x and olderUnsupportedUpgrade to a supported branch; PHP issued only minimal source backports for 7.4, 8.0 and 8.1
Debian, Ubuntu, RHEL packagesFixed with a backport; the number looks oldUpdate, then check the changelog

Ubuntu 24.04's fixed package is 8.3.6-0ubuntu0.24.04.13, Ubuntu 22.04's is 8.1.2-1ubuntu2.28: they look ancient but carry the fix (USN-8948-1/-2).

Where PHP hides in a home lab:

PlaceWhat to do
Docker images (Nextcloud, WordPress, phpMyAdmin and so on)Pull a new tag and recreate the container
Your own Dockerfile based on php:Rebuild with --pull
QNAP NASQNAP fixed QTS, QuTS hero and QuTScloud on 24 Oct and Notes Station 3 on 28 Oct. Container Station images and third-party apps are not covered
Synology NASSynology issued SA-26:14 (Critical) and SA-26:22 for its PHP packages. Update them in Package Center. See our Synology article
XAMPP, WAMP and similar bundlesThey carry their own PHP: check it separately

Both vulnerabilities can be triggered before any application-level authentication takes place.

QNAPsecurity advisory QSA-26-18, 22 Oct 2026

What to do now#

1. Check which PHP you run#

Linux and Mac

Run in terminalbash
php -v

Expected: something like PHP 8.4.28 (cli) .... Careful: this is the command-line PHP. Your web server may use another. On Debian-type systems list them with ls /usr/bin/php*, and see whether Apache embeds PHP with apache2ctl -M | grep php (a line php_module means mod_php).

Windows (PowerShell)

Run in terminalpowershell
php -v

If it says "not recognised", PHP is not on your PATH: run C:\php\php.exe -v (dummy path - use your own).

Docker (my-nextcloud is a dummy container name)

Run in terminalbash
docker exec my-nextcloud php -v

2. Update#

Linux

Run in terminalbash
sudo apt update && sudo apt upgrade
sudo systemctl restart apache2

Restart your PHP service too; its name contains your version, for example php8.4-fpm. On Fedora or RHEL-type systems use sudo dnf upgrade 'php*'. To see whether your package carries the fix: apt changelog php8.3-common | grep -m1 CVE-2026-109618 (use your version); one matching line means yes. Third-party repositories such as Ondrej's PPA are also used: we did not check them, so run php -v afterwards. On 21 Oct the community Remi repository had no updates yet.

Docker

Run in terminalbash
docker compose pull
docker compose up -d
docker compose exec app php -v

app is a dummy service name. For images you build, add docker compose build --pull --no-cache first. Docker Hub shows new Nextcloud, WordPress and phpMyAdmin images from 29-30 Nov, but that only means "rebuilt" - check the PHP number inside.

Windows

Download the zip for your branch from the PHP Windows downloads. Stop the web server, unpack the new version beside the old one, copy your php.ini, point the server at the new folder, start it again and run php -v. On IIS, restart the application pool.

Mac

Run in terminalbash
brew update
brew upgrade [email protected]
brew services restart [email protected]

Use your own branch. Homebrew's plain php formula now means PHP 8.6.0, a new version line, so do not run brew upgrade php unless you want that jump. Current branch formulae: [email protected] 8.5.13, [email protected] 8.4.28, [email protected] 8.3.37, [email protected] 8.2.36.

3. Restart or recreate#

Old PHP workers keep running until restarted. Restart Apache and PHP-FPM, recreate containers, then re-run php -v where the web app lives.

4. Cannot update right now?#

CISA and Docker say to take the affected system offline until it is patched. The php-src advisory lists only partial help, such as blocking multipart/form-data uploads at the front if your app does not use them, and keeping post_max_size small. CISA says a web application firewall may help. For CVE-2026-115560 specifically, PHP advised session.upload_progress.enabled=0 in php.ini; find the file with php --ini.

5. Linux kernel (Linux only)#

Install your distribution's kernel update and reboot. If nothing on that machine uses IPsec, check whether its kernel modules are loaded: lsmod | grep -E "esp4|esp6". CSO Online quotes one researcher saying such modules "have no business being loaded" there.

6. If the server was exposed#

Look for PHP processes starting shells or downloading tools. If you find signs of a break-in, rebuild from a clean image and change the passwords and keys the app could reach.

Common mistakes#

MistakeWhy it happensDo this instead
Updating PHP on the host but not in the containerThe app runs in its own imagedocker exec ... php -v on each container
Checking only php -vThe CLI and web PHP can differCheck the web runtime too
Updating without restartingWorkers keep the old codeRestart Apache or PHP-FPM, recreate containers
Stopping at 8.5.12, 8.4.27, 8.3.36 or 8.2.35Most guides were written in OctoberTake the 19 Nov versions or newer
Staying on PHP 8.2"It still works"Plan the move before 31 Dec 2026
An AI assistant says "8.3.36 is the latest" or "upgrade PHP with brew upgrade php"Its knowledge is old or ignores Homebrew's new defaultCheck php.net and use your branch's formula
Hardening only the PHP appFragnesia turns web-account access into rootPatch the Linux kernel too

Our take#

Treat this as a patch-today item for anything reachable from the internet, and a patch-this-week item for the rest. The part that catches people is not the update itself but finding every copy of PHP: containers, bundles and NAS packages. Make a list, update each one, and write down the PHP number you see. Not to be confused with "Plex2Shell", a separate bug chain in Plex Media Server - see our Plex2Shell article.

Sources#

Checked on 4 December 2026. We could not open SecurityWeek (blocked); we did not use it.

  1. CVE-2026-109618 and CVE-2026-109619 - CVE Program, published 21 Oct 2026
  2. php-src advisory GHSA-w8hw-w9fx-j79w and GHSA-g3vh-838c-65v7 - PHP project
  3. PHP ChangeLog and supported versions - php.net
  4. Critical vulnerabilities in PHP require immediate patching - CISA, 21 Oct 2026 (revised 26 Oct)
  5. Known Exploited Vulnerabilities catalog - CISA, version 2026.12.03
  6. PHP2Shell security flaws now successfully exploited in the wild - BleepingComputer, 26 Oct 2026
  7. PHP2Shell: exploitation attempts and remediation trends - Wiz, 27 Oct 2026
  8. PHP2Shell: PHP vulnerabilities patched - Help Net Security, 21-22 Oct 2026
  9. PHP2Shell: inside the critical PHP vulnerabilities - AWS
  10. PHP2Shell plus Fragnesia: a dangerous new route from web server to root - CSO Online, 29 Oct 2026
  11. Security update on PHP2Shell - Docker, 22 Oct 2026
  12. QSA-26-18 - QNAP, 22 Oct 2026 (revised to 28 Oct)
  13. Synology-SA-26:14 and SA-26:22 - Synology
  14. Debian security tracker and Ubuntu CVE page
  15. Homebrew formulae - Homebrew, checked 4 Dec 2026
  16. QNAP Plex2Shell notice - QNAP, 6 Nov 2026

Try one of these