Безплатна диагностика при извършен ремонт · Бързи ремонти до 72 часа
VSV System Ltd. Computer equipment store and service – Balchik

PHP2Shell: Critical PHP Vulnerabilities and How to Patch Your Server

October 23, 2026 · 80 views

On October 21, 2026, PHP released 8.2.35, 8.3.36, 8.4.27 and 8.5.12. They fix two vulnerabilities rated CVSS 9.2 that allow unauthenticated code execution. Both are already being exploited in the wild.

In short: CVE-2026-109618 is a use-after-free during out-of-memory handling, and CVE-2026-109619 leaves global pointers referencing freed memory. One known path goes through session.upload_progress. No plugin or specific CMS is required — an affected PHP install reachable from the internet is enough.

Updating is the only complete fix. The workarounds below reduce risk; they do not close the hole.

Branch Affected Fixed in
PHP 8.5 < 8.5.12 8.5.12
PHP 8.4 < 8.4.27 8.4.27
PHP 8.3 < 8.3.36 8.3.36
PHP 8.2 < 8.2.35 8.2.35

Distributions backport the patch without changing the version number. Ubuntu 22.04 still reports 8.1.2, but package 8.1.2-1ubuntu2.28 is already fixed. Check the package version, not just the output of php -v.

Check what you are running

php -v
for p in /usr/bin/php[0-9]*; do "$p" -v | head -n1; done

Debian and Ubuntu

sudo apt update
sudo apt full-upgrade -y

# replace 8.3 with your version
sudo systemctl restart php8.3-fpm

# if you use mod_php instead of PHP-FPM
sudo systemctl restart apache2

If the host runs several PHP versions, restart each one — php8.1-fpm, php8.2-fpm, php8.3-fpm.

Verify:

dpkg -l | grep -E 'php[0-9.]+-(fpm|cli|common)'
apt-cache policy php8.3-fpm

The installed package should be the fixed revision published on October 21. Compare it with these examples: Ubuntu 24.04 → 8.3.6-0ubuntu0.24.04.13, Ubuntu 22.04 → 8.1.2-1ubuntu2.28. Ubuntu 20.04 gets the fix only with Ubuntu Pro. Debian 12 and 13 have DSA-6574-1; Debian 11 LTS has DLA-4848-1.

Not sure which service runs PHP?

systemctl list-units --type=service | grep -i php

RHEL, AlmaLinux, Rocky Linux, Oracle Linux and Fedora

sudo dnf --refresh upgrade -y
sudo systemctl restart php-fpm

Verify:

rpm -q php php-fpm
dnf module list php

Red Hat shipped the fix in RHSA-2026:87079 for php:8.3. AlmaLinux updated every stream it ships on October 21, and the RHEL-compatible rebuilds use the same packages and commands. Fedora has packages from October 21–22.

On RHEL 8, the php:7.2 stream has been unsupported for years and will not receive a patch. If a server still runs it, plan a move to 8.2 or 8.3. If dnf finds no update, confirm you are on a supported module stream and that the repository is reachable.

Amazon Linux

Amazon Linux 2023:

sudo dnf update --security -y
sudo systemctl restart php-fpm

Amazon Linux 2:

sudo yum update --security -y
sudo systemctl restart php-fpm

The fixes are ALAS2023-2026-3301 (php8.2), ALAS2023-2026-3302 (php8.3) and ALAS2PHP8.2-2026-015 for AL2.

Alpine Linux

sudo apk update
sudo apk upgrade

# use php84-fpm or php85-fpm if that is your branch
sudo rc-service php83-fpm restart

Fixed builds are php83 8.3.36-r0, php84 8.4.27-r0 and php85 8.5.12-r0 for Alpine 3.23, 3.24 and edge. An older release may not receive the patch — check its support status.

openSUSE and SUSE Linux Enterprise

sudo zypper refresh
sudo zypper update -y
sudo systemctl restart php-fpm

openSUSE Tumbleweed has php8 8.5.12. On SLES, check the current SUSE advisory.

Arch Linux

sudo pacman -Syu --noconfirm
sudo systemctl restart php-fpm

Containers

Change the tag in your Dockerfile to a fixed release:

FROM php:8.4.27-fpm

Then rebuild and redeploy:

docker compose build --pull --no-cache
docker compose up -d

In Kubernetes:

kubectl set image deployment/NAME php=php:8.4.27-fpm
kubectl rollout status deployment/NAME

Two common mistakes: docker pull does not update a running container, and an image pinned by digest stays vulnerable until you change the digest itself. In Kubernetes, also check imagePullPolicy — with IfNotPresent and a floating tag, a node can keep using a stale cached image.

cPanel and Plesk

sudo /scripts/upcp --force
rpm -qa | grep ea-php

Then check in WHM which PHP handler each account uses. The panel can be updated while an account still points at an old version.

Plesk for Linux:

sudo plesk installer --select-release-current --upgrade-installed-components

For Plesk on Windows, check the vendor page — there was no final release at the time of writing.

If you cannot patch right now

Disable upload progress and restart the workers.

Debian/Ubuntu:

echo 'session.upload_progress.enabled=Off' | sudo tee /etc/php/8.3/fpm/conf.d/99-php2shell.ini
sudo systemctl restart php8.3-fpm

RHEL and derivatives:

echo 'session.upload_progress.enabled=Off' | sudo tee /etc/php.d/99-php2shell.ini
sudo systemctl restart php-fpm

The restart is mandatory — the change does not affect processes that are already running. Also add a cgroup or container memory limit that covers requests without Content-Length. If the server is public and you cannot patch within hours, restrict access to it.

None of this is a complete fix. Only the update is.

Final check

php -v
php -r 'echo PHP_VERSION, PHP_EOL;'

Expected: 8.2.35, 8.3.36, 8.4.27 or 8.5.12 if you updated from php.net. A distro package may keep an older-looking number — in that case, use the package check above.

Sources

Related articles

You may also find these useful: