PHP2Shell (CVE-2026-109618/109619): Patch Your PHP Fleet
PHP2Shell is fixed in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. What Ubuntu, Debian, RHEL and Alpine shipped, and how to prove every server is patched.
By PatchMon Team
Updated 26 October 2026. This post was first published on release day, before the advisories were public. It now reflects the official advisories, the fixed versions each distribution shipped, and what has been seen in the wild since.
Most security releases arrive unannounced. This one came with a countdown.
On 20 October the PHP security team posted an advance notice: a release on Wednesday 21 October 2026 at 14:00 UTC, fixing two critical vulnerabilities, both rated CVSS v4.0 9.2. Within hours the details meant to stay under embargo had leaked, a screenshot of an exploit tool called PHP2Shell was circulating, and the two bugs had CVE numbers: CVE-2026-109618 and CVE-2026-109619. The fixed releases, PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, shipped on 21 October, and most distributions had packages out the same day.
If you run PHP anywhere (WordPress, Magento, Drupal, Laravel, a control panel, or an internal tool nobody remembers deploying), the question is no longer when the fix arrives. It is whether every PHP process you own is now running it.
The Short Version
If you only have two minutes:
- What it is: Two unauthenticated remote code execution vulnerabilities in PHP itself, not in a framework or plugin. CVE-2026-109618 is memory corruption during out-of-memory handling; CVE-2026-109619 is stale state left over from a previous request. Nicknamed PHP2Shell after the leaked exploit tool.
- Severity: CVSS v4.0 9.2 (Critical) for both.
- Fixed in: PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, released 21 October 2026. PHP 8.1 and older get no official release.
- Who is affected: Per php.net, "all PHP installations serving web requests, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed", with the highest risk for mod_php.
- Exploitation so far: Widespread scanning and exploitation attempts, including some before the patch. As of 26 October, no successful compromise has been confirmed, and neither CVE is in CISA's Known Exploited Vulnerabilities catalogue.
- What you do about it: Install your distro's or upstream's fixed PHP, then restart PHP-FPM or Apache. A patched package on disk does nothing while the old worker processes are still running.
The rest of this post is the why and the how.
What PHP2Shell Actually Is
The PHP project published two GitHub security advisories with the release. In its own words, from the 21 October announcement:
CVE-2026-109618, "RCE via OOM corruption" (GHSA-w8hw-w9fx-j79w): "out-of-memory handling can interrupt PHP while internal request data is only partially initialized. Request cleanup may then treat the invalid data as valid." Crafted multipart/form-data requests are one way to push PHP into that state.
CVE-2026-109619, "RCE via stale global state" (GHSA-6wmf-4rv5-p3rp): "request-owned internal state can survive after its backing memory has been freed. A later request handled by the same worker may use that stale state before normal initialization resets it." The advisory names session upload progress as one confirmed path to it, alongside fatal-error backtraces on PHP 8.5.
Before release, the only technical description came from a leaked proof-of-concept bundle, which described two heap use-after-free bugs, one in session upload progress and one in the multipart parser. That turned out to be partly right: session upload progress is a real path, but to the second CVE only, and the first CVE is an out-of-memory handling bug rather than a flaw in the multipart parser itself.
The leaked tool's claim that every release from PHP 5.4.0 onwards is vulnerable was never confirmed upstream. The advisories cover only the supported branches, and the PHP project says simply that "PHP 8.1 and older no longer receive updates from the PHP project." In practice, treat old PHP as vulnerable: the PHP security team published source backports for 7.4, 8.0 and 8.1 precisely because those branches are exposed.
The point that matters most for planning has not changed: these bugs live in PHP, not in your application. No plugin update, no WordPress core release and no rule inside your app will close them. The fix is a new PHP binary.
Why This One Hurts More Than the Usual PHP CVE
PHP ships security releases most months. The 24 September release alone fixed eleven advisories across FPM, OpenSSL, SOAP, Phar and the HTTP stream wrapper, and most teams applied it on their normal cycle without drama. Three things make this one different.
It is remote and pre-application. Most PHP CVEs need a particular extension, a particular function called with attacker-controlled input, or a particular configuration. php.net describes a demonstrated exploit "where an unauthenticated request can trigger the attack before any application code runs". That is the difference between "some apps are exposed" and "every PHP web server is a candidate."
Attackers started before the patch did. The embargo leaked, an exploit video was briefly posted and then removed, and honeypots were catching exploitation attempts within days. Once the fix was public, the diff showed everyone where to look. Your patch window for this one was measured in hours, not your usual monthly cycle, and any host still unpatched today is past it.
A large share of production PHP gets no upstream fix. php.net supports only 8.2 and later. PHP 8.1 reached end of life on 31 December 2025, and 8.0, 7.x and 5.x are long gone. For those hosts the fix has to come from a distro backport or an LTS vendor, or you migrate, or you take the host off the internet.
Exploitation So Far
The picture five days on is noisy, so here is what is solid:
- Attempts are real and widespread. Security vendors and honeypot operators reported scanning and exploitation attempts from release day onwards, and SecurityWeek reports that Amazon's honeypots logged a first attempt on 17 October, four days before the fix shipped.
- Successful compromise is not confirmed. CISA's alert states that it "has not observed successful exploitation of these vulnerabilities in the wild as of the time of publication". Unit 42 published a suspected compromise on 23 October and withdrew it two days later: "We are unable to confirm that initial access is associated with the specific PHP2Shell CVEs." As of 26 October, neither CVE is in CISA's KEV catalogue.
- Public exploits exist but are unreliable. Rapid7 reports multiple public proof-of-concept exploits, each tied to a specific OS, PHP version and web server combination, and none broadly reliable. Sansec has scaled back its release-day warning that mass exploitation was imminent.
- Be careful with GitHub. AhnLab ASEC counted around 100
php2shellrepositories within a day. Fake proof-of-concept repositories carrying malware are a familiar pattern after high-profile CVEs, and one-line "protection" scripts that ask to run as root are an attack path of their own. Do not run any of them on a machine you care about.
None of that is a reason to relax. Unreliable public exploits improve, and a confirmed compromise can follow at any point. Patch as if exploitation were confirmed.
Which PHP Versions Are Fixed
| Branch | Fixed release | Security support ends |
|---|---|---|
| PHP 8.5 | 8.5.12 | 31 Dec 2029 |
| PHP 8.4 | 8.4.27 | 31 Dec 2028 |
| PHP 8.3 | 8.3.36 | 31 Dec 2027 |
| PHP 8.2 | 8.2.35 | 31 Dec 2026 |
| PHP 8.1 and older | No official release. Source backports only, for 7.4, 8.0 and 8.1 | Already ended |
All four releases came out on 21 October (php.net news archive). PHP 8.2 deserves a note of its own: it got this fix, but its security support ends on 31 December 2026, nine weeks from now. If you are patching 8.2 hosts this week, put the 8.3 or 8.4 migration on the calendar while you are at it.
For 8.1 and older, the PHP security team published minimal source backports as branches in php-src (7.4, 8.0, 8.1) for people who build PHP from source. They are not releases, and most teams will get their fix from a distro instead.
What Your Distro Is Shipping
Most Linux servers do not run PHP from php.net. They run whatever their distribution packages, and distributions backport security fixes without changing the upstream version number. A distro PHP that reports 8.3.6 can be fully patched, so the version table above tells you nothing on a distro build. What you need is the distro's fixed package version.
Here is what each distribution published:
| Distribution | Package | Fixed version | Advisory |
|---|---|---|---|
| Ubuntu 26.04 LTS | php8.5 | 8.5.4-0ubuntu1.5 | USN-8948-1, 21 Oct |
| Ubuntu 24.04 LTS | php8.3 | 8.3.6-0ubuntu0.24.04.13 | USN-8948-1, 21 Oct |
| Ubuntu 22.04 LTS | php8.1 | 8.1.2-1ubuntu2.28 | USN-8948-1, 21 Oct |
| Ubuntu 20.04 and older | php7.4 and older | Ubuntu Pro (ESM) only | USN-8948-2, 21 Oct |
| Debian 13 "trixie" | php8.4 | 8.4.27-1~deb13u1 | DSA-6574-1, 21 Oct |
| Debian 12 "bookworm" | php8.2 | 8.2.35-1~deb12u1 | DLA-4848-1, 21 Oct |
| Debian 11 "bullseye" | php7.4 | None. Not listed on Debian's tracker | Debian LTS ended 31 August 2026 |
| RHEL 10 | php, php8.4 | 8.3.36-1.el10_2, 8.4.27-1.el10_2 | RHSA-2026:87070, RHSA-2026:87071 |
| RHEL 9 | php:8.2 and php:8.3 modules, php 8.0 | Updated module builds | RHSA-2026:87072, :87079, :87151 |
| RHEL 8 | php:8.2 and php:7.4 modules | Updated module builds | RHSA-2026:87073, :87080 |
Ubuntu. All four supported LTS releases were fixed on release day, including 22.04, whose PHP 8.1 gets no upstream fix: Canonical's backport is in the standard archive, not behind Ubuntu Pro. The version strings stay at 8.5.4, 8.3.6 and 8.1.2; only the Ubuntu revision changes. Older releases are covered through Ubuntu Pro. Details on the CVE-2026-109618 and CVE-2026-109619 tracker pages.
Debian. Trixie and bookworm are fixed (CVE-2026-109618, CVE-2026-109619); note that bookworm's fix came as an LTS advisory (DLA) rather than a DSA. Debian 11 is the uncomfortable one. Its LTS window closed on 31 August, and Debian's tracker does not list bullseye's php7.4 at all. A bullseye host still serving PHP 7.4 to the internet has no Debian fix coming: move it to a paid extended-support vendor, build from the 7.4 source backport, migrate, or take it offline.
RHEL, Rocky, AlmaLinux. Red Hat shipped fixes for RHEL 8, 9 and 10 on 21 October, tracked in bulletin RHSB-2026-013. Rocky Linux and AlmaLinux followed on 22 October with matching advisory numbers (for example ALSA-2026:87072). Because PHP comes from AppStream module streams, check which stream each host has enabled with dnf module list --enabled php. One gap to watch: as of 26 October, Red Hat's security data still lists the RHEL 9 php:8.4 stream as affected, with no advisory yet. If you run Remi's repository, Remi shipped the upstream 8.2.35, 8.3.36, 8.4.27 and 8.5.12 releases on 22 October.
Alpine and containers. Alpine's community repository carries php83 8.3.36-r0, php84 8.4.27-r0 and php85 8.5.12-r0 on edge and the current stable branches (pkgs.alpinelinux.org). The official php Docker images were rebuilt in stages: the -bookworm tags for 8.3.36, 8.4.27 and 8.5.12 on 21 October, the -trixie and plain tags on 23 and 24 October, and the -alpine tags by 26 October. Pull the new image, rebuild anything that uses it as a base, and redeploy. A running container does not pick up a new image on its own.
FreeBSD. The VuXML entry marks php82, php83, php84 and php85 below the fixed upstream versions as vulnerable, so pkg audit -F will flag them.
cPanel and Plesk. cPanel's EasyApache PHP builds were patched on 21 October with the fix backported onto the old version numbers (for example ea-php83 8.3.35-2), followed by builds carrying the upstream numbers on 23 October (CloudLinux). So an EasyApache host reporting 8.3.35 may already be fixed: check the package release, not php -v. Plesk shipped the upstream releases and backports on 21 October (Plesk Obsidian change log).
If You Cannot Patch Right Now
The PHP project is blunt: "There are no complete mitigations, updating is the only safe choice." For a host that genuinely cannot take the update today, these are the measures from the official advisory. They "reduce exposure to specific attack paths but do not make an installation safe."
Find every PHP install first. Hosts often run more than one PHP version side by side, especially where a control panel or Remi repository is involved.
# Debian / Ubuntu: every installed PHP package and its version
dpkg -l 'php*' | awk '/^ii/ {print $2, $3}'
# RHEL / Rocky / Alma: same, plus the enabled module stream
rpm -qa 'php*' --qf '%{NAME} %{VERSION}-%{RELEASE}\n'
dnf module list --enabled php
# Every PHP-FPM master currently running, and when it started
ps -eo pid,lstart,cmd | grep '[p]hp-fpm: master'
For CVE-2026-109619, disable session upload progress. It is one confirmed path to the bug, and few applications use the feature:
; php.ini, or the FPM pool / Apache config, so it applies before request parsing
session.upload_progress.enabled = Off
Restart every PHP worker afterwards. Setting it with ini_set() or in an FPM .user.ini is too late and does not help. On PHP 8.5, also set fatal_error_backtraces = Off. This blocks the confirmed paths, not every variant. The PHP project now suggests keeping session upload progress off until the next regular release in any case, because of a separate and much less likely issue in the same feature, CVE-2026-115560, announced on 23 October.
For CVE-2026-109618, the options all carry a cost. The advisory suggests:
- Setting
memory_limit = -1where applications cannot override it, such asphp_admin_valuein the FPM pool. That removes PHP's own memory-limit failure, but it also removes PHP's protection against one request using all of the server's memory. - Lowering
post_max_size(8M if you do not need uploads, 32M if you do), keepingupload_max_filesizebelow it. - Enforcing request size, field count, multipart part count, header count and nesting limits at the web server or proxy.
Some security vendors have gone further and suggested blocking multipart/form-data entirely, which breaks every file upload, including admin image uploads in most e-commerce platforms. Measures like these are a holding position for hours, not a substitute for the update.
Reduce exposure on legacy hosts. For anything on PHP 8.1 or older with no backport available, CISA's advice is to take it offline if you cannot patch it. At a minimum, put it behind a VPN or a web application firewall until it is upgraded.
Watch what PHP spawns. A successful exploit usually ends with the PHP worker launching a shell. Alert on PHP-FPM, php-cgi or Apache processes starting shells, interpreters or download tools, and on commands such as whoami or id running as the web server user. A quick manual look:
# Anything a PHP-FPM worker has spawned
for p in $(pgrep -f '^php-fpm: pool'); do ps --no-headers -o pid,user,lstart,cmd --ppid "$p"; done
On a healthy PHP web server this usually prints nothing.
How to Tell Your Fleet Is Actually Patched
PHP has the same trap as a kernel update, in a smaller form. With the Copy Fail kernel bug the problem was a patched kernel on disk and an unpatched one running until reboot. With PHP it is a patched package on disk and the old PHP-FPM workers still serving requests until someone restarts the service. Four things tend to go wrong:
- The package updated, the service did not restart. Some packaging restarts PHP-FPM on upgrade and some does not, and a host running two PHP versions may only restart one. Compare the start time of each PHP-FPM master (from the
pscommand above) with the time the package was installed. - PHP is somewhere you did not look. The second PHP version a control panel installed. The bullseye box behind an internal tool. The container image built six months ago from
php:8.1-fpm. The appliance VM with a web UI. - You cannot tell a patched distro build from an unpatched one by version.
8.3.6on Ubuntu 24.04 says nothing on its own;8.3.6-0ubuntu0.24.04.13does. The package changelog is the definitive answer:
# Debian / Ubuntu
apt changelog php8.3-fpm 2>/dev/null | grep -E 'CVE-2026-10961(8|9)'
# RHEL / Rocky / Alma
rpm -q --changelog php-fpm | grep -E 'CVE-2026-10961(8|9)'
- Your stream or image has not been fixed yet. RHEL 9's php:8.4 stream and the slower-rebuilt Docker tags are the obvious examples this week. "No update available" is not the same as "fixed".
Running those checks on one server is easy. Running them across two hundred, and keeping the answer current as the last advisories trickle in, is the actual job.
This is the problem PatchMon is built for. Each PatchMon agent reports every installed package, its version, and the updates available for it, including whether an available update is a security update. Search the Packages view for php and you get every host carrying a PHP package, the version each one has installed, and which of them still has an update waiting. Filter to hosts with pending updates and that is your outstanding list; as each host updates and reports back, it drops off. For containers, the Docker integration flags containers whose image has an update available, which is how you catch the stale php:*-fpm images. And every update is timestamped, which is the evidence your auditor or customer will ask for once the dust settles.
The quickest way to see it on your own servers is PatchMon Cloud: your own dedicated, managed PatchMon instance in the region you choose, ready a couple of minutes after you sign up, with updates, backups and monitoring handled for you. You install the agent on your hosts and the package picture starts filling in on the first report. Have a look at the pricing page to find the plan that fits your fleet and start your trial from there.
Bottom Line
PHP2Shell is two critical, pre-application remote code execution bugs in PHP itself. The fix shipped on 21 October, every major distribution has packages out, attackers are actively trying their luck, and the public exploits are not yet reliable. That gap will not last.
What to do now:
- Update PHP everywhere: 8.5.12, 8.4.27, 8.3.36 or 8.2.35 from upstream, or your distro's fixed package from the table above.
- Restart PHP-FPM or Apache on every host. A patched package on disk does nothing until the workers restart.
- Verify by package version or changelog, not by
php -v, and keep one report covering the whole fleet rather than spot-checking over SSH. - Chase the stragglers: RHEL 9 php:8.4, old container images, second PHP installs, control panel builds.
- Isolate or retire legacy PHP. Anything on 8.1 or older without a distro backport should come off the public internet.
The teams that get through events like this calmly are the ones who can answer "which servers still run an unpatched PHP?" in minutes, on the day the question is asked. Whatever you use to get that answer, now is a good time to check that it works. If you want to see how PatchMon answers it, take a look at PatchMon Cloud and get a trial instance running today. Either way, get PHP patched first.
Sources and Further Reading
- php.net: News archive 2026 (advance notice, security advisory, release announcements, 23 October informational advisory)
- php-src advisory GHSA-w8hw-w9fx-j79w (CVE-2026-109618)
- php-src advisory GHSA-6wmf-4rv5-p3rp (CVE-2026-109619)
- php.net: Supported Versions
- php.net: PHP 8 ChangeLog
- CISA: Critical Vulnerabilities in PHP Require Immediate Patching
- CISA: Known Exploited Vulnerabilities Catalog
- Ubuntu: USN-8948-1 and USN-8948-2
- Debian security tracker: CVE-2026-109618 and CVE-2026-109619
- Red Hat: RHSB-2026-013
- Remi's RPM repository: PHP 8.2.35, 8.3.36, 8.4.27 and 8.5.12
- FreeBSD VuXML: PHP multiple vulnerabilities
- CloudLinux: PHP CVE-2026-109618 and CVE-2026-109619 (cPanel EasyApache, alt-php)
- Unit 42: CVE-2026-109618 and CVE-2026-109619
- Rapid7: Critical unauthenticated RCE in PHP
- Sansec: PHP2Shell
- SecurityWeek: PHP2Shell exploitation started days before patches
- AhnLab ASEC: PHP2Shell
- endoflife.date: PHP