PHP2Shell
Last verified 2h agoPHP-CGI argument injection to remote code execution
Fix it
- Package
- php8.2
- Affected
- < 8.2.20-1~deb12u1
- Fixed in
- 8.2.20-1~deb12u1
$ sudo apt update && sudo apt install --only-upgrade php8.2 php8.2-cgi
$ php -v && dpkg -l php8.2-cgi | tail -1
Then reload your web server: sudo systemctl reload apache2 or php-fpm.
If you can't upgrade today, stop php-cgi from parsing query-string arguments. These are temporary — upgrade as soon as possible.
; Refuse direct CGI invocationcgi.force_redirect = 1cgi.fix_pathinfo = 0
# Block argument-style query strings to php-cgiRewriteEngine OnRewriteCond %{QUERY_STRING} ^(%2d|-)[^=]+$ [NC]RewriteRule ^ - [F]
Risk signals
How the attack works
When PHP runs as php-cgi, the web server passes the query string to the binary. RFC 3875 says a query string without = becomes command-line arguments. PHP's guard against this can be bypassed with encoded or best-fit-mapped hyphens.
An attacker sends ?-d+allow_url_include=1+-d+auto_prepend_file=php://input and puts PHP code in the request body. It runs as the web server user before your script loads. No authentication, no user interaction.
You're exposed if: php-cgi is reachable over HTTP (Apache mod_cgi/ScriptAlias, XAMPP-style setups, some shared hosting). Pure PHP-FPM behind nginx with no php-cgi binary is not directly exploitable, but should still be upgraded.
Identifiers
| Type | Identifier | Authority | Link |
|---|---|---|---|
| CVE | CVE-2026-109618 | MITRE / NVD | canonical |
| CVE | CVE-2026-109619 | MITRE / NVD | canonical |
| GHSA | GHSA-78vj-982h | GitHub Advisory DB | canonical |
| DSA | DSA-6574-1 | Debian Security | canonical |
| DLA | DLA-4848-1 | Debian LTS | canonical |
| USN | USN-8948-1 | Ubuntu Security | canonical |
Timeline
- Upstream fix committed
php-src commit 4f1c9a2 hardens php-cgi argv parsing on all supported branches.
- Public disclosure
CVE-2026-109618 and CVE-2026-109619 published; GHSA-78vj-982h issued.
- Distro patches released
Debian DSA-6574-1, DLA-4848-1 and Ubuntu USN-8948-1 published. RHEL errata same day.
- Added to CISA KEV
Federal remediation deadline set to Nov 14, 2026.
- Mass exploitation detected
Honeypots record >40k exploitation attempts/hour dropping cryptominers and webshells.
Related incidents
Still the most-scanned bug on the internet. Embedded Log4j in vendor appliances keeps it alive.
Encoded dot segments escape DocumentRoot; with mod_cgi enabled, leads to RCE.
Specific nginx fastcgi_split_path_info configs allow RCE in PHP-FPM.