Back to Blog

PHP2Shell: Two Critical PHP Vulnerabilities Disclosed on October 21, 2026—and How to Fix Them on Every System

October 22, 202625 min readBy AnimaTow
PHP2Shell: Two Critical PHP Vulnerabilities Disclosed on October 21, 2026—and How to Fix Them on Every System

Two critical PHP vulnerabilities explained: affected systems, security updates, emergency measures, and practical verification steps. Technically reviewed on October 22, 2026, with direct sources and clearly marked unresolved claims.


Technical review date: October 22, 2026. Package availability may change; unresolved or conflicting claims are explicitly marked. Commands were checked against documentation, not executed on every listed system.

On October 21, 2026, at 14:00 UTC, the PHP project released four security updates: PHP 8.5.12, 8.4.27, 8.3.36, and 8.2.35. They address two vulnerabilities that can allow an unauthenticated attacker to execute arbitrary code on a web server. Both are rated critical, with a CVSS v4.0 score of 9.2. Security researchers, including Qualys, refer to them collectively as “PHP2Shell.” The flaws are in PHP itself, not in WordPress, Laravel, or any other application. Every installation that handles web requests is affected, whether it runs on Linux, FreeBSD, Windows, or macOS.

This article explains what went wrong, why Apache with mod_php faces the greatest risk, how to update your system, and which emergency measures can help if you cannot install the update immediately.

Key Points

  • Two vulnerabilities: CVE-2026-109618 (memory corruption under out-of-memory conditions) and CVE-2026-109619 (stale state carried over between requests).
  • Either vulnerability can independently lead to code execution with the privileges of the web worker, without a login, through an ordinary HTTP request.
  • The fix: update to PHP 8.5.12, 8.4.27, 8.3.36, or 8.2.35, or install your distribution’s patched package, then restart all PHP processes.
  • PHP 8.1 and older no longer receive new releases from the PHP project. Only minimal source-level backports are available for 7.4, 8.0, and 8.1. Anyone running these versions needs a patch from their vendor or an upgrade.
  • There is no complete remedy other than updating. The emergency measures below only reduce the risk.
  • The CVE identifiers were circulating publicly on October 20 from around 15:00 UTC. Amazon Threat Intelligence now reports initial observed exploit attempts as early as October 17 and subsequent widespread exploitation. Earlier statements about a lack of confirmed successful attacks are not a current all-clear.

What “PHP2Shell” Means

The nickname captures the severity in a single word. “Shell” refers to the server’s command line—in other words, control over the system within the privileges granted to the web server. “PHP2Shell” essentially means going from an ordinary request to a PHP page to running arbitrary commands on the server. That is exactly what “unauthenticated remote code execution” means, the most serious category of web vulnerability.

Three characteristics make this class of vulnerability so serious, and all three apply here:

  • Unauthenticated. The attacker does not need an account, a password, or a valid token. An ordinary HTTP request is enough, just like one any visitor can send.
  • Remote. The server only needs to be reachable over the network. No one needs prior access to the system.
  • Code execution. The result is attacker-controlled code running with the web worker’s privileges. What that allows depends on those privileges: reading and writing files in the web directory, extracting database credentials from configuration files, downloading additional tools, and moving through the network.

For perspective, imagine a rough scale from minor to catastrophic: a vulnerability that only exposes error messages sits at the bottom. Above that are read access to individual files and the takeover of a logged-in account. “Shell” sits at the top because the compromise is no longer limited to a single feature—it reaches the server itself. CVSS assigns a score of 9.2 rather than 10 because the attack is considered complex and dependent on specific conditions. That makes little practical difference for operators.

No configuration or application code can reliably protect a vulnerable PHP version. Nor does it help to think your site is too uninteresting to target: these attacks are automated and indiscriminate, hitting anything that responds. The only reliable protection is a patched PHP version.

Vulnerability 1: CVE-2026-109618—Memory Corruption Under Out-of-Memory Conditions

PHP limits the memory available to each request through memory_limit. When a request reaches that limit, PHP abruptly stops processing it. That is where the flaw lies: if the interruption occurs while internal request data is only partially initialized, the subsequent cleanup routine traverses unfinished structures and treats them as valid. The result is memory corruption.

