On 21 October 2026 the PHP project released emergency security updates for two critical remote code execution flaws, CVE-2026-109618 and CVE-2026-109619, known together as PHP2Shell. An unauthenticated remote attacker can reach both, and PHP rates each of them 9.2 (Critical) on the CVSS v4.0 scale. Other vendors score them differently: NVD lists 9.8 on CVSS v3, and Red Hat rates its own builds Important, because exploitability depends on how PHP is deployed.

CVE-2026-109618 (advisory GHSA-w8hw-w9fx-j79w) is a memory-handling flaw. When PHP runs out of memory while it is still setting up a request, internal data can be left half-built, and later cleanup code treats it as valid. The PHP project is blunt about the remedy: there are no complete mitigations, and updating is the only safe choice. Reports say that technical details leaked a day before the fix, watchTowr reports exploitation on its honeypot network, and Palo Alto Networks counts more than 22.6 million exposed instances that are potentially vulnerable.

This guide is defensive only. It explains which versions to install, how to update and verify the result, and what to do if you cannot patch today.

Affected and fixed PHP versions

  • Fixed releases: PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, released on 21 October 2026.
  • Affected: every release that is older than the fixed release of its branch, for example any 8.5.x up to and including 8.5.11, and any 8.4 release before 8.4.27.
  • Affected and not patched by the PHP project: PHP 8.1 and older, which have reached end of life. watchTowr has confirmed that older branches, including PHP 5, are affected as well.
  • Vendor builds: Plesk published rebuilt packages of its end-of-life PHP 8.1.34, 8.0.30 and 7.4.33 on 21 October 2026. The version number stays the same and only the build date changes, so check both.

Linux distributions often fix a flaw without changing the upstream version number. A distribution package called 8.3.6 may already contain the fix, so check the package changelog and not only the output of php -v.

Step 1: Find out which PHP you run

php -v                       # version of the command-line PHP
php-fpm -v                   # PHP-FPM (the binary may be called php-fpm8.3)
apache2ctl -M | grep php     # shows whether mod_php is loaded in Apache

The command-line PHP can be a different version from the one your web server uses. Check mod_php, PHP-FPM and every container that runs PHP separately.

Step 2: Upgrade PHP

Debian and Ubuntu (APT)

sudo apt update
sudo apt install --only-upgrade 'php8.*'
apt changelog php8.3-cli | grep CVE-2026-109618

Upgrade all PHP packages together so that you do not end up with mixed versions. If the last command prints nothing, your repository has not published the fix yet. Check your distribution's security tracker, or use a maintained third-party repository that follows the upstream releases.

RHEL, Rocky Linux, AlmaLinux and CentOS (YUM and DNF)

sudo dnf update 'php*'
rpm -q --changelog php-fpm | grep CVE-2026-109618

On older systems, use yum update 'php*' instead. Red Hat's security page for this CVE shows the status of each of its products.

Docker

docker build --pull --no-cache -t myapp .
docker run --rm myapp php -v

Official PHP images for 8.5.12, 8.4.27, 8.3.36 and 8.2.35 exist, and moving tags such as php:8.4-apache point to them. Pulling a new image does not change running containers, so rebuild and redeploy every image that contains PHP.

Source builds, Windows and control panels

If you compile PHP yourself, build from the official tarball of a fixed release. On Windows, use the build from windows.php.net. If you use a control panel such as Plesk, update through the panel, because it ships its own PHP builds.

Step 3: Restart services and confirm the version

sudo systemctl restart php8.3-fpm
sudo systemctl restart apache2

Use httpd instead of apache2 on RHEL-based systems, and the name of your own PHP-FPM service. Running workers keep the old code until they are restarted, so a package update alone is not enough. Then repeat the checks from step 1.

Step 4: Verify downloads with SHA-256

Packages from APT and DNF are verified by the package manager. For a source tarball or a Windows archive that you download by hand, compare its SHA-256 hash with the value published on the PHP downloads page:

sha256sum php-8.4.27.tar.xz

# Windows PowerShell
Get-FileHash .\php-8.4.27.zip -Algorithm SHA256

Copy the expected hash from php.net over HTTPS, not from a forum, a mirror or a chat message, and compare the whole string. Hexadecimal is not case-sensitive. A match proves that your file is identical to the one the publisher listed. For stronger assurance, also verify the PGP signature of the release.

Step 5: If you cannot upgrade today

These measures only reduce exposure. They do not fix the flaw, and PHP states that no complete mitigation exists.

  • Patch the most exposed servers first. Commentary on the advisory says that the risk is highest for Apache with mod_php. Red Hat notes that PHP-FPM workers are harder to attack in practice. Do not treat that as a reason to wait.
  • Restrict access. Put non-public applications behind a VPN, an IP allowlist or authentication at the web server or the firewall, and take unused sites offline.
  • Reduce the request surface. The advisory title refers to multipart/form-data handling. On routes that do not need uploads, limit request sizes and block that content type at your reverse proxy or firewall.
  • Be careful with copied php.ini tricks. Some platforms disabled session.upload_progress as a stopgap for the companion CVE-2026-109619. Apply a setting only if your vendor recommends it, because it can break features. Do not remove the memory limit, as one platform suggested. That lets a single request use all the memory of the server.
  • Watch your logs. Look for PHP crashes, segmentation faults, out-of-memory errors and workers that restart without a reason.

Step 6: Check for signs of compromise

If a server was reachable before you patched it, patching alone is not enough, because it does not remove anything that was already planted. Look for PHP files that are new or changed since 20 October, especially in upload and cache directories, for unknown cron jobs and processes, and for unusual outgoing connections. Rotate database passwords, API keys and other secrets that the server could read. The absence of findings does not prove the absence of a problem.

Compare configuration fingerprints with the Hash Generator

After patching a group of servers, it helps to confirm that their configuration is identical. Paste the text of a small config file or a checksum line into the free Hash Generator to get its SHA-256 digest, and compare the digests between servers. The tool hashes the text that you paste. It cannot read a downloaded archive, so use sha256sum or Get-FileHash for the PHP package itself, as shown in step 4.

FAQs

Is PHP 8.1 receiving an official patch?

No. The PHP project is not releasing fixes for PHP 8.1 or older, which are end of life, and these versions remain affected. Some vendors rebuild old branches, as Plesk did on 21 October 2026, but you should plan to move to a supported branch, preferably 8.4 or 8.5.

How do I check my current PHP version?

Run php -v for the command-line version, php-fpm -v for PHP-FPM and check the loaded Apache modules for mod_php. Because distributions backport fixes, also search the package changelog for CVE-2026-109618, as shown in step 2.

Does a php.ini setting protect me completely?

No. PHP says there are no complete mitigations and that updating is the only safe choice. Settings and firewall rules can lower the exposure for a short time while you prepare the update.

Sources and update note

This guide was written on 23 October 2026 from these sources. Check them for changes, because the situation is still developing: