![]() |
|
Guide PHP2Shell (CVE-2026-109618 & CVE-2026-109619): What It Is and How to Fix It - Printable Version +- AdminsForum (https://adminsforum.com) +-- Forum: Security and performance (https://adminsforum.com/Forum-security-and-performance) +--- Forum: Server security and hardening (https://adminsforum.com/Forum-server-security-and-hardening) +--- Thread: Guide PHP2Shell (CVE-2026-109618 & CVE-2026-109619): What It Is and How to Fix It (/Thread-guide-php2shell-cve-2026-109618-cve-2026-109619-what-it-is-and-how-to-fix-it) |
PHP2Shell (CVE-2026-109618 & CVE-2026-109619): What It Is and How to Fix It - JAY - 10-22-2026 PHP2Shell (CVE-2026-109618 and CVE-2026-109619): what it is and how to fix it On 21 October 2026 the PHP project released emergency updates for two critical vulnerabilities, nicknamed PHP2Shell. Together they can let an attacker run code on a server running PHP, without logging in. Attacks were seen before the patches came out, so if you run any PHP website, update today. This article explains the problem in plain language, which versions are fixed, and how to check and patch your server. We also have step-by-step guides for each hosting control panel (links at the bottom). The short version
What are the two vulnerabilities? CVE-2026-109618 (out-of-memory corruption). If PHP runs out of memory at the wrong moment while setting up a request, it can leave internal data half-built. The clean-up code then treats that broken data as valid, which an attacker can abuse. CVE-2026-109619 (stale global state). PHP can keep a pointer to request data after that memory is freed. A later request handled by the same PHP worker can then use the freed memory (a "use-after-free"). Researchers showed this can lead to code execution, and also to leaking the worker's memory, which may contain passwords, session tokens and API keys. Both bugs are in the PHP engine, so it doesn't matter which app you run. The PHP security team rated both 9.2 (critical). Apache with mod_php needs the most urgent attention, because an attack there can trigger before any of your application code even runs. Fixed versions
Code: 8.1.2-1ubuntu2.28Code: php -vStep 1: Find every PHP on your server Many servers have more than one PHP. A control panel may have one PHP per version, plus the system PHP, plus a separate PHP for LiteSpeed. Each one needs patching. It's easy to patch the panel's PHP and miss a second one, such as LiteSpeed's own PHP (lsphp). Useful checks: Code: php -v
ls /www/server/php/ 2>/dev/null # aaPanel
ls -d /usr/local/lsws/lsphp* 2>/dev/null # LiteSpeed / OpenLiteSpeed / CyberPanel
ls /etc/php/ 2>/dev/null # Debian/Ubuntu packages
ls -d /opt/cpanel/ea-php* /opt/plesk/php/* 2>/dev/null
ps aux | grep -E "php-fpm|lsphp|httpd" | grep -v grep | headStep 2: Update PHP Use your control panel or package manager. The exact steps differ per panel, so follow the guide for yours (links below). In general: Code: # Debian / Ubuntu
apt update && apt list --upgradable 2>/dev/null | grep -i php
apt install --only-upgrade 'php8.3*'
# AlmaLinux / Rocky / RHEL
dnf upgrade 'php*'Step 3: Restart PHP The update only protects you once the running PHP processes restart. This step is often forgotten. Code: systemctl restart php8.3-fpm # Debian/Ubuntu, one per version
systemctl restart php-fpm # RHEL family
systemctl restart apache2 # Apache with mod_php
pkill lsphp # LiteSpeed starts new workers automaticallyStep 4: Check that it worked Check the version the web server uses, not just the command line. Create a file in your website folder: Code: <?php echo PHP_VERSION;This command lists processes still running old, replaced PHP files. Empty output means everything restarted: Code: grep -lE ' /(usr|lib|opt|www).*\(deleted\)$' /proc/[0-9]*/maps 2>/dev/nullCode: needrestart -b -r lCan't update yet? Temporary protection These settings reduce the risk until you can update. They are not a full fix. Set them in the server's Code: php.iniCode: ini_set()Code: .user.iniCode: ; blocks the CVE-2026-109619 path
session.upload_progress.enabled = 0
; PHP 8.5 only
fatal_error_backtraces = 0Code: memory_limit = -1Were you already attacked? Attacks started on 17 October, before the fix existed. After patching, spend ten minutes checking:
Step-by-step guides for each control panel
Frequently asked questions Is WordPress affected? Yes. Any app running on a vulnerable PHP is exposed, because the bug is in PHP itself. Updating WordPress does not fix it; updating PHP does. Does Nginx with PHP-FPM protect me? No. PHP-FPM is affected too. mod_php is the highest risk, but every web-facing PHP should be updated. I updated, but php -v still shows the old number. Your distribution may back-port the fix without changing the version (check the package changelog), or Code: php -vShould I trust exploit code from GitHub? No. Unverified "proof of concept" code for these bugs is circulating and may contain malware. Don't run it on your servers. Questions about your setup? Ask in Server security and hardening or in the security support forum for your panel. Include your panel, OS and the output of Code: php -vSources (checked 22 October 2026): Tenable FAQ · Qualys: find, mitigate and patch PHP2Shell · Help Net Security · BleepingComputer |