The trigger can be reached remotely. Specially crafted multipart requests can exhaust memory even when their apparent size falls within the configured limits. Application code that allocates memory based on user input can also trigger the vulnerable error path.

Why Apache with mod_php is at the greatest risk: mod_php runs the cleanup routine even when request startup has already failed. The attack demonstrated by the researchers therefore works with default settings before a single line of application code runs. PHP-FPM terminates a worker when startup fails, blocking this particular route. After a successful startup, however, FPM is also vulnerable. Conflicting sources on a complete FPM exploit: The PHP Foundation reports confirmed code execution through application paths, whereas the OOM advisory describes a complete FPM exploit as not yet demonstrated. This discrepancy remains unresolved as of the review date. FPM still needs to be patched.

Vulnerability 2: CVE-2026-109619—Stale State Between Requests

PHP workers handle many requests in sequence. Memory is freed after each request, but internal pointers are not always reset. A fatal error at the wrong moment can interrupt cleanup. A non-fatal diagnostic late in shutdown can also repopulate state that has already been cleared; a fatal error is therefore not a necessary condition. The next request handled by the same worker can then access memory that has already been freed, before normal initialization resets the relevant state. This is a use-after-free vulnerability across request boundaries.

Two paths have been confirmed:

  • On PHP 8.5 with mod_php, the fatal_error_backtraces feature, enabled by default, accesses stale backtrace data during a later diagnostic.
  • On both mod_php and FPM, upload progress tracking (session.upload_progress, enabled by default) can use stale session or decoder state before it has been initialized. The application does not even need to call session_start().

Under FPM, one request must leave stale state behind, and a later request on the same worker must use it before reinitialization. Interrupted shutdown or state repopulated late in shutdown can cause this. Having many workers and recycling them regularly reduces the likelihood of a successful attempt, but does not eliminate the problem. PHP advisory.

Researchers have also demonstrated that these vulnerabilities can be used to read the memory contents of a PHP worker without authentication. That memory may contain passwords, tokens, and API keys.

Who Is Affected?

All PHP installations that handle web requests: Apache with mod_php; PHP-FPM behind nginx, Apache, or Caddy; php-cgi; IIS with FastCGI; FrankenPHP; and LiteSpeed. In terms of risk, mod_php comes first, followed by FPM and the other configurations.

For the Flare community, this specifically includes explorer frontends, community websites, WordPress blogs, forums, PHP-based monitoring dashboards, and anything served through PHP by a hosting provider. Not independently verified: According to project information, ftso.app runs on Node.js. Node.js itself is not the target of these PHP vulnerabilities; however, this review did not include a complete inventory of the production environment and its auxiliary components. Still, check everything else you run alongside your Flare node, including administrative interfaces and hosting panels.

How to Fix It: Overview

  1. Identify which PHP version actually handles web requests. The command line and the web server often use different installations.
  2. Install the patched version. On Linux distributions, what matters is the patched package; its displayed version number may still look older.
  3. Restart all PHP processes. Updating files on disk does not protect you while old processes are still running.
  4. Verify that the new code is actually running.

Commands for each system are listed in Technical Part 2. Three pitfalls to keep in mind first:

  • Automatic updates do not necessarily cover PHP from additional repositories. Ubuntu Unattended Upgrades exclude third-party origins by default, but allowed origins are configurable. For ondrej/php, check the local configuration; for Remi, check the update policy on the relevant RPM-based system. Ubuntu documentation.
  • Managed hosting providers and panels such as Plesk, cPanel, or CloudLinux distribute their own PHP packages. Unresolved: Current availability of all four patched branches has not been independently confirmed for every vendor. Ask your host rather than guessing.
  • PHP 8.2 reaches end of support on December 31, 2026. If you are moving to 8.2.35 now, plan an upgrade to 8.3 or newer at the same time.

Emergency Measures If You Cannot Update Immediately

The PHP project is explicit: these measures do not make an installation safe. They reduce the attack surface until the update is installed. Ready-to-use configuration snippets are provided in Technical Part 2, Step 5.

