November 22, 2026

Critical "php2shell" Vulnerabilities Trigger Emergency PHP Security Updates to Prevent Remote Execution

The risk level for this vulnerability varies depending on the Server API (SAPI) being used. Systems running PHP as an Apache module (mod_php) are considered to be at the highest risk because the PHP interpreter shares the same process space as the web server itself. Other common configurations, such as PHP-FPM, php-cgi, FrankenPHP, and LiteSpeed, are also vulnerable, though the isolation of the FPM process provides a slightly different security profile. The fix implemented in the new PHP versions involves a significant change to how memory is managed: the longjmp() OOM exit has been removed and replaced with a "soft OOM" that waits for a safe point in the virtual machine execution, paired with a "hard OOM" that terminates the process if a second, higher memory threshold is reached.

CVE-2026-109619: Use-After-Free via Stale Global State

The second vulnerability, CVE-2026-109619, addresses a "use-after-free" scenario involving the global state of the PHP worker. In a typical high-performance environment, a single PHP worker process handles many different web requests in sequence. To maintain efficiency, some global states—such as error handlers, session information, and extension-specific data—persist within the worker process.

According to the official security advisory, this global state sometimes contains pointers to memory that was owned by a previous request. Under normal circumstances, this state must be reset or cleared before the memory from that request is released back to the system. If this reset fails to occur, the worker process may enter a "stale" state where it still holds references to memory that has already been freed.

Exploitation of this flaw generally requires two stages. First, an attacker must trigger a condition that leaves a pointer to freed memory in the global state. Second, they must trigger an operation in a subsequent request that uses that stale pointer before the next request has had a chance to fully initialize its own state. The PHP team has confirmed that certain consumers of this state, such as the fatal_error_backtraces feature in PHP 8.5 and certain session upload progress trackers, are particularly susceptible.

A specific area of concern involves how configuration values (INI settings) are handled in PHP-FPM. While standard php.ini values are usually applied when a worker starts, certain web server configurations (like those in Nginx or Apache’s mod_proxy_fcgi) can send PHP_VALUE or PHP_ADMIN_VALUE parameters to FPM for every request. If these values are deprecated or invalid, they can raise a diagnostic error during the early stages of a request, potentially touching the stale memory and allowing an attacker to gain control of the execution flow.

Assessing the Risk and Identifying Vulnerable Systems

The impact of these vulnerabilities is severe. Successful exploitation allows an attacker to execute commands on the server with the same privileges as the user running the PHP process (often www-data or a specific site user). This can lead to full site compromise, data theft, and the use of the server as a jumping-off point for further attacks within an internal network.

Every PHP installation serving web requests is potentially at risk. Administrators are urged to check their current versions immediately. On Debian and Ubuntu systems, this can be done by checking the installed packages via dpkg or by running php -v in the command line. It is also vital to identify which PHP-FPM services are currently active and whether the web server is passing specific PHP values to the backend.