PHP2Shell (CVE-2026-109618/109619) Emergency Response Plan

Xint provides emergency response measures and methods for PHP2Shell (CVE-2026-109618/109619), a PHP vulnerability that allows server takeover without authentication.
Xint's avatar
Oct 21, 2026
PHP2Shell (CVE-2026-109618/109619) Emergency Response Plan

📣

(10/23 UPDATE) | PHP2Shell vulnerability scanner “PHP Guard” released
Enter a service URL into “PHP Guard”, the scanner released by Theori, to check immediately whether it is exposed to PHP2Shell.
On-premise deployment is also available for internal system checks; requests can be submitted through the contact form on the website.
👉 PHP Guard: https://phpguard.io/

1. PHP2Shell Summary

A vulnerability in the PHP engine itself allows unauthenticated remote code execution on the server or disclosure of process memory. It is determined solely by the PHP version, regardless of application code. A PoC demonstration video and patched binaries were leaked before the official disclosure, and PoCs based on them are spreading quickly. Having completed a working exploit in-house, the Xint team considers it only a matter of time before other attackers do the same. Patch now.

PHP2Shell Exploit Demo
Item Details
CVE CVE-2026-109618, CVE-2026-109619
Severity CVSS v4.0 9.2 (Critical)
Fixed versions 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12 (released 2026-10-21 23:00 KST)
Affected versions Versions below the fixed versions, and PHP 8.1 or earlier (including 7.x and 5.x)
PHP 8.1 or earlier No official release. Check for security updates from the distribution in use (Ubuntu, Debian, RHEL, etc.) or an LTS vendor.
Mitigation PHP's official position: there is no complete mitigation, and updating is the only safe option.

🔧 Immediate measures: session.upload_progress.enabled = 0, session.auto_start = 0 (both values must be 0). Turning off auto_start may break sessions on pages that do not call session_start(), so complete the pre-check in 3.2 before changing it.

💬 Xint's take: In an in-house reproduction environment, Xint confirmed both that the actual exploit works and that the measures in this document mitigate the attack. First check whether the distribution or LTS vendor provides a security update; if none is available, upgrade to a supported version, and apply the 3.2 temporary mitigation until then. Security support for PHP 8.2 also ends at the end of 2026, so upgrading to 8.3 or later is recommended.

2. Methods to identify vulnerable environments

Consider unpatched PHP vulnerable even with its default settings. Changing settings can only reduce a limited number of attack vectors, and new vectors stemming from the same causes may continue to be discovered.

2.1 Vulnerabilities by Server Configuration

Based on the official analysis and the Xint team's reproduction results. This will be updated as new findings are confirmed. (Last updated: 2026-10-21 KST)

Composition Verdict Condition
Apache + mod_php (prefork) O Remote code execution is possible in any PHP script regardless of the application. Session paths require PHP 5.4.0 or higher, and request variable handling paths require PHP 7.3 or higher.
Apache + PHP-FPM (mod_proxy_fcgi) O Remote code execution is possible in applications where decoding occurs, such as with session_start() and unserialize(). Major applications like WordPress and phpMyAdmin fall under this category.
Nginx + PHP-FPM O Same as Apache + PHP-FPM. Attacks may become easier if client_max_body_size is increased or fastcgi_request_buffering is set to off.
Nginx + mod_php N/A Nginx does not support mod_php

O Vulnerable · N/A Not applicable.

  • Applications in which the original reporters confirmed remote code execution: WordPress, Drupal, Joomla, MediaWiki, Roundcube, Magento, phpMyAdmin, Nextcloud, Laravel, Symfony, WHMCS.

    • This list is only what was demonstrated; the vulnerability is in PHP itself.

  • Additionally, a vulnerability that reads process memory, separate from remote code execution, has also been disclosed.

2.2 Configuration Check Script (Attachment: php2shell_check.php)

⚠️

Caution: Do not check from the command line (php -v, php -i).

Command-line PHP reads different configuration files from the web service. A fix may appear applied on the command line while the actual web service remains unpatched, leaving the server vulnerable while it is assumed to be fixed.

  1. Replace the $TOKEN value inside the script with an arbitrary string. If not replaced, it returns only 404.

  2. Save it with a difficult-to-guess filename (e.g., chk-8f3a2c.php) and upload it to the same directory as the app entry point (index.php).

  3. Access https://<domain>/<filename>.php?k=<TOKEN> in a browser.

  4. Once verification is complete, delete it immediately.