For CVE-2026-109618:

  • Set memory_limit=-1 in a way that applications cannot override: use php_admin_value in the FPM pool or Apache configuration. This removes the predictable per-request PHP memory cap. Actual memory exhaustion or failed allocations remain possible; the vulnerable error path is not completely eliminated. PHP advisory.
  • Since the memory limit is then disabled, restrict request sizes: use post_max_size = 8M for applications without uploads, or 32M if uploads are required, with upload_max_filesize set lower.
  • At the web server, proxy, or web application firewall, also limit request body size, the number of input fields and multipart parts, and nesting depth. Block multipart requests if the application does not need them.
  • Do not use RLIMIT_AS or RLIMIT_DATA as a substitute. Those limits trigger the very error path that is vulnerable. Container or cgroup memory limits are, at most, a coarse safeguard, not a replacement: hitting one can terminate the master process and all its workers.

For CVE-2026-109619:

  • Set session.upload_progress.enabled=0 and restart every worker. This must be configured in php.ini, the FPM pool, or the server configuration, before request processing begins. ini_set() in application code and .user.ini take effect too late.
  • On PHP 8.5, also set fatal_error_backtraces=0 and restart.
  • Eliminate fatal errors and timeouts that an attacker can trigger, and remove invalid or obsolete per-directory settings. Merely hiding errors through error_reporting, display_errors, or @ does not help: the stale state remains accessible.
  • Under FPM, pm.max_requests=1 can help if performance allows it: each worker then handles only one request, so there is no “next request on the same worker.”

If even that is not possible, put the service behind authentication or a VPN, or take it offline until the update is available.

After Updating: Check Whether Someone Has Already Gotten In

The CVE identifiers and a demonstration video were public before release. AWS reports initial observed exploit attempts on October 17: include at least that period in the investigation where logs are available. The absence of a log entry does not prove that nothing happened. Useful steps include:

  • Check web server logs for unusual multipart POST requests, very large or deeply nested requests, and requests containing the PHP_SESSION_UPLOAD_PROGRESS field, the default name used by upload progress tracking.
  • Look for new or modified PHP files in the webroot, upload directories, and temporary directories. A file integrity comparison against the deployed version can help.
  • Rotate secrets that were held in worker memory: database passwords, API keys, and session secrets.
  • Check for unknown processes, scheduled tasks, and outbound connections from the web server. Under PHP-FPM, a worker should not normally spawn child processes of its own.

Technical Part 1: The Root Causes and How PHP Fixed Them

Root Cause 1: Aborting on Memory Exhaustion

Previously, when memory ran out, PHP immediately aborted a request by jumping back through all call levels to the request handler. None of the intervening functions had a chance to finish initializing or discard their partially constructed structures. Normal request shutdown then ran over those same structures because, from its perspective, the request was “finished.” During shutdown, PHP read fields that had never been set and made decisions based on them. The failed memory allocation did not even need to be related to the affected structures; the timing alone was what mattered.

According to advisory GHSA-w8hw-w9fx-j79w, the PHP project fixed this as follows:

  • The immediate jump-based abort on memory exhaustion has been removed. There is no longer a path that jumps out in the middle of incomplete initialization.
  • Instead, there is a “soft” out-of-memory condition: PHP records the error and ends the request at the next safe point in the virtual machine, once all structures are consistent.
  • There is also a “hard” out-of-memory condition: if usage exceeds a second, higher threshold, the worker immediately terminates with _exit(). A dead worker is preferable to a corrupted one.

Root Cause 2: State That Survives the Request

A PHP worker handles many requests in sequence, using request-scoped memory that is freed completely at the end of each request. Some of the worker’s global variables, however, point into that memory: error state, backtrace data used by fatal_error_backtraces, and session and decoder state used by upload progress tracking. Normally, these are reset during shutdown. If a fatal error interrupts shutdown, a pointer can remain even though the memory is freed. Non-fatal diagnostics can also repopulate cleared state late in shutdown. The next request on that worker reads the pointer in code that runs before normal request initialization—for example, while applying INI settings or tracking upload progress. This is why suppressing warnings does not help: the access happens before PHP decides whether to display the warning.

According to GHSA-6wmf-4rv5-p3rp, the fix is a complete state reset: all affected global fields are reliably reset between requests, regardless of whether the previous request’s shutdown completed normally or ended with a fatal error. This also covers state that a non-fatal diagnostic had repopulated after it was reset.

Why There Are Two Separate CVEs

