Exploited in the wild. Updated
PHP2Shell checker: check, fix and mitigate
- CVE-2026-109618
- CVE-2026-109619
- CVSS 4.0 9.2
PHP2Shell is a pair of unauthenticated remote code execution flaws in PHP itself. One crafted HTTP request can hand an attacker a shell on any server running PHP 5.4 to 8.5, whatever the application on top: WordPress, Drupal, Magento or your own code.
Fixed upstream in 8.5.12 8.4.27 8.3.36 8.2.35. PHP 8.1 and older got no release: they need a vendor backport, such as the GetPageSpeed builds for CentOS 7, Ubuntu and Debian (free to install).
Is my server vulnerable?
A free PHP2Shell checker that knows about distro backports, so it can tell you when a fixed package still shows an old PHP version. Version-only checkers cannot.
How to fix PHP2Shell on your platform
Updating PHP is the only complete fix. Install your vendor's security update, then restart every PHP process: running workers keep the vulnerable code in memory until they restart.
Ubuntu backports the fix and keeps the PHP version it shipped, so php -v on a patched Ubuntu 24.04 still says 8.3.6. Compare the package version instead.
| Release | Package | First fixed version | Advisory |
|---|---|---|---|
| Debian 13 trixie | php8.4 | 8.4.27-1~deb13u1 | DSA-6574-1 |
| Debian 12 bookworm | php8.2 | 8.2.35-1~deb12u1 | DLA-4848-1 |
| Ubuntu 26.10 | php8.5 | 8.5.9-0ubuntu2.1 | USN-8948-1 |
| Ubuntu 26.04 LTS | php8.5 | 8.5.4-0ubuntu1.5 | |
| Ubuntu 24.04 LTS | php8.3 | 8.3.6-0ubuntu0.24.04.13 | |
| Ubuntu 22.04 LTS | php8.1 | 8.1.2-1ubuntu2.28 | |
| Ubuntu 20.04 (Pro) | php7.4 | 7.4.3-4ubuntu2.29+esm5 | Ubuntu Pro |
| Ubuntu 20.04, EOL branches | php7.4, php8.0, php8.1 | 1:7.4.33-31+gps1, 1:8.0.30-25+gps1, 8.1.34-9+gps1 | GetPageSpeed Everpatch, free to install |
| Ubuntu 20.04, current branches | php8.2, php8.3, php8.4 | 8.2.35-1+gps1, 8.3.36-1+gps1, 8.4.27-1+gps1 | |
| Ubuntu 18.04 | php7.2 | 7.2.34-66+gps1 | |
| Debian 10 | php7.3 | 7.3.33-35+gps1 |
sudo apt update
sudo apt install --only-upgrade $(dpkg -l 'php*' | awk '/^ii/{print $2}')
sudo systemctl restart 'php*-fpm.service' apache2 # restart what you run
apt changelog php8.3-fpm | grep -E 'CVE-2026-10961[89]' # verify
Ubuntu 20.04, 18.04 and Debian 10 get no fix from apt upgrade: their patches sit behind Ubuntu Pro or Freexian ELTS. The GetPageSpeed rows above are Everpatch packages: they install free from the public extras repository and upgrade stock and Surý installs in place. On Ubuntu 20.04, PHP 7.4, 8.0 and 8.1 are EOL branches carried with backported fixes, while 8.2, 8.3 and 8.4 are the current upstream releases rebuilt for a suite Surý no longer builds. Personal, development and evaluation use is free; commercial production use requires GetPageSpeed Ultra for up to 10 servers running your own services, or GetPageSpeed Fleet for client servers and larger fleets. Debian 11 bullseye (PHP 7.4) has no Debian fix, but Surý's bullseye repository ships the fixed 1:7.4.33-31.
Red Hat, AlmaLinux and Rocky Linux shipped the same fixes. Alma and Rocky add their own build tags to module packages, so compare the version and release before the .module part.
| Release | Stream | First fixed | Red Hat advisory |
|---|---|---|---|
| EL 10 | php (8.3) | 8.3.36-1.el10_2 | RHSA-2026:87070 |
| EL 10 | php8.4 | 8.4.27-1.el10_2 | RHSA-2026:87071 |
| EL 9 | php:8.3 module | 8.3.36-1 | RHSA-2026:87079 |
| EL 9 | php:8.2 module | 8.2.35-1 | RHSA-2026:87072 |
| EL 9 | base php (8.0) | 8.0.30-8.el9_8.1 | RHSA-2026:87151 |
| EL 9 | php:8.4 module | No fix yet | Listed as affected |
| EL 8 | php:8.2 module | 8.2.35-1 | RHSA-2026:87073 |
| EL 8 | php:7.4 module | 7.4.33-8 | RHSA-2026:87080 |
sudo dnf updateinfo list --cve CVE-2026-109618 # shows the fix for your stream sudo dnf upgrade 'php*' sudo systemctl restart php-fpm httpd
On the RHEL 9 php:8.4 stream, switch to the fixed php:8.3 stream with dnf module switch-to php:8.3 until Red Hat ships a fix.
No distribution or upstream fix exists for CentOS 7. GetPageSpeed publishes patched, Remi-compatible builds of every PHP from 5.6 to 8.3 for CentOS 7, a drop-in patched PHP 5.4 for the stock CentOS 7 packages, plus PHP 8.4.27, free to install. Details are in the CentOS 7 section below.
yum -y install https://extras.getpagespeed.com/release-latest.rpm yum --enablerepo=getpagespeed-extras-php74 upgrade 'php-*' # or: yum upgrade 'php74-php*' systemctl restart php-fpm
Remi (EL 8 and newer) shipped 8.2.35, 8.3.36, 8.4.27 and 8.5.12 for both module streams and software collections, plus backports in php74-php 7.4.33-31 and php80-php 8.0.30-21. For CentOS 7 Remi has nothing: see the CentOS 7 tab. Remi's EL8 php56, php70 and php71 collections got no fix. GetPageSpeed ships drop-in compatible EL8 builds with PHP2Shell fixed (5.6.40-50.el8, 7.0.33-52.el8, 7.1.33-42.el8), plus php56 5.6.40-49.el9 for EL9, where Raven's php56 is unfixed: dnf install https://extras.getpagespeed.com/release-latest.rpm, then dnf update 'php56-php*' (or php70, php71). See PHP2Shell on AlmaLinux and Rocky.
sudo dnf upgrade 'php*' sudo systemctl restart php-fpm # SCL: systemctl restart php83-php-fpm
Ondřej Surý's packages (packages.sury.org and the Ubuntu PPA) shipped 8.2.35, 8.3.36, 8.4.27 and 8.5.12 on release day, then backported the fix into the EOL branches: 5.6.40-104, 7.2.34-66, 7.3.33-35, 1:7.4.33-31, 1:8.0.30-25 and 8.1.34-9, on the suites Surý still builds (Debian 11 to 13, Ubuntu 22.04 and 24.04). The 7.0 and 7.1 builds had no confirmed PHP2Shell changelog entry, so verify those with apt changelog. On suites the PPA dropped (Ubuntu 20.04, 18.04 and Debian 10), nothing updates: use the GetPageSpeed rebuilds of the same fixed sources, free to install.
sudo apt update && sudo apt install --only-upgrade php8.3-fpm php8.3-cli apt changelog php8.3-fpm | grep -E 'CVE-2026-10961[89]'
cPanel EasyApache 4 (build 25.91, October 21) updated ea-php82 to ea-php85 to the fixed releases (8.2.35, 8.3.36, 8.4.27 and 8.5.12) and backported the fix to three older branches without changing their PHP version: ea-php74 is fixed from 7.4.33-19, ea-php80 from 8.0.30-12 and ea-php81 from 8.1.34-5. cPanel did not patch ea-php73 or older: move those sites to a patched version in WHM's MultiPHP Manager. See the EasyApache 4 change log.
Update by the ea-php prefix. A plain yum update 'php*' does not match these packages. Then restart PHP-FPM and Apache, and on LiteSpeed also stop the running lsphp processes:
yum update 'ea-php*' # or: dnf upgrade 'ea-php*' /scripts/restartsrv_apache_php_fpm /scripts/restartsrv_httpd rpm -q --changelog ea-php74-php-cli | grep -E 'CVE-2026-10961[89]'
The cPanel version is not your website PHP. WHM and cPanel run on their own internal PHP. cPanel builds 110.0.153, 134.0.66, 136.0.50 and 138.0.18 (WP Squared 138.1.17) patch that internal PHP, which nightly maintenance also updates; to apply it now, run /scripts/autorepair update_cpanel_php8. That covers the control panel only. Websites run the ea-php or alt-php packages, which update separately, so a current cPanel build can still serve sites from a vulnerable PHP. Check each installed ea-php package with the checker above.
CloudLinux builds its own ea-php52 to ea-php85 for cPanel from the cl-ea4 repository (the release ends in .cloudlinux) and its own alt-php52 to alt-php85 for PHP Selector. Both carry the fix as a backport below the php.net version, with different numbers from cPanel's: for example ea-php74 7.4.33-18.el8.cloudlinux.13, ea-php83 8.3.35-2.el9.cloudlinux.2, alt-php74 7.4.33-81 and alt-php81 8.1.34-39. Never judge a CloudLinux build by cPanel's release numbers, or the reverse. If the update finds nothing, enable cl-ea4 and update cloudlinux-release first. See the CloudLinux fixed-package list.
yum clean all && yum update 'alt-php*' 'ea-php*' /scripts/restartsrv_apache_php_fpm # cPanel; LiteSpeed: also pkill lsphp
Plesk released PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, and backported the fix to its PHP 8.1.34, 8.0.30 and 7.4.33 builds. Updates install automatically. To force one, see the Plesk change log.
plesk installer --select-release-current --upgrade-installed-components
- Alpine:
php82tophp85are fixed at8.2.35-r0,8.3.36-r0,8.4.27-r0and8.5.12-r0on the supported branches. Runapk update && apk upgrade. - Amazon Linux 2: AWS fixed only the php8.2 extras topic, in
8.2.35-1.amzn2.0.1(ALAS2PHP8.2-2026-015). Core PHP 5.4 and the php7.2 to php8.1 topics stay vulnerable. PHP 7.2 and 7.4 have patched GetPageSpeed builds for Amazon Linux 2 that upgrade in place, free to install. - Amazon Linux 2023: php8.2 to php8.5 are fixed (ALAS2023-2026-3301 to 3304). Run
sudo dnf upgrade --releasever=latest 'php*'. - Official Docker images: rebuild from
php:8.5.12,php:8.4.27,php:8.3.36orphp:8.2.35tags (or the moving8.xtags), then redeploy. Images on 8.1 and older will not be fixed. - Homebrew and Windows: upgrade to the fixed upstream release (
brew upgrade php, or a new build from windows.php.net).
PHP2Shell on CentOS 7 and end-of-life PHP
php.net fixed only PHP 8.2 and newer. Remi stopped building for CentOS 7 in June 2024, so Remi's CentOS 7 packages, from PHP 5.6 to 8.3, will never get this fix. GetPageSpeed ships its own drop-in compatible builds of every one of them with PHP2Shell fixed. Package names match Remi's, so yum upgrade replaces them in place, and PECL extensions and ionCube keep working.
| PHP | Patched build | Where it comes from |
|---|---|---|
| 5.4 | 5.4.45-20.el7 | the PHP 5.6 adaptation, ported to 5.4; drop-in for stock CentOS 7 php-5.4.16 |
| 5.6 | 5.6.40-44.el7 | PHP 5.6 adaptation of the upstream fix |
| 7.0 | 7.0.33-46.el7 | port of the official 7.4 fix |
| 7.1 | 7.1.33-35.el7 | port of the official 7.4 fix |
| 7.2 | 7.2.34-30.el7 | port of the official 7.4 fix |
| 7.3 | 7.3.33-26.el7 | official 7.4 fix, hunk for hunk |
| 7.4 | 7.4.33-35.el7 | official 7.4 fix |
| 8.0 | 8.0.30-25.el7 | official 8.0 backport |
| 8.1 | 8.1.34-8.el7 | official 8.1 backport |
| 8.2 | 8.2.35-2.el7 | upstream PHP 8.2.35 |
| 8.3 | 8.3.36-2.el7 | upstream PHP 8.3.36 |
| 8.4 | 8.4.27-3.el7 | upstream PHP 8.4.27 |
| 8.5 | 8.5.12-1.el7 | upstream PHP 8.5.12 |
Base-name packages (remi-php56 to remi-php83)
yum -y install https://extras.getpagespeed.com/release-latest.rpm yum --enablerepo=getpagespeed-extras-php74 upgrade 'php-*' systemctl restart php-fpm
Replace php74 with your version: php56, php70, php71, php72, php73, php80, php81, php82 or php83. Enable the channel only for this transaction, as shown.
Software collections (php56-php to php84-php)
yum -y install https://extras.getpagespeed.com/release-latest.rpm yum upgrade 'php74-php*' systemctl restart php74-php-fpm scl enable php74 -- php -v
Collection builds, php84-php included, come from the main GetPageSpeed repository, so no extra channel is needed. On a fresh host, yum install php74-php-fpm instead of upgrading. Afterwards php -v prints Built by GetPageSpeed LLC. Running mod_php? Restart httpd instead.
Ubuntu 20.04, 18.04 and Debian 10
The same repository ships Everpatch DEB packages for the suites that Surý and the distributions dropped: PHP 7.4, 8.0 and 8.1 plus current 8.2, 8.3 and 8.4 for Ubuntu 20.04, PHP 7.2 for Ubuntu 18.04 and PHP 7.3 for Debian 10. They upgrade stock and Surý installs in place. See PHP2Shell on Ubuntu and Debian.
- Free to install. No account, no signup; personal, development and evaluation use is free. Running it for a business? GetPageSpeed Ultra keeps up to 10 servers running your own services patched for the next EOL PHP CVE ($500/year); for servers that host client websites, or more than 10, GetPageSpeed Fleet starts at $800/year. Either one funds these backports. When a new fix is ready for the PHP your servers run, we email you the exact command.
- Validated. On a clean CentOS 7 system, both PHP2Shell probes reproduce on the Remi package and fail on the patched build. The phpt suite and the module list match the Remi baseline.
- Tested serving pages. Every channel is exercised through both mod_php and PHP-FPM: fresh installs, upgrades from Remi with PECL and ionCube loaded, and the collection builds.
- More than PHP2Shell. The builds also carry 2024 to 2026 security fixes that CentOS 7 never got.
- Reversible.
yum downgradetakes you back to Remi. - One behaviour change. A request that hits
memory_limitnow ends its worker immediately, the same trade-off the PHP team made.
Want to leave EOL PHP behind? The PHP 8.4 stack for CentOS 7 is already at 8.4.27:
yum-config-manager --enable getpagespeed-extras-php84 yum -y install php84-getpagespeed-stack
Read the CentOS 7 PHP2Shell guide
Still running CentOS 7? Everpatch for CentOS 7 adds a maintained kernel and per-version PHP pages, and the same repository keeps current NGINX and modules installable. All platforms: the Everpatch overview.
Mitigate PHP2Shell at the NGINX edge
NGINX cannot fix a bug inside PHP, but it decides what reaches PHP. We tested each of these controls on Rocky Linux 10 with NGINX 1.30 and PHP-FPM 8.3. Each was checked against the public proof-of-concept request shape and against normal uploads. Use them to buy time and to harden patched servers too.
Good news for NGINX users. One CVE-2026-109618 strategy relies on a multipart body "without a usable declared content length" slipping past post_max_size. With the default fastcgi_request_buffering on, NGINX de-chunks and buffers the body, then passes PHP-FPM the real length. In our tests a chunked 100 KB upload reached PHP with CONTENT_LENGTH=102767, and post_max_size applied normally. Keep buffering on for PHP locations.
1. Cap the request body size
This is the strongest single control. NGINX counts de-chunked bytes as they arrive and rejects an oversized body with 413 before PHP parses anything. In testing, the 5 MB proof-of-concept body was cut off at 1 MB, with this log line: client intended to send too large chunked body.
location ~ \.php$ {
client_max_body_size 1m; # the smallest size your uploads need
fastcgi_request_buffering on; # the default: never stream bodies to PHP
include fastcgi_params;
fastcgi_pass unix:/run/php-fpm/www.sock;
}
2. Reject chunked multipart uploads
Browsers always send Content-Length with form uploads, but the public exploit uses chunked encoding. Refuse that combination for PHP before NGINX reads the body:
# http {} context, for example /etc/nginx/conf.d/00-php2shell.conf
map $http_content_type $p2s_multipart { default ""; "~*^multipart/form-data" "m"; }
map $http_transfer_encoding $p2s_chunked { default ""; "~*chunked" "c"; }
# inside the PHP location {}
set $p2s_block "$p2s_multipart$p2s_chunked";
if ($p2s_block = "mc") { return 411; }
Tested results: a chunked multipart request got 411, while normal multipart and urlencoded posts got 200. This rule covers HTTP/1.1 only. HTTP/2 has no chunked encoding, and we did not test it there, so rely on the body cap for HTTP/2.
3. Turn off session upload progress the right way
A common suggestion is fastcgi_param PHP_VALUE "session.upload_progress.enabled=0". Prefer the admin-level pool setting:
; PHP-FPM pool, e.g. /etc/php-fpm.d/www.conf or /etc/php/8.3/fpm/pool.d/www.conf php_admin_flag[session.upload_progress.enabled] = off
fastcgi_param PHP_ADMIN_VALUE "session.upload_progress.enabled=0"; also worked in testing. Prefer the pool setting: the advisory warns that per-request INI values from the frontend which raise a diagnostic are themselves a CVE-2026-109619 trigger. Audit what your NGINX sends:
grep -rn 'PHP_VALUE\|PHP_ADMIN_VALUE' /etc/nginx /etc/php-fpm.d /etc/php 2>/dev/null
4. Block the exploit fields with ModSecurity
For a request-body filter, the GetPageSpeed nginx-module-security package (ModSecurity v3) inspects multipart field names, including in chunked bodies. These rules returned 403 for a PHP_SESSION_UPLOAD_PROGRESS field, a 2,000-byte field name and a NUL byte, and 200 for normal uploads:
# /etc/nginx/php2shell.rules Include /etc/nginx/modsecurity.conf SecRule ARGS_NAMES "@rx (?i)^PHP_SESSION_UPLOAD_PROGRESS$" \ "id:1000100,phase:2,t:none,deny,status:403,log,msg:PHP2Shell-upload-progress-field" SecRule ARGS_NAMES "@gt 1024" \ "id:1000101,phase:2,t:none,t:length,deny,status:403,log,msg:PHP2Shell-oversized-arg-name" SecRule ARGS|ARGS_NAMES "@rx \x00" \ "id:1000102,phase:2,t:none,deny,status:403,log,msg:PHP2Shell-nul-byte"
# nginx.conf (top level)
load_module modules/ngx_http_modsecurity_module.so;
# inside the PHP location {}
modsecurity on;
modsecurity_rules_file /etc/nginx/php2shell.rules;
The package's base modsecurity.conf already turns on strict multipart parsing, which rejected malformed and empty-name multipart bodies with 400. Install it with dnf install nginx-module-security from the GetPageSpeed repository. NAXSI (nginx-module-naxsi) can block the field name too, but it has no length check, so ModSecurity is the better fit here.
Upload endpoints need more than a field-name rule: the full tested rule set also caps multipart part headers and field-name nesting, which catches the empty file controls that ModSecurity leaves out of its file count.
5. Check multipart bodies with phpguard
Rules 1 to 4 are written by hand and each stops one request shape. nginx-module-phpguard, a Pro module of the GetPageSpeed repository, does the multipart part of that job with one directive: NGINX checks each multipart body with a streaming parser that mirrors PHP's own before PHP sees a single byte. It runs in NGINX, so the same directive covers every PHP version behind that server, whether several PHP-FPM pools or Apache mod_php behind proxy_pass.
| Refused request | What that stops |
|---|---|
| A session upload progress field, in every spelling PHP accepts | The confirmed request trigger for CVE-2026-109619 and CVE-2026-115560 |
| Anything but canonical multipart: a preamble, an epilogue, NUL or control bytes, ambiguous quoting, a boundary string outside a real delimiter | Smuggled parts that PHP would parse and a filter would miss |
A body whose estimated parse cost in PHP exceeds phpguard_max_memory | The parse-time out-of-memory path of CVE-2026-109618 |
dnf -y install nginx-module-phpguard # or: apt-get install nginx-module-phpguard
# nginx.conf (top level)
load_module modules/ngx_http_phpguard_module.so;
# inside server {}
phpguard block; # "phpguard detect;" logs without blocking
In lab runs against PHP 5.6, 7.4, 8.1, 8.4 and 8.5 under PHP-FPM and mod_php, 2,644 of 31,140 hand-built and fuzzed requests reached PHP's upload progress code without the module and none reached it with it, while normal uploads passed with identical data. PHP's upload progress bars stop working, and a field or file name ending in a backslash is refused. Directives are in the phpguard documentation; the module is listed with the other Pro modules.
What phpguard does not cover: out-of-memory conditions your application reaches through other input, the CVE-2026-109619 paths that need no upload (INI diagnostics, fatal error backtraces on PHP 8.5, OPcache), and applications that read php://input themselves. Like every control in this section, it narrows the attack surface and does not replace a patched PHP.
Edge rules are not a patch. They stop the known request shapes. The advisory documents other paths that need no special upload at all. Update PHP.
Temporary php.ini mitigations, and why they are not enough
If you cannot update today, the PHP security team lists these settings. Apply them administratively (php.ini or the FPM pool, not per request), then restart every worker. Each one closes a single known path. None of them is a fix.
| Setting | What it blocks | What it leaves open |
|---|---|---|
session.upload_progress.enabled = 0 | The session upload progress path of CVE-2026-109619, confirmed against mod_php and FPM | Every other stale-state path, and all of CVE-2026-109618 |
fatal_error_backtraces = 0 (PHP 8.5) | The producer behind the strongest confirmed CVE-2026-109619 exploit | Other error, session and extension state |
memory_limit = -1 | The predictable, controllable out-of-memory trigger for CVE-2026-109618 | Real allocation failures still reach the vulnerable code, and one request can now eat all RAM |
Low post_max_size, max_input_nesting_level and max_input_vars | Cheaper paths to memory exhaustion | Application-specific memory exhaustion |
pm.max_requests = 1 (FPM) | State carried from one request to the next on the same worker | Throughput. Each request now forks a new worker |
; /etc/php.ini or /etc/php/*/fpm/php.ini until you can patch session.upload_progress.enabled = 0 fatal_error_backtraces = 0 ; PHP 8.5 only
Do not use RLIMIT_AS or RLIMIT_DATA limits. The advisory warns that they make mmap() fail, which triggers the same vulnerable out-of-memory path.
How PHP2Shell works
Both flaws are about PHP trusting memory it should not trust after a request is cut short. Neither needs a vulnerable application: the bug is in the engine and in request startup.
CVE-2026-109618: remote code execution via out-of-memory corruption
When PHP runs out of memory it calls longjmp() and abandons whatever it was doing. During multipart body parsing, some request memory is reachable before it is fully initialised. An out-of-memory error at that moment leaves it half-built, and the request shutdown code then reads it as if it were valid. An attacker who shapes the request controls that memory.
Attackers can reach the memory limit while staying inside PHP's apparent limits: a multipart body without a usable declared length can slip past the first post_max_size check, a single part can carry unlimited headers, and empty file fields still build metadata arrays. The fix replaces longjmp() with a deferred soft limit plus a hard _exit().
CVE-2026-109619: remote code execution via stale global state
A PHP worker keeps global state (error, session, decoder and extension state) that can point into one request's memory. If a fatal error or memory exhaustion interrupts an operation before its reset runs, the request heap is freed while that global still points at it. The next request on the same worker can touch the stale pointer before normal initialisation replaces it. This is a use-after-free, and with a prepared heap it becomes code execution.
The advisory confirms two consumers that run before initialisation. The first is session upload progress, which is enabled by default and works without the application ever calling session_start(). The second is any INI diagnostic raised before request startup, for example a deprecated value passed through Apache php_value, .htaccess, or a frontend's FastCGI PHP_VALUE parameter. Silencing errors with error_reporting, @ or display_errors does not help, because PHP touches the stale state before it decides whether to report anything.
CVE-2026-115560: a narrower session upload progress follow-up
On October 23 the PHP project published an informational notice about a third, separate issue. It needs an unusual setup: the configuration sets session.serialize_handler to php_binary or php_serialize, the application switches it to php with ini_set() before session_start(), and session upload progress is still enabled. Applications that never change the serialize handler at runtime are not affected.
The October 21 releases and the vendor backports above do not fix this one. PHP will fix it in its next regular release and publish the full advisory then, so a patched PHP2Shell build is not proof against it. Until then, keep session.upload_progress.enabled = 0, set at the admin level as shown in the NGINX section, then restart every worker.
Which PHP setups are exposed
| How PHP runs | CVE-2026-109618 | CVE-2026-109619 |
|---|---|---|
| Apache mod_php | Exploited. Fires before application code | Exploited. Confirmed RCE |
| PHP-FPM (NGINX, Apache proxy_fcgi) | Susceptible. The failed-startup path is blocked because FPM kills the child, but out-of-memory errors later in a request remain | Exploited. Upload progress RCE validated against FPM |
| FrankenPHP | Likely, like mod_php | Conditional |
| LiteSpeed (LSAPI) | Likely, like FPM | Conditional |
Source: the PHP security team's analysis in the two advisories. "Conditional" means exploitable when the application or configuration supplies the missing step, not that the setup is safe.
Detect PHP2Shell exploitation attempts
The exploit is noisy before it is reliable: attackers usually need several requests to line up the heap, and failed guesses crash workers. Look for these traces.
Out-of-memory errors with no script location
grep -rh 'Allowed memory size of' /var/log/php*-fpm/ /var/log/php-fpm/ /var/log/httpd/ /var/log/apache2/ 2>/dev/null \ | grep 'Unknown on line 0' | tail -n 20
PHP workers dying on segmentation faults
journalctl --since '2026-10-17' | grep -E 'php.*(SIGSEGV|signal 11|Segmentation fault)' | tail -n 20 grep -rh 'exited on signal 11' /var/log/php*-fpm* /var/log/php-fpm/ 2>/dev/null | tail -n 20
Crashing workers seen from NGINX
When a PHP-FPM child dies mid-request, NGINX logs it and returns 502. A burst of 502s on POSTs from one address is a strong signal:
grep -E 'upstream prematurely closed|Connection reset by peer\) while reading response header' /var/log/nginx/error.log | tail -n 20
awk '$6 == "\"POST" && $9 == 502 {print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
The public proof of concept sends chunked multipart POSTs with megabyte-sized field names and a PHP_SESSION_UPLOAD_PROGRESS field. Access logs do not record request size by default. Add $request_length to your log_format to spot oversized uploads in the future.
Shells spawned by the web server
ps -eo user,pid,ppid,etime,cmd --forest | grep -E -B1 '(sh|bash|python|perl|nc|curl|wget) ' | grep -E -A1 'php|httpd|apache'
Also look for outbound connections owned by the PHP user, new files in upload and cache directories, and strings like /dev/tcp/, fsockopen or mkfifo in recently changed PHP files. Clean logs do not prove a host is safe. If you cannot rule out a compromise, rotate its credentials and rebuild it.
Watching many servers? GetPageSpeed Amplify lists the PHP-FPM runtime on every monitored host and marks it patched, unverified or vulnerable against PHP2Shell. When a build is provably vulnerable, it emails you the exact upgrade commands.
PHP2Shell timeline
- Amazon's MadPot honeypots record an exploitation attempt, four days before disclosure.
- Details leak publicly and the PHP project announces an emergency security release for the next day.
- PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 ship with the two advisories. Source-only backports appear for 7.4, 8.0 and 8.1. Researchers publish technical write-ups, and CDN vendors roll out WAF rules.
- GetPageSpeed publishes patched PHP 5.6, 7.0, 7.3, 7.4 and 8.0 builds for CentOS 7. Public scanners appear, and attacks spread.
- GetPageSpeed completes the CentOS 7 set: every PHP from 5.6 to 8.4, in both Remi package shapes.
- PHP publishes an informational notice on CVE-2026-115560, a narrower session upload progress issue left for the next regular release.
- GetPageSpeed publishes patched PHP DEB packages for the dropped suites: 7.4 and 8.0 to 8.4 for Ubuntu 20.04, 7.2 for Ubuntu 18.04, 7.3 for Debian 10. Surý's backports for the suites he still builds land in their changelogs.
- GetPageSpeed adds patched PHP 5.4 for CentOS 7, a drop-in upgrade for the stock php-5.4.16 packages, and patched PHP 7.2 for Amazon Linux 2.
- GetPageSpeed adds patched PHP 7.4 for Amazon Linux 2 on x86_64 and Graviton, a drop-in upgrade for Remi's remi-php74 packages.
- GetPageSpeed adds patched PHP 5.6 for EL9, a drop-in upgrade for Raven's php56 packages.
- GetPageSpeed adds patched PHP 5.6, 7.0 and 7.1 for EL8, drop-in upgrades for Remi's php56, php70 and php71 collections, which Remi did not fix.
- This page last updated.
Need hands-on help?
Stuck on an old platform, a fleet you cannot patch by hand, or a server you suspect is compromised? GetPageSpeed engineers patch, harden and monitor production PHP and NGINX servers.
See Server CarePHP2Shell FAQ
What is PHP2Shell?
PHP2Shell is the name for two critical PHP vulnerabilities disclosed on October 21, 2026: CVE-2026-109618 (remote code execution via out-of-memory corruption) and CVE-2026-109619 (remote code execution via stale global state). Both are rated CVSS 4.0 9.2 and need no authentication. They are bugs in PHP itself, so every application on an affected PHP build is exposed, including WordPress, Drupal, Magento and Laravel sites.
Which PHP versions are affected by PHP2Shell?
Every PHP branch from 5.4 to 8.5 that serves web requests. Upstream fixes exist only in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. PHP 8.1 and older received no upstream release, so they are protected only by a vendor backport, such as a Debian, Ubuntu or RHEL security update, or the GetPageSpeed builds for CentOS 7.
Is PHP-FPM affected, or only mod_php?
Both. Apache mod_php is the worst case: the confirmed exploit fires during request startup, before any application code runs. PHP-FPM kills a worker whose startup fails, which blocks that exact sequence, but the PHP security team validated session upload progress RCE against FPM as well. FrankenPHP, php-cgi and LiteSpeed (LSAPI) are also susceptible. Patch every SAPI.
Does session.upload_progress.enabled=0 fix PHP2Shell?
No. It removes one confirmed path for CVE-2026-109619 and does nothing for CVE-2026-109618. The PHP security team says updating to a fixed release is the only complete mitigation. Keep upload progress disabled anyway: on October 23 PHP recommended it until its next regular release, which will fix CVE-2026-115560, a narrower issue that the October 21 releases do not cover.
Why does php -v still show the old version after I patched?
Distributions backport security fixes into the version they already ship. Ubuntu 24.04, for example, keeps reporting PHP 8.3.6 after the fix, and Debian, RHEL and the GetPageSpeed CentOS 7 builds keep their upstream version numbers too. Check the package release instead: paste rpm -qa or dpkg -l output into the checker on this page.
Is there a PHP2Shell fix for PHP 7.4, 8.0 or 8.1?
Not from php.net, which published only source backports for those branches. Fixed packages come from vendors: your distribution's security updates, Ondřej Surý's packages, cPanel EasyApache, Plesk, CloudLinux, and the GetPageSpeed Everpatch builds, which cover PHP 5.4 and every PHP from 5.6 to 8.4 on CentOS 7, PHP 7.4 and 8.0 to 8.4 on Ubuntu 20.04, PHP 7.2 on Ubuntu 18.04 and PHP 7.3 on Debian 10. The GetPageSpeed packages are free to install; commercial production use requires GetPageSpeed Ultra, or GetPageSpeed Fleet for servers that host client websites.
How do I fix PHP2Shell on CentOS 7?
Install the GetPageSpeed release package with yum install https://extras.getpagespeed.com/release-latest.rpm, then upgrade PHP from the channel for your version, for example yum --enablerepo=getpagespeed-extras-php74 upgrade 'php-*', or yum upgrade 'php74-php*' for the Remi software collection, and restart PHP-FPM. PHP 5.4 and every PHP from 5.6 to 8.4 have a channel, in both Remi shapes; stock CentOS 7 PHP 5.4.16 needs no channel at all: once the release package is installed, a plain yum update replaces it with the patched 5.4.45. The packages are free to install, with no account or signup; personal, development and evaluation use is free, while commercial production use requires GetPageSpeed Ultra ($500/year, up to 10 servers running your own services) or GetPageSpeed Fleet (from $800/year, for client servers or larger fleets).
Is there a free PHP2Shell checker?
Yes, the checker at the top of this page is free and needs no signup. Paste the output of rpm -qa 'php*' or dpkg -l 'php*' and it compares each package release against the fixed builds from Ubuntu, Debian, Red Hat, AlmaLinux, Rocky, Amazon Linux, cPanel, CloudLinux, Ondřej Surý and GetPageSpeed. The package check runs entirely in your browser. You can also scan a website address, which reads the PHP version the site advertises.
Why does a PHP2Shell checker say my patched server is vulnerable?
Most PHP2Shell checkers read only the PHP version number, from php -v or the X-Powered-By header, and compare it with 8.2.35, 8.3.36, 8.4.27 and 8.5.12. Distributions backport the fix without changing that number: a patched Ubuntu 24.04 still reports 8.3.6, and a patched CentOS 7 build still reports 7.4.33. A version-only checker flags those servers as vulnerable. The checker on this page reads the package release instead, so it recognizes the backport.
Is my cPanel server patched against PHP2Shell?
Only if every installed ea-php package is. The cPanel and WHM version covers the panel's own internal PHP, not the PHP your websites run. Run yum update 'ea-php*' (a plain 'php*' does not match), restart PHP-FPM and Apache, and check the packages: cPanel fixed ea-php74 from 7.4.33-19, ea-php80 from 8.0.30-12, ea-php81 from 8.1.34-5 and ea-php82 to ea-php85 at the upstream releases. CloudLinux servers get CloudLinux's own ea-php and alt-php builds, which have different release numbers.
Is WordPress affected by PHP2Shell?
Yes, if it runs on a vulnerable PHP build. The flaws sit in the PHP engine, not in WordPress code, so no plugin or WordPress update fixes them. Update PHP itself, then restart PHP-FPM or Apache.
Is a WAF such as Cloudflare enough?
No. Cloudflare and other vendors deployed rules for the known exploit shapes, and they reduce noise, but attackers mutate payloads and traffic that reaches the origin directly bypasses the CDN. Treat a WAF as a stopgap while you patch.
Can NGINX block PHP2Shell without updating PHP?
It can block the request-borne multipart paths. The GetPageSpeed nginx-module-phpguard checks every multipart body in NGINX before PHP sees a byte, with a parser that mirrors PHP's own: it refuses the session upload progress field in every spelling PHP accepts, rejects smuggled parts and bounds PHP's parse memory. In lab tests against PHP 5.6, 7.4, 8.1, 8.4 and 8.5 under PHP-FPM and mod_php, no exploit variant reached PHP's vulnerable upload code through it, while normal uploads passed unchanged. It does not cover out-of-memory conditions an application reaches through other input, or the CVE-2026-109619 paths that need no upload, so it is a stopgap, not a fix: update PHP wherever a fixed build exists.
How do I protect a server that runs several PHP versions from PHP2Shell?
Each PHP version is a separate set of packages, so each one needs its own fixed build: paste rpm -qa 'php*' or dpkg -l 'php*' into the checker on this page and it judges every installed version at once. For versions you cannot update yet, NGINX can narrow the exposure for all of them at once: with phpguard block; in the NGINX server block, nginx-module-phpguard inspects multipart requests before they reach any PHP-FPM pool or a proxied Apache mod_php, whatever PHP version runs behind it. That blocks the multipart triggers only, so it buys time and does not replace the update.
Do I need to restart PHP after updating?
Yes. Running PHP-FPM workers, Apache children and LiteSpeed processes keep the old code in memory until they restart. Restart php-fpm, httpd or apache2, and lsphp after the upgrade, then check again.
How can I tell whether my server was already exploited?
Look for memory-exhaustion errors reported at "Unknown on line 0", PHP-FPM children exiting on signal 11 (segmentation fault), multipart POSTs with huge field names or a PHP_SESSION_UPLOAD_PROGRESS field, and shell processes spawned by the web server user. Clean logs are not proof: rotate credentials and rebuild hosts you cannot rule out.
References
- GHSA-w8hw-w9fx-j79w: CVE-2026-109618, RCE via OOM corruption (PHP security team)
- GHSA-6wmf-4rv5-p3rp: CVE-2026-109619, RCE via stale global state (PHP security team)
- CVE-2026-109618 and CVE-2026-109619 on cve.org
- PHP release announcements: 8.5.12, 8.4.27, 8.3.36, 8.2.35
- PHP informational advisory on session upload progress (CVE-2026-115560), October 23
- cPanel EasyApache 4 change log (build 25.91) and the CloudLinux fixed alt-php and ea-php list
- SANS Internet Storm Center diary on the public proof of concept
- Datadog Security Labs on detection signals
- PHP2Shell on CentOS 7: patched PHP 5.4 to 8.4 (GetPageSpeed)
- PHP2Shell on CentOS 6: patched PHP 5.3, 7.0 and 7.1 (GetPageSpeed)
- PHP2Shell on Ubuntu and Debian: patched PHP 7.2 to 8.4 (GetPageSpeed)
- PHP2Shell on Amazon Linux 2: patched PHP 7.2 and 7.4 (GetPageSpeed)
- CVEfox: command-line PHP2Shell scanner (GetPageSpeed)
- PHP2Shell mitigation in NGINX: what it can and can't block (GetPageSpeed)