PHP2Shell (CVE-2026-109618/109619): Patch PHP and Check WordPress Sites for Web Shells
Bottom line: update PHP to 8.2.36 / 8.3.37 / 8.4.28 / 8.5.13 or later (or 8.6) and restart PHP-FPM and the web server. If you only applied the October fix (8.4.27 etc.), apply the November one too. Then check whether a web shell was already planted.
Update (30 November): on 19 November PHP fixed seven more flaws, including a session-handling remote code execution bug (CVE-2026-115560). The October PHP2Shell releases do not fix it, so the safe versions have changed. This article reflects that.
What happened?
On 21 October 2026 PHP fixed two flaws in PHP itself (CVE-2026-109618 and CVE-2026-109619, nicknamed PHP2Shell) that let attackers run commands on the server without logging in. They are rated 9.2 on CVSS 4.0. Exploitation started almost immediately, and on 26 October the US CISA added both to its Known Exploited Vulnerabilities catalog.
South Korea's Ministry of Science and ICT and KISA raised the national cyber threat level to "caution" on 22 October. WordPress, Drupal, Joomla and most small-business websites run on PHP, so a large share of company websites is in scope.
What do attackers do?
According to security vendors' analyses, attackers used the flaws to plant web shells (PHP files that let them control the server remotely), steal credentials stored on the server, enlist servers in botnets and escalate privileges. Admin portals of some security appliances were targeted too.
Step 1: check and update PHP
- PHP 8.2 → 8.2.36 or later (8.2 itself reaches end of life on 31 December 2026, so plan a move to 8.3 or later)
- PHP 8.3 → 8.3.37 or later
- PHP 8.4 → 8.4.28 or later
- PHP 8.5 → 8.5.13 or later
- PHP 8.6 → fixed from 8.6.0
- PHP 7.4, 8.0, 8.1: end of life with no official builds; PHP2Shell got source-only backports and CVE-2026-115560 is not fixed, so move to a supported branch
If you can't apply the November release right away, the interim mitigation published before the patch is setting session.upload_progress.enabled = 0 in php.ini. Treat it as temporary and install the real update.
php -v
php-fpm -v # check the PHP-FPM version your site actually uses
Linux distributions (RHEL, Ubuntu, …) and hosting providers may show different version numbers for patched packages: check their advisories, or ask your host whether the fix is applied. No configuration change fully closes the flaw; updating is the only complete fix.
If your response headers reveal the PHP version, the Safelight deep check tells you automatically whether it is older than the November fixes.
Step 2: check whether a web shell was planted
Patching stops new break-ins but doesn't remove a web shell that is already there. If your site was online and unpatched after 21 October, check the following.
- PHP files where none should exist, such as upload folders (WordPress: wp-content/uploads/)
- PHP files created or changed recently
- Files containing risky functions like eval, base64_decode, assert, system, shell_exec
- POST requests in the access log to .php addresses you don't recognise
- New admin accounts, or unfamiliar scheduled tasks (crontab) on the server
# PHP files changed in the last 30 days
find /var/www -name '*.php' -mtime -30 -ls
# PHP files inside upload folders (should not exist)
find /var/www -path '*/uploads/*' -name '*.php'
# Suspicious function combinations
grep -rlE 'eval\s*\(\s*(base64_decode|gzinflate|str_rot13)' /var/www
If you find a web shell, don't just delete that one file. Attackers usually leave more than one back door: restore from a clean backup and change every password (database, admin, FTP/SSH). If personal data may have leaked, contact your national CERT or data protection authority.
The Safelight deep check also finds leftover installers, public admin screens, open database ports and exposed debug pages in one run.