Both vulnerabilities involve invalid data in the request lifecycle, but operate differently and can be exploited independently. The first affects incompletely initialized structures during memory exhaustion within one request and is reachable on mod_php before application code runs. The second involves stale state across two requests on the same worker; a fatal error is not always required. That is why there are two CVE identifiers, two advisories, and two separate sets of emergency measures.

Technical Part 2: Step-by-Step Remediation for Every System

Step 1: Find Out What Is Actually Running

The PHP version on the command line tells you nothing about the version serving your websites. Check both.

Linux and FreeBSD:

php -v
php-fpm8.3 -v      # Executable name depends on the system: php-fpm, php-fpm8.3, php83-fpm
ps -eo pid,user,cmd | grep -E '[p]hp-fpm|[h]ttpd|[a]pache2|[l]sphp|[f]rankenphp'

Is PHP running as an Apache module? If php_module (PHP 8) or php7_module (PHP 7) appears, you are using mod_php, the configuration with the highest risk:

apachectl -M 2>/dev/null | grep -i php

Windows (PowerShell):

php -v
where.exe php
Get-Process php-cgi, php, httpd -ErrorAction SilentlyContinue | Select-Object Name, Id, Path, StartTime

On IIS, the path to the php-cgi.exe in use appears under “FastCGI Settings” in IIS Manager. On Apache for Windows, the LoadModule php_module line in httpd.conf identifies the PHP installation being loaded.

macOS:

php -v
which -a php
brew list --versions | grep -i php

Tools that bundle PHP are a special case. FrankenPHP embeds PHP in its own executable, and Laravel Octane also stores a separate copy in the project directory. Check with:

frankenphp version

Step 2: Update

According to the PHP project, versions 8.5.12, 8.4.27, 8.3.36, and 8.2.35 are patched. Many distributions backport the fix into their existing version, leaving the version number unchanged. In that case, the relevant information is the package version listed in your distribution’s security advisory, not the output of php -v.

Debian and Ubuntu using distribution packages:

sudo apt-get update
apt list --upgradable 2>/dev/null | grep -i php
sudo apt-get install --only-upgrade 'php8.3*' libapache2-mod-php8.3

Repeat the command for each installed PHP version, and keep the quotation marks. To check whether the package contains the fix:

zgrep -E 'CVE-2026-10961[89]' /usr/share/doc/php8.3-fpm/changelog.Debian.gz

Notes on specific releases: According to Canonical, Ubuntu 24.04 includes the fix from package 8.3.6-0ubuntu0.24.04.13, and Ubuntu 22.04 from 8.1.2-1ubuntu2.28. Canonical lists Ubuntu Pro for Ubuntu 18.04 and 20.04. To check without applying a repair, use sudo pro fix CVE-2026-109618 --dry-run; without --dry-run, the command can make changes. Dry-run documentation.

Debian—time-sensitive status: The Security Tracker lists 8.4.27-1~deb13u1 as fixed for Debian 13 (trixie). For Debian 12 (bookworm, LTS), 8.2.34 was still listed as vulnerable in the retrieved snapshot; availability of a fixed package remains unresolved here and must be checked before updating. Debian’s LTS for Debian 11 ended on August 31, 2026; any commercial ELTS or vendor patches require separate verification.

Ubuntu and Debian using the ondrej/php repository (sury.org):

sudo apt-get update
sudo apt-get install --only-upgrade 'php8.3*'
dpkg -l 'php*' | awk '/^ii/ {print $2, $3}'

These sources are distinct: Ubuntu uses the ondrej/php PPA, while Debian uses packages.sury.org/php. Use the official source from Ondřej Surý appropriate for your distribution and release, and check the offered package candidate. Switching to ppa.launchpadcontent.net is relevant only to a mirrored Ubuntu PPA, not as an instruction for Debian. Unattended Upgrades include these third-party origins only when configured accordingly.

RHEL, Rocky Linux, AlmaLinux, Fedora:

rpm -qa 'php*' | sort
dnf module list --enabled php        # RHEL 8 and 9 only
sudo dnf upgrade 'php*'
dnf updateinfo list --security | grep -i php

With the Remi repository and parallel PHP installations, package names differ—for example, php84-php-fpm:

sudo dnf clean metadata
sudo dnf upgrade 'php84-*'

Be careful on RHEL 8: a plain dnf install php installs PHP 7.2, which no longer receives fixes. Red Hat packages may appear several days after the PHP release.

