FreshScanSentry Free vulnerability scanning for your network & web apps Run a free scan

High risk PHP · CVE-2026-109618 · CVE-2026-109619

PHP2Shell: how to check your PHP version and patch

Short answer: PHP2Shell is two critical flaws in PHP itself (CVE-2026-109618 and CVE-2026-109619). They let an attacker run code on a PHP web server without logging in. Both are on CISA's list of vulnerabilities being exploited in the wild.

The fix: update PHP to 8.5.12, 8.4.27, 8.3.36 or 8.2.35 or later (or your Linux distribution's patched package), then restart PHP. If you run WordPress, Joomla, Drupal, Magento or most hosting control panels, you run PHP.

What PHP2Shell is

PHP fixed both flaws on 21 October 2026. They're in the core PHP engine, not in a plugin or framework, so they affect any PHP setup that answers web requests: Apache with mod_php, PHP-FPM behind nginx or Apache, php-cgi, LiteSpeed and FrankenPHP. Apache with mod_php is considered the most at risk.

Both are rated 9.2 out of 10 (CVSS 4.0). Your site's login page doesn't help: the attack happens before your application code even runs. Amazon recorded an exploitation attempt on 17 October, four days before the fix was published, and CISA added both CVEs to its Known Exploited Vulnerabilities catalog on 26 October.

Step 1: find out which PHP version your site runs

Check the PHP that serves your website. The php command on a server can be a different version from the one the web server uses.

WordPress: Dashboard → Tools → Site Health → Info, then open Server. The "PHP version" line is the one that matters.

Shared hosting (cPanel, Plesk and others): look for MultiPHP Manager, Select PHP Version or PHP Settings. On shared hosting your host updates PHP itself, so the real question is whether they've patched. Ask them directly: "Have you applied the fixes for CVE-2026-109618 and CVE-2026-109619?"

Your own Linux server:

# The command-line PHP (may differ from the web one)
php -v

# Installed PHP packages, Debian and Ubuntu
apt list --installed 'php*' 2>/dev/null | grep -E 'fpm|apache2|cgi|cli'

# Installed PHP packages, RHEL, Alma, Rocky, Fedora
rpm -qa 'php*'

From the outside: many servers announce their PHP version on every response. This doesn't work on every site, but it costs nothing to check:

curl -sI https://your-site.com | grep -iE '^(server|x-powered-by)'

A line like X-Powered-By: PHP/8.3.10 tells you the version, and tells everyone else too. Hide it once you've patched (see step 4).

Reading the result

Your PHP branchFixed inWhat to do
8.58.5.12Update to 8.5.12 or later
8.48.4.27Update to 8.4.27 or later
8.38.3.36Update to 8.3.36 or later
8.28.2.35Update to 8.2.35 or later
8.1, 8.0, 7.xNo upstream releaseOut of PHP's support. Use a vendor-patched package if your distribution or LTS vendor offers one; otherwise upgrade to a supported branch, or take the site offline until you can.

Ubuntu, Debian and Red Hat packages are a special case. Distributions often backport fixes without changing the PHP version number, so Ubuntu's PHP can say 8.3.6 and still be patched. Don't judge by the number alone: install all security updates, then compare your package version with your distribution's advisory for the two CVEs.

Step 2: update PHP

Debian and Ubuntu:

sudo apt update
sudo apt install --only-upgrade 'php*'

RHEL, Alma, Rocky, Fedora:

sudo dnf upgrade 'php*'

Docker images: rebuild from a patched base image (for example php:8.3 pulled fresh, which tracks the latest 8.3 release) and redeploy. An old image stays vulnerable however often you restart it.

Third-party repositories: if PHP came from an extra repository instead of your distribution, check that it has published the fixed build. Reports at release noted that at least one popular repository had not.

Step 3: restart PHP

The old, vulnerable code stays in memory until PHP restarts. Restart whichever one serves your site:

# PHP-FPM (the service name includes the version)
sudo systemctl restart php8.3-fpm

# Apache with mod_php
sudo systemctl restart apache2   # or httpd

Then check the version again in WordPress Site Health or with the curl command above.

Step 4: stop advertising your version

Automated attacks look for version strings like X-Powered-By: PHP/8.3.10 to pick targets. In php.ini:

expose_php = Off

Restart PHP again. This doesn't fix anything by itself, but it takes you off the easy list. The server version disclosure guide covers Apache, nginx and WordPress banners too.

Can't patch today?

These steps reduce the risk while you arrange the update. None of them is a fix.

Signs a server may already have been hit

Exploitation started before the fix was public, so check servers that were exposed before you patched:

No single sign proves an attack. If you find the last two, treat it as a breach: take the site offline, keep the logs, rebuild from a known-good backup, patch, and change every password and API key the site used.

For IT providers and MSPs

PHP often hides inside things nobody thinks of as "a PHP site": client portals, booking and ticketing systems, monitoring dashboards, NAS admin pages and some firewall or VPN appliances. List every client system that serves web pages, record the PHP version and who updates it, and start with whatever faces the internet. For appliances, follow the vendor's own advisory.

Common questions

Does a vulnerability scan detect PHP2Shell?

A FreshScanSentry scan doesn't send attack requests, so it doesn't test for PHP2Shell directly. What it can show is what your server announces to the internet, including a PHP version when the server gives one away. Updating and confirming the version from the inside, as above, is the reliable check.

I'm on WordPress with a managed host. Do I need to do anything?

Check the PHP version in Site Health, and if it's older than the fixed versions, ask your host when they'll update. Most managed hosts patched quickly. Also keep WordPress, themes and plugins updated: PHP2Shell doesn't need a plugin bug, but attackers who get in usually leave something behind there.

Is the command-line php -v good enough?

Not on its own. A server can have several PHP versions installed, and the web server may use a different one from the command line. Check the web version too, through Site Health, your control panel, or the package list.

Sources: CISA: Critical Vulnerabilities in PHP Require Immediate Patching · Datadog Security Labs: PHP2Shell · Help Net Security: PHP2Shell patched · PHP: supported versions · PHP: expose_php