// learn·Learn how we build →
all posts
PHP
Security
PHP2Shell
WordPress
Website Maintenance
4 min read

PHP2Shell: the critical PHP flaw hitting websites, and the exact version to upgrade to

VaanarStack cover: PHP2Shell, patch PHP before attackers do, with the fixed versions 8.5.12, 8.4.27, 8.3.36 and 8.2.35

Short version: PHP2Shell is a pair of critical flaws in PHP, the language behind most websites, including WordPress, WooCommerce, Laravel, Magento and most shared hosting. They let an attacker run code on your server without logging in, and attacks have already started. The fix is a PHP security update, so update PHP this week.

What is PHP2Shell?

On 21 October 2026, the PHP team shipped an emergency PHP security update for two flaws, now nicknamed PHP2Shell:

CVEWhat it is, in plain English
CVE-2026-109618If PHP runs out of memory at the wrong moment while reading a request, it can clean up half-built data as if it were valid. An attacker can steer that into running their own code.
CVE-2026-109619Leftover data from one visitor's request can be picked up by the next request on the same worker. That can leak memory or hand an attacker control.

Both are rated 9.2 out of 10 (critical). Some early reports said 10.0; the PHP team says that number was wrong.

Source: PHP's advisories for CVE-2026-109618 and CVE-2026-109619.

Why this PHP vulnerability matters for your site

  • No login needed. A single crafted web request is enough.
  • It hits PHP itself, not a plugin. Every common setup is exposed: PHP-FPM, Apache mod_php, php-cgi, LiteSpeed and FrankenPHP. Apache with mod_php is the riskiest, because the attack fires before your site's code even runs.
  • Attacks started before the fix. Amazon saw the first attempt on 17 October, four days before disclosure, and reports broad exploitation since.
  • Old sites are the most exposed. The bug goes back to PHP 5.4, so a forgotten site on PHP 7.x is a sitting target.

Source: Tenable's PHP2Shell FAQ.

PHP2Shell patch: which version you need

Check your current version (hosting panel, or run php -v), then move to at least:

You're onUpgrade to
PHP 8.5.x8.5.12
PHP 8.4.x8.4.27
PHP 8.3.x8.3.36
PHP 8.2.x8.2.35 (and plan a move: 8.2 reaches end of life on 31 Dec 2026)
PHP 8.1, 8.0, 7.4No official release. Move to 8.3 or newer, or get a backported package from your Linux vendor or LTS provider
PHP 7.3 or olderNo fix at all. Upgrade.

If you use Ubuntu, Debian, RHEL or similar packages, your distribution's package may carry the fix under its own version number. Check your vendor's security notice rather than comparing to the table above.

WordPress users: no WordPress update is needed. The fix is the PHP version on your server, which your host controls.

Source: php.net security advisory of 21 October 2026.

What to do today

  1. Find your PHP version on every site you own, including old staging and microsites.
  2. Apply the PHP patch above, or ask your host to confirm they have.
  3. Restart PHP (PHP-FPM, Apache) so the new version actually loads.
  4. Can't upgrade yet? Ask your developer to set session.upload_progress.enabled = 0 in php.ini or the PHP-FPM pool config (not with ini_set() or a .user.ini file), and on PHP 8.5 also fatal_error_backtraces = 0. Then restart every PHP worker. This blocks one attack path for one of the two flaws only, so treat it as a stopgap, not a fix.
  5. Check for compromise from 17 October onward, not just from the patch date: new admin users, unfamiliar PHP files in upload folders, odd outbound traffic.

Source: php.net security advisory of 21 October 2026 and PHP's advisory for CVE-2026-109619.

A related PHP security update on 23 October

On 23 October the PHP team flagged a related, lower-risk session issue (CVE-2026-115560). The same session.upload_progress.enabled = 0 setting covers it until the next regular release, so if you've set it, leave it at 0.

Source: php.net advisory of 23 October 2026.

Sources

FAQ

Is WordPress affected?

WordPress sites are exposed because they run on PHP, but WordPress itself needs no update. Update the PHP version on your server.

Do I need to update a plugin or theme?

No. PHP2Shell is in PHP itself, so no plugin or theme update fixes it.

I'm on PHP 7.4. What should I do?

There is no official PHP 7.4 release with the fix. Upgrade to PHP 8.3 or newer, or use a backported package from your Linux vendor or LTS provider.

Is the php.ini setting enough?

No. It blocks one attack path for one of the two flaws. Only the PHP patch fixes both.

Upcoming Webinar
VaanarStack