SUSE and openSUSE:

sudo zypper refresh
sudo zypper patch --cve=CVE-2026-109618
sudo zypper patch --cve=CVE-2026-109619

Arch Linux:

sudo pacman -Syu

Gentoo:

sudo emerge --sync
sudo glsa-check -l affected
sudo emerge -uDN @world

Alpine Linux:

apk update
apk upgrade
apk info -v | grep '^php'

The fix is not limited to Alpine 3.24 and edge: the official Alpine 3.23 package list includes php83 version 8.3.36-r0. Check the package actually offered for your Alpine release, architecture, and PHP branch; this does not imply availability for every older release.

FreeBSD:

On FreeBSD, PHP packages are named php82, php83, php84, or php85, depending on the version; the Apache module is named mod_php83, and so on. First, query the system’s security database. It shows whether the installed version is listed as vulnerable:

pkg audit -F
pkg info -g 'php*'
pkg update
pkg upgrade
pkg audit

If pkg audit still reports a vulnerability after the upgrade, the fix has not yet reached the package branch you are using. The Repositories section of pkg -vv shows whether your system uses quarterly or latest. You can then either wait briefly for the package or build it yourself from the current ports tree—for example, with make -C /usr/ports/lang/php83 deinstall reinstall clean. If you use jails, update each jail separately, for example with pkg -j webjail upgrade. If you build packages with poudriere, rebuild and redistribute them.

Windows:

A manual Windows update replaces the PHP files. Use the official Windows download page. Unresolved: Availability of suitable patched binaries for all four branches was not fully confirmed as of the review date. Check the version, architecture, TS/NTS variant, and checksum of the actual download. The variant you need depends on your web server:

  • IIS with FastCGI needs the NTS variant (non-thread-safe).
  • Apache for Windows with PHP loaded as a module needs the TS variant (thread-safe), which includes php8apache2_4.dll.
  • Almost all servers run 64-bit software, so choose the x64 file.

Procedure:

  1. Download the appropriate ZIP file from windows.php.net and compare its SHA-256 hash with the value on the download page:
Get-FileHash .\php-8.3.36-nts-Win32-x64.zip -Algorithm SHA256

The exact filename also includes the compiler version and varies by PHP branch.

  1. Extract it into a new folder, for example C:\php\8.3.36. Copy your existing php.ini and any additional extensions from the old folder.
  2. Point the web server to the new folder: on IIS, update the path to php-cgi.exe in both FastCGI Settings and the handler mapping; on Apache, update the paths in LoadModule and PHPIniDir. If you overwrite the old folder directly, make a backup copy first.
  3. New builds may require an up-to-date Microsoft Visual C++ Redistributable. If it is missing, PHP fails to start with a missing-DLL error.

If you installed PHP through Chocolatey or Scoop, update it using that tool and verify the version afterward, since community packages can lag behind:

choco upgrade php
scoop update php
php -v

All-in-one packages such as XAMPP, WampServer, and Laragon bundle their own PHP and only receive new versions when the bundle is updated. According to published overviews, several of these packages still lacked the fix shortly after release. This is less urgent for development machines as long as they are not reachable over the network. If you run one of these bundles on a publicly accessible server, change that now: these packages are intended for local development, not production.

macOS:

Homebrew has updated all four branches:

brew update
brew upgrade php            # Or [email protected], [email protected] for older branches
brew services restart php

Laravel Herd updates PHP through its own settings. After a Homebrew update, restart Laravel Valet with valet restart. The same considerations apply to MAMP and XAMPP as on Windows.

Docker and containers:

First update the image reference actually used: set image: in Compose or FROM in the Dockerfile to a patched tag or digest, such as php:8.3.36-fpm. A separate docker pull does not change these references. For a Compose service using a prebuilt image without a local build:

docker compose pull
docker compose up -d --force-recreate

For a Compose service with a local build:, rebuild after changing FROM, then recreate the containers instead:

docker compose build --pull
docker compose up -d --force-recreate

--force-recreate alone does not guarantee a new image. See Docker’s documentation for pull, build, and up. Official tags follow the pattern php:8.3.36-fpm, php:8.3.36-apache, and php:8.3.36-cli. Unverified: Whether prereleases 8.5.12RC1 and 8.4.27RC1 contain the fix has not been independently confirmed; use the final security release or a fix explicitly confirmed by the vendor. Also check WordPress, Nextcloud, and Matomo images that bundle PHP.

