php2shell - Two unauthenticated remote code execution flaws in PHP (CVE-2026-109618 / CVE-2026-109619)

Two critical vulnerabilities, grouped under the name php2shell, were disclosed on 21 October 2026. Referenced CVE-2026-109618 and CVE-2026-109619 (both rated CVSS v4.0 9.2), they allow unauthenticated remote code execution on a web server running PHP. According to the PHP team, all installations serving web requests are exposed, and a working exploit has been demonstrated against mod_php.

NCSC-NL (the Dutch National Cyber Security Centre) maintains a dedicated public repository centralizing operational information and affected-product tracking.

Technical details

Both flaws affect the core PHP interpreter and can be triggered before application code even runs:

  • CVE-2026-109618 (memory / OOM corruption): out-of-memory handling can interrupt PHP while a request’s internal data is only partially initialized. Request cleanup may then treat that invalid data as valid. (GHSA-w8hw-w9fx-j79w)
  • CVE-2026-109619 (stale global state): 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. (GHSA-6wmf-4rv5-p3rp)

What makes php2shell particularly serious:

  • Unauthenticated: no login or legitimate user interaction is required.
  • Before application code: risk is rated highest for mod_php, where exploitation can occur before the application itself runs - so a web application firewall or in-code access control does not protect against it.
  • Very wide surface: all integration methods (SAPIs) are affected - PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed.
  • Embedded components: many appliances and vendor products embed PHP, sometimes with no way for the administrator to update it directly.

Affected systems

Any PHP installation serving web requests is potentially affected. The following versions fix both flaws (released 21 October 2026):

PHP branchFixed version
PHP 8.58.5.12
PHP 8.48.4.27
PHP 8.38.3.36
PHP 8.28.2.35

PHP 8.1 and earlier are no longer supported upstream. Minimal source backports have nonetheless been published on GitHub for 7.4, 8.0 and 8.1 (branches PHP-7.4-CVE-2026-109618-109619, etc.), and long-term-support distributions or vendors may provide their own patches. Note: PHP 8.2 reaches end of life on 31 December 2026 and will receive no further security fixes after that date - plan a version upgrade.

Actions to take

1. Update PHP (priority action)

Apply the update to a fixed version through your distribution’s standard channels, then restart the web service (PHP-FPM, Apache, or the affected appliance) for the fix to take effect.

2. Check your PHP version

php -v

Compare against the fixed version for your branch. On the web server side, also check the version actually served (it may differ from the command line):

php-fpm -v

3. Inventory embedded components

Network appliances, hardware devices and third-party Docker images often embed their own PHP. Treat them separately and apply vendor updates as they become available. Fortinet in particular has opened an investigation across several products (reference FG-IR-26-186).

4. Temporary mitigation

If the update cannot be applied immediately, PHP offers mitigations. They do not make an installation safe: only an update is a complete solution. Every change must be applied before request parsing (via php.ini, an FPM pool or server configuration - not ini_set() or .user.ini), followed by restarting every worker.

For CVE-2026-109618 (memory corruption):

; Removes the attacker-controllable memory limit (preferably non-overridable)
php_admin_value[memory_limit] = -1

; Reduce POST request size
post_max_size = 8M        ; if no file uploads are needed
; post_max_size = 32M     ; if file uploads are required
; upload_max_filesize must stay below post_max_size

Also consider enforcing limits at the web server or proxy level: decoded request size, input field count, multipart part count, header count and nesting depth. These limits must also cover requests without a usable Content-Length.

Use a container or cgroup limit as an availability boundary (do not substitute RLIMIT_AS/RLIMIT_DATA, which can themselves trigger the vulnerable path).

For CVE-2026-109619 (stale state):

session.upload_progress.enabled = 0
fatal_error_backtraces = 0   ; PHP 8.5 only

Hiding diagnostics with error_reporting, display_errors or @ provides no protection.

Heavy Mind managed IT clients

Web servers under Heavy Mind managed IT contracts received immediate attention. PHP versions have been audited across all environments, and patches are being deployed with scheduled service restarts. No action is required on your part.

Not a managed IT client?

We can assist you with this vulnerability - and beyond. Heavy Mind offers:

  • Web server audit: inventory of PHP versions, SAPIs in use and exposed embedded components
  • Patch deployment: controlled rollout with regression testing and scheduled restarts
  • Monitoring setup: alerts as soon as a security fix is available in your distribution’s packages

Let's talk about your needs and build the right solution together.

Contact us

Sources: NCSC-NL - php2shell · PHP Security Advisory (21/10/2026) · PHP Downloads