10-22-2026, 03:41 PM
How to Fix PHP2Shell (CVE-2026-109618/109619) on CloudPanel
On 21 October 2026 PHP released emergency fixes for two critical bugs, CVE-2026-109618 and CVE-2026-109619 ("PHP2Shell"). They can let an attacker run code on your server without logging in, and attacks are already happening. This guide shows how to patch a server running CloudPanel, step by step.
New to PHP2Shell? Read the overview first: PHP2Shell explained: what it is and how to fix it.
The fixed versions
Your PHP must be at least: 8.5.12, 8.4.27, 8.3.36 or 8.2.35. Older branches (7.4 to 8.1) need a patched build from your vendor. Update every PHP version installed, not just the one your main site uses.
Step 1: See which PHP versions you have
CloudPanel installs several PHP versions side by side as system packages. List them:
Step 2: Update PHP with apt
Take a snapshot of the server at your provider first. Then, as root:
If PHP packages are listed, install them:
Or update everything at once with , which we recommend anyway.
No PHP updates listed? The packages may not be published for your OS yet. Check again later today, and apply the temporary protection below in the meantime.
Step 3: Restart PHP-FPM
Restart every PHP version you updated, so the running workers load the fixed code:
The second command shows the PHP services on your server; make sure each one restarted.
Step 4: Confirm
Check the installed package version for each PHP:
Distribution packages sometimes keep the old version number while including the fix, so also check the package changelog for the CVE:
Check the version your websites really use
The command line can show a different PHP from the one serving websites. To be sure, create a file called in a website's folder containing:
Open , check the number, then delete the file.
Can't update yet? Temporary protection
These settings reduce the risk until a patched version is installed. They are not a full fix. Add them to the php.ini of each PHP version (), then restart PHP:
Don't set these with or a file; they must be set server-side. The PHP team also suggests against CVE-2026-109618, but that removes PHP's memory cap, so only use it short-term and with care.
After patching: check you weren't hit
Attacks started on 17 October, before the fix existed. Spend ten minutes on these checks:
Questions? Ask in CloudPanel Security Support with your OS, CloudPanel version and the output of your PHP version check.
Sources (checked 22 October 2026): Tenable PHP2Shell FAQ · Qualys: mitigate and patch PHP2Shell
On 21 October 2026 PHP released emergency fixes for two critical bugs, CVE-2026-109618 and CVE-2026-109619 ("PHP2Shell"). They can let an attacker run code on your server without logging in, and attacks are already happening. This guide shows how to patch a server running CloudPanel, step by step.
New to PHP2Shell? Read the overview first: PHP2Shell explained: what it is and how to fix it.
The fixed versions
Your PHP must be at least: 8.5.12, 8.4.27, 8.3.36 or 8.2.35. Older branches (7.4 to 8.1) need a patched build from your vendor. Update every PHP version installed, not just the one your main site uses.
Step 1: See which PHP versions you have
CloudPanel installs several PHP versions side by side as system packages. List them:
Code:
ls /etc/php/
for v in /usr/bin/php[0-9]*; do echo "$v $($v -r 'echo PHP_VERSION;')"; doneStep 2: Update PHP with apt
Take a snapshot of the server at your provider first. Then, as root:
Code:
apt update
apt list --upgradable 2>/dev/null | grep -i phpCode:
apt install --only-upgrade 'php*'Code:
apt update && apt -y upgradeNo PHP updates listed? The packages may not be published for your OS yet. Check again later today, and apply the temporary protection below in the meantime.
Step 3: Restart PHP-FPM
Restart every PHP version you updated, so the running workers load the fixed code:
Code:
systemctl restart php8.1-fpm php8.2-fpm php8.3-fpm php8.4-fpm 2>/dev/null
systemctl list-units --type=service | grep -i 'php.*fpm'Step 4: Confirm
Check the installed package version for each PHP:
Code:
dpkg -l | grep -E 'php8\.[0-9]+-fpm'Code:
zcat /usr/share/doc/php8.3-fpm/changelog.Debian.gz 2>/dev/null | grep -m3 -E 'CVE-2026-10961[89]'Check the version your websites really use
The command line can show a different PHP from the one serving websites. To be sure, create a file called
Code:
v.phpCode:
<?php echo PHP_VERSION;Code:
https://your-domain/v.phpCan't update yet? Temporary protection
These settings reduce the risk until a patched version is installed. They are not a full fix. Add them to the php.ini of each PHP version (
Code:
/etc/php/8.x/fpm/php.iniCode:
session.upload_progress.enabled = 0
; PHP 8.5 only:
fatal_error_backtraces = 0Code:
ini_set()Code:
.user.iniCode:
memory_limit = -1After patching: check you weren't hit
Attacks started on 17 October, before the fix existed. Spend ten minutes on these checks:
- PHP files created or changed since 17 October that you don't recognise, especially in upload folders:
Code:find /home/*/htdocs -name "*.php" -newermt 2026-10-17 -type f 2>/dev/null | head -50 - Unknown cron jobs: for root and each site user.Code:
crontab -l
- Unusual CPU use (crypto miners are common): Code:
ps aux --sort=-%cpu | head
Questions? Ask in CloudPanel Security Support with your OS, CloudPanel version and the output of your PHP version check.
Sources (checked 22 October 2026): Tenable PHP2Shell FAQ · Qualys: mitigate and patch PHP2Shell