FrankenPHP and Laravel Octane:

FrankenPHP embeds PHP in its own executable and is therefore not updated through apt or dnf. Install the new FrankenPHP release or Docker image and verify it with frankenphp version. With Laravel Octane, also delete the frankenphp file stored in the project directory and restart Octane; otherwise, the old copy will keep running.

LiteSpeed:

Update the lsphp packages for the relevant version, such as lsphp83, then terminate the running PHP processes so that LiteSpeed restarts them:

sudo pkill lsphp

Hosting panels and managed platforms:

For Plesk, cPanel EasyApache 4, CloudLinux alt-php, and other panels, verify the actual package version with the vendor; the panel’s own PHP and PHP serving hosted sites may be separate installations. Unresolved: Complete confirmation of every patched branch for each vendor is not available. AWS does not automatically update Lightsail instances. Depending on the blueprint, the operating system and PHP can be updated within the existing instance. A new instance from an updated template is one possible migration strategy, not a universal requirement.

Step 3: Restart All PHP Processes

The update replaces files on disk. Existing processes continue running the old code until they are restarted. With Apache and mod_php, a graceful restart or reload is not enough: Apache needs a full restart. For PHP-FPM, a reload is sufficient.

Linux with systemd:

sudo systemctl restart php8.3-fpm     # Debian, Ubuntu; repeat for each installed version
sudo systemctl restart php-fpm        # RHEL, Rocky, Alma, Fedora
sudo systemctl restart php84-php-fpm  # Remi with parallel versions
sudo systemctl restart apache2        # Debian, Ubuntu with mod_php
sudo systemctl restart httpd          # RHEL family with mod_php

To restart all FPM services at once when multiple versions run side by side:

systemctl list-units --type=service --no-legend 'php*fpm*' | awk '{print $1}' | xargs -r sudo systemctl restart

Alpine with OpenRC:

rc-service php-fpm83 restart

FreeBSD:

service php_fpm restart
service apache24 restart
service -j webjail php_fpm restart     # Inside a jail

Windows:

iisreset /restart                              # Restart all of IIS
Restart-WebAppPool -Name "DefaultAppPool"      # Restart a single application pool
Restart-Service Apache2.4                      # Apache service; the name may differ

macOS:

brew services restart php

Step 4: Verify

Check the version of the running process, not just the file on disk.

Process start times: All PHP processes must have started after the update.

ps -eo pid,lstart,cmd | grep -E '[p]hp-fpm: master|[a]pache2|[h]ttpd'

On Windows, Get-Process php-cgi | Select-Object Id, StartTime provides the same information.

Old executable files still in memory (Linux): A process still using an old PHP file that has since been replaced will appear here. The goal is empty output:

sudo grep -lE ' /(usr|lib|opt).*\(deleted\)$' /proc/[0-9]*/maps

On Debian and Ubuntu, sudo needrestart -b -r l shows which services still need to be restarted.

Version and settings as seen by the web server: php -v and php -i only describe the command-line installation, not the FPM pool or Apache module. For the actual website, create a protected test file, access it once, and delete it immediately afterward:

<?php
echo PHP_VERSION, "\n";
echo 'upload_progress: ', ini_get('session.upload_progress.enabled'), "\n";
echo 'memory_limit: ', ini_get('memory_limit'), "\n";

On distributions with a backported fix, PHP_VERSION still shows the old number. In that case, the package version from Step 2 and the process start times are what matter.

FreeBSD: pkg audit must no longer report PHP as vulnerable.

Step 5: Configure Emergency Measures Correctly If the Update Has to Wait

The settings must take effect before PHP processes the request. The correct location is therefore php.ini, the FPM pool, or the web server configuration—never ini_set() in application code and never .user.ini. php_admin_value ensures that an application cannot override the value.

PHP-FPM pool, for example /etc/php/8.3/fpm/pool.d/www.conf on Debian, /etc/php-fpm.d/www.conf on RHEL, or /usr/local/etc/php-fpm.d/www.conf on FreeBSD:

php_admin_value[memory_limit] = -1
php_admin_value[post_max_size] = 8M
php_admin_value[upload_max_filesize] = 4M
php_admin_flag[session.upload_progress.enabled] = off
; PHP 8.5 only:
php_admin_flag[fatal_error_backtraces] = off
; Optional, if performance allows:
pm.max_requests = 1

Apache with mod_php, in the VirtualHost or global configuration:

php_admin_value memory_limit -1
php_admin_value post_max_size 8M
php_admin_value upload_max_filesize 4M
php_admin_flag session.upload_progress.enabled off

Windows with IIS: IIS does not support php_admin_value. Put the values in the php.ini for the installation in use:

memory_limit = -1
post_max_size = 8M
upload_max_filesize = 4M
session.upload_progress.enabled = Off

IIS limitation: According to the PHP documentation, memory_limit is an INI_ALL setting and can be overridden by application code. Setting it in php.ini therefore does not enforce the same protection as php_admin_value. Check the effective configuration; this is not guaranteed protection.

Also limit request size in IIS, under “Request Filtering,” using “Maximum allowed content length,” or in web.config:

<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="8388608" />
    </requestFiltering>
  </security>
</system.webServer>

With nginx in front, prevent large requests from reaching PHP in the first place:

client_max_body_size 8m;

nginx cannot count multipart parts or their headers because they are inside the request body. That requires a web application firewall, such as ModSecurity with the OWASP Core Rule Set, or rules provided by a CDN vendor.

After every change, restart all PHP processes as described in Step 3.

Step 6: Harden the Application

An attacker-triggered fatal error can contribute to the second vulnerability, but it is not the only triggering sequence: non-fatal diagnostics late in shutdown also matter. Independently, bound memory usage and execution time that depend directly on input. Here are two typical patterns and their safer equivalents; they do not replace the PHP update.

Memory allocation whose size is controlled by the user:

// Risky: the count comes from the user without validation
$count = (int) $_GET['count'];
$rows = array_fill(0, $count, $template);

A safer version uses a fixed upper bound and a controlled error instead of running out of memory:

$count = filter_input(INPUT_GET, 'count', FILTER_VALIDATE_INT, [
    'options' => ['min_range' => 1, 'max_range' => 500],
]);
if ($count === false || $count === null) {
    http_response_code(400);
    exit('count must be between 1 and 500');
}
$rows = array_fill(0, $count, $template);

JSON without size or depth limits:

// Risky: no size limit, default depth of 512
$data = json_decode($body, true);

A safer version with size and depth limits and error handling:

if (strlen($body) > 65536) {
    http_response_code(413);
    exit('payload too large');
}
try {
    $data = json_decode($body, true, 32, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
    http_response_code(400);
    exit('invalid json');
}

The underlying rule: every operation whose memory or time requirements depend on input needs an upper bound that is checked before the operation runs. A controlled error response with status 400 is harmless; with these vulnerabilities, a fatal error becomes a tool for the attacker. The same applies to max_execution_time: long loops over user-supplied data belong in a background job, not in the request.

One point remains important even after updating: obsolete or invalid per-directory INI settings generate warnings when applied, before request initialization. Clean up .htaccess and .user.ini files that set directives no longer supported by your PHP version.

How This Happened

A PHP core developer found the first signs of the out-of-memory problem back in 2024 while following up on a Quarkslab security audit. On August 11, 2026, Calif and OpenAI independently reported the same underlying flaw with proof of code execution; Wiz followed on August 24. Disclosure was scheduled for October 22 at 14:00 UTC. Because the CVE identifiers started circulating online on October 20 from around 15:00 UTC with an incorrect time and severity rating, the PHP project moved the release forward to October 21 that same evening. A demonstration video then went online accidentally, and on the morning of October 21, an image provider shipped the fixes more than six hours before the official release time. The PHP Foundation has announced plans to further strengthen its security team and make decisions on difficult vulnerabilities more quickly. PHP Foundation.

Conclusion

Update, restart all PHP processes, and verify. That applies to every system, whether Linux, FreeBSD, Windows, or macOS. If you still run PHP 8.1 or older, this is the reason to make the upgrade that was due anyway. And if your PHP comes from an additional repository, an all-in-one bundle, or a hosting provider, do not rely on automatic updates—check for yourself.


Ratings


Comments

Connect your wallet to leave a comment.