Which versions of PHP are vulnerable?
General News

Which versions of PHP are vulnerable?

All PHP versions from 5.4 through 8.5.11 are vulnerable to the critical "php2shell" remote code execution flaws (CVE-2026-109618 and CVE-2026-109619).

••490 views

Fixes are available in PHP 8.5.12, 8.4.27, 8.3.36, and 8.2.35. Versions 8.1 and older are end-of-life and receive no official upstream patches.

PHP BranchVulnerable VersionsPatched Version
PHP 8.5Before 8.5.128.5.12
PHP 8.4Before 8.4.278.4.27
PHP 8.3Before 8.3.368.3.36
PHP 8.2Before 8.2.358.2.35
PHP 8.1 and olderAll versions (End-of-Life) None (requires vendor backports or upgrade)

Key Details

The Vulnerabilities: Tracked as CVE-2026-109618 and CVE-2026-109619, these core memory-safety issues allow unauthenticated remote code execution (CVSS 9.2).

Attack Vector: They can trigger during request handling or out-of-memory error cleanup before your application code even runs, affecting runtimes like Apache mod_php, PHP-FPM, php-cgi, and LiteSpeed.

Official Guidance: Review the full advisory details on the PHP.net Security Advisories page

Patching

Upgrading PHP is the only complete remediation. The measures below may reduce exposure to specific exploitation paths while you prepare to upgrade, but they do not address every variant.

Some measures can affect application functionality, performance or availability. Test configuration changes against your application's requirements and apply the PHP security update as soon as possible.

It shouldn't do any harm to add the following code to your .htaccess file... (XCMS already uses this code)

# Disable Apache Server Signature
ServerSignature Off

# Hide PHP Version
<IfModule mod_headers.c>
  Header unset X-Powered-By
  Header always set X-Content-Type-Options "nosniff"
</IfModule>

# Protect Against PHP Fingerprinting Attacks
<IfModule mod_rewrite.c>
  RewriteCond %{QUERY_STRING} PHP[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12} [NC,OR]
  RewriteCond %{REQUEST_URI} =PHP[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12} [NC]
  RewriteRule .* - [F,L]
</IfModule>

https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-php-security

https://www.php.net/index.php#2026-10-21-5

https://en.wikipedia.org/wiki/PHP2Shell

Share:

Comments

Sign in to join the conversation.

No comments yet. Be the first!

More from General News