If there are multiple sites (vhosts, PHP-FPM pools), each must be checked separately. The output can be read as follows.

PHP2Shell Configuration Check
Output items Next steps
PATCH = Not applied / No official release 3.1 Apply the Patch
MITIGATION = Not applied Apply the 3.2 temporary mitigation until patched
SAPI Find my environment in the 3.2 Application Location table
session.save_path, error_log Paths to use in 3.4 Checking for Compromise

⚠️

Caution: Distribution packages (Ubuntu, RHEL, etc.) sometimes backport only the security fix while keeping the version number unchanged. Even if the script reports Not applied, check the distribution's security advisory as well.

3. Measures

Patching is the only fundamental fix. Beyond the published bug, further variants following the same pattern are known to exist, and the official patch fixes the shared root cause, blocking the variants as well. The temporary mitigations and WAF rules below are only a way to buy time until the patch is applied.

3.1 (P0) Apply the Patch

  1. Update PHP 8.2 through 8.5 to the fixed versions (8.5.12 / 8.4.27 / 8.3.36 / 8.2.35). For update instructions based on operating system and distribution, refer to the official PHP security announcement (Notice 1, Notice 2).

  2. Restart Apache or PHP-FPM after updating. Without a restart, the previous version keeps running.

  3. For containers, rebuild the base image and redeploy.

  4. Re-check the version with the 2.2 script.

  5. There is no official PHP release for 8.1 or earlier. First check whether the distribution or LTS vendor provides a security update. If not, the rule is to upgrade to a supported version, applying the 3.2 temporary mitigation until then. Security support for 8.2 also ends at the end of 2026, so 8.3 or later is the better target.

3.2 (P1) Temporary Mitigation Until Patched (Partial)

Xint's reproduction results have been added to the temporary mitigation proposed by Calif. It blocks only some attack paths and does not cover variants. The settings to apply depend on the execution method (the SAPI value from the 2.2 script).

Execution method Calif recommendations Xint additional recommendation
mod_php (apache2handler) memory_limit = -1 session.auto_start = 0
PHP-FPM (fpm-fcgi), CGI/FastCGI (cgi-fcgi) session.upload_progress.enabled = 0 + memory_limit = -1 session.auto_start = 0
  • Why does session.auto_start also need to be off?

    • In Xint's reproduction, servers with session.auto_start = On remained vulnerable even with session.upload_progress.enabled turned off. Because sessions start automatically, the session handling the attack relies on runs on every request.

⚠️

Caution: memory_limit = -1 removes PHP's memory limit.

A single request can consume all of the server's memory, potentially leading to a Denial of Service (DoS) attack. Be sure to set an OS-level memory limit as well.

  • Container: Memory limit (--memory, Kubernetes resources.limits.memory)

  • systemd: service unit MemoryMax

  • PHP-FPM: adjust pm.max_children to the server’s memory

  • Apache: adjust MaxRequestWorkers to the server’s memory

⚠️

Caution: check before turning off session.auto_start.

If the code uses $_SESSION without calling session_start(), session features such as login or the shopping cart will stop the moment session.auto_start is turned off.

# Files that use sessions
grep -rln '\$_SESSION' /var/www

# Files that call session_start() directly
grep -rln 'session_start' /var/www

If session_start() already exists in a common include file (config, header, etc.), session.auto_start can be turned off right away. Otherwise, add session_start() at the very top of the common include file first, then set session.auto_start to 0. After the change, login and other session features must be tested. No further action is needed on servers where it is already off (the default is Off). Environments that use ob_start(); or similar functions should be adjusted according to the session_start() page in the PHP manual.

Once session.upload_progress.enabled = 0 is applied, features that query the server for upload progress may stop working. Progress calculated in the browser (JavaScript) is unaffected.

Application Location

SAPI Where to apply Takes effect
apache2handler (mod_php) In the Apache configuration (vhost, etc.): php_admin_value memory_limit -1, php_admin_flag session.auto_start off After restarting Apache
fpm-fcgi (PHP-FPM) In the pool configuration: php_admin_value[memory_limit] = -1, php_admin_flag[session.upload_progress.enabled] = off, php_admin_flag[session.auto_start] = off After restarting PHP-FPM
cgi-fcgi (CGI/FastCGI) php.ini, or .user.ini in the web root .user.ini: up to 5 minutes
Container Add an .ini file to conf.d in the image After rebuilding and redeploying
  • Use php_admin_value / php_admin_flag where possible. If the application lowers memory_limit again via ini_set(), the mitigation is lost; admin settings cannot be overridden from code.

  • Shared hosting: if the settings cannot be changed directly, or the script output does not change after they are, the hosting provider has locked the configuration. Ask the provider for its PHP update schedule and to apply the temporary mitigation.

    ✅ After applying, re-check with the 2.2 script.

3.3 (P1) WAF/Web Server Configuration (Temporary Mitigation)

WAF

  • First check the managed rules from the WAF or CDN vendor in use. Major vendors such as Cloudflare, Akamai, and AWS prepared rules for this vulnerability in advance. Whether they are actually active on a given account must be verified in the vendor's announcement or management console.

  • For custom rules, block the following patterns:

    • Requests whose body contains the string PHP_SESSION_UPLOAD_PROGRESS (or the custom name, if session.upload_progress.name was changed on the server)

    • Field names with deeply nested square brackets (a[b][c][d]...)

    • Multipart requests containing a large number of empty parts with filename=""

⚠️

Caution: WAF detection is very easy to evade with charset variations, large payloads, or RFC 2231/5987 encoding. Rules alone cannot fully block the attack and should be treated as a stopgap until the patch is applied.

Apache

  • Apache passes chunked HTTP/1.1 and HTTP/2 multipart requests, which carry no length information, straight to PHP. PHP's post_max_size check only looks at the declared length, so it can be bypassed this way. Limit the request body with LimitRequestBody to what the service actually needs.

Nginx + PHP-FPM

  • Keep client_max_body_size at the minimum the service needs, and raise it only per location for paths that require large uploads.

  • Keep fastcgi_request_buffering at its default (on).

3.4 Checking for Compromise

Check immediately, alongside patching. This vulnerability operates below the application layer, so it leaves almost no trace in application logs; PHP and web server logs must be examined. Failed attacks also leave traces in those logs.

① Abnormal memory exhaustion errors

A normal memory exhaustion error includes the PHP filename and line number. One reported in Unknown on line 0 occurred before the request was processed and is likely an attack. This mostly appears with mod_php attacks.

grep -cE 'Allowed memory size of [0-9]+ bytes exhausted.*in Unknown on line 0' \
  /var/log/php_errors.log /var/log/apache2/error.log /var/log/httpd/error_log \
  /var/log/php*-fpm.log 2>/dev/null

With PHP-FPM attacks, the memory exhaustion happens while the application is running, so an actual filename is printed. Repeated memory exhaustion around session or unserialize() code is also suspicious.

② Crashes and abnormal worker termination

grep -E "Segmentation fault|signal 11|SIGSEGV" \
  /var/log/apache2/error.log /var/log/httpd/error_log /var/log/php*-fpm.log 2>/dev/null
dmesg | grep -i segfault | grep -E "php|httpd|apache2"

③ Anomalies in requests and responses

  • Repeated memory exhaustion errors or HTTP 500s immediately after unusual multipart requests

  • Abnormally long or corrupted PHPSESSID cookies in responses (a trace of the memory disclosure attack; check WAF or proxy logs)

  • A surge in unexplained PHP worker restarts

④ Abnormally large session file

Use the session.save_path value from the 2.2 script as the session save path.

find <session save path> -name 'sess_*' -size +1M -exec ls -lh {} \;

⚠️

Session files become eligible for cleanup after 24 minutes by default (session.gc_maxlifetime = 1440 seconds). This check becomes unreliable as time passes after an attack, so run it as early as possible.

⑤ Traces after Infringement

# Processes running as the web server account (use the account for the environment: www-data, apache, nginx, etc.)
ps -u www-data -o pid,ppid,lstart,cmd

# PHP files changed in the last 3 days (web shells, tampering)
find /var/www -name '*.php' -mtime -3 -ls

# Outbound connections from web server and PHP processes
ss -tnp | grep -E "php|httpd|apache2|nginx"

If traces are found, isolate the server from the internet and preserve the logs. Since memory may have been exposed, secrets such as DB passwords, API keys, and session/encryption keys must also be rotated.

4. References