Lunover Engineering Notes

PHP2Shell: A PHP Patch Guide for Site Owners

PHP2Shell affects web-serving PHP. See fixed versions, what the two CVEs mean, and how to confirm your hosting provider has applied the patch.

October 21, 2026By LunoverWork with us

PHP2Shell: A PHP Patch Guide for Site Owners

On 21 October 2026, the PHP security team released fixes for two critical vulnerabilities that can allow remote code execution without authentication. They are CVE-2026-109618 and CVE-2026-109619, often discussed together as PHP2Shell. PHP says all installations serving web requests are at risk, including sites using PHP-FPM, Apache mod_php, php-cgi, FrankenPHP, and LiteSpeed. The team considers the risk highest for mod_php. PHP's security advisory is the primary source for the affected deployments, fixes, and temporary measures below. If you run a PHP website, start with the PHP version that serves live requests. Your CMS or framework name alone does not answer whether the server is patched. This guide explains what changed, which releases contain the fixes, and what to ask your host.

What are the two PHP2Shell vulnerabilities?

Both flaws are in PHP's handling of web requests:
  • CVE-2026-109618, out-of-memory corruption: An out-of-memory event can interrupt initialization of internal request data. Cleanup can then treat partly initialized data as valid.
  • CVE-2026-109619, stale global state: Request-owned internal state can remain after its backing memory is freed. A later request handled by the same worker can use that stale state before normal initialization resets it.
PHP says either flaw can lead to unauthenticated remote code execution. They are core PHP issues, so changing a WordPress plugin or updating a framework does not replace a PHP security update. Read PHP's advisory and linked technical notices for the full details.

Which PHP versions fix PHP2Shell?

The first fixed upstream releases published by PHP are:
PHP branchFirst fixed upstream release
PHP 8.58.5.12
PHP 8.48.4.27
PHP 8.38.3.36
PHP 8.28.2.35
Upgrade to at least the fixed release for your branch. A newer supported release includes the fix. PHP 8.1 and older no longer receive regular updates from the PHP project. Some Linux distributions and long-term-support vendors provide backported fixes under older version numbers, so check the vendor's package advisory before judging a backported installation by its version string alone. PHP also says 8.2 reaches end of life on 31 December 2026. See PHP's release and backport guidance.

How to check your live PHP installation

  1. Identify the PHP runtime serving your site. Check your hosting control panel, PHP-FPM pool, server package inventory, or container image. A local php -v command may report a different command-line installation.
  2. Compare its full version with the table above. If multiple pools or servers handle requests, check each one.
  3. Ask about vendor backports. If the package keeps an older version number, request the vendor advisory or package changelog confirming fixes for both CVEs.
  4. Confirm deployment after updating. Restart or recycle PHP workers, then verify the patched build is the one serving the website.
You can start with our PHP2Shell exposure checker for a quick scan. If it returns Inconclusive, ask your hosting provider which PHP version and security build serves your site, and whether it includes fixes for CVE-2026-109618 and CVE-2026-109619.

What if you cannot patch immediately?

Treat temporary measures as exposure reduction while you arrange the update. PHP says updating is the only complete solution. For the out-of-memory path, PHP advises limiting POST request size and describes a memory_limit=-1 setting that removes one controllable failure route, while warning that an underlying allocation failure can still reach the vulnerable path. For the stale-state path, PHP advises setting session.upload_progress.enabled=0 in configuration that applies before request parsing and restarting every worker. PHP 8.5 has an additional fatal_error_backtraces=0 measure for a confirmed path. Each measure has conditions and limits, so follow the PHP security team's full guidance with your hosting or operations team. If you use managed hosting, send your provider three questions: Which PHP package serves this domain? Does that package contain both fixes, including any vendor backport? Have all web-serving workers restarted on the patched build? Keep the provider's answer with your incident and maintenance records.

What site owners should do now

Check the live PHP build, apply the relevant update or verified vendor backport, and confirm every web-serving worker uses it. Our PHP2Shell checker can help you start that review. For help coordinating a PHP upgrade or checking the live deployment, contact Lunover.