PHP2Shell: Which PHP Versions Are Fixed and What to Do If You Can't Patch Yet

PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 fix two critical flaws that allow unauthenticated remote code execution through PHP-FPM, mod_php, php-cgi, FrankenPHP and LiteSpeed. Amazon saw an exploitation attempt four days before disclosure, PHP 8.1 and older get only source backports, and PHP says configuration changes do not make a server safe.

Reporter bylines on BizTechDaily are editorial personas, and articles are drafted with AI tools. The site is run by its publisher, who writes as Hank Reed. How we report

PHP2Shell: Which PHP Versions Are Fixed and What to Do If You Can't Patch Yet

AI-generated illustration

PHP released versions 8.5.12, 8.4.27, 8.3.36 and 8.2.35 on October 21 to fix two vulnerabilities that allow unauthenticated remote code execution, per the PHP project. Both are rated 9.2 on CVSS v4.0. Researchers call the pair PHP2Shell. The CVE numbers are CVE-2026-109618 and CVE-2026-109619.

The advisory covers nearly every way PHP serves web traffic. It lists PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed as affected. The first flaw is in out-of-memory handling, which can interrupt PHP while request data is half set up, after which cleanup treats the bad data as valid. The second lets internal state from one request survive into the next request on the same worker, through the session upload progress feature. PHP says mod_php setups face the most danger, because a single unauthenticated request can trigger the attack before any application code runs.

PHP branch Fixed release Support status
8.5 8.5.12 active support until Dec 31, 2027
8.4 8.4.27 active support until Dec 31, 2026
8.3 8.3.36 security fixes until Dec 31, 2027
8.2 8.2.35 security fixes end Dec 31, 2026
8.1, 8.0, 7.4 no official release, minimal source backports only end of life

The end-of-life rows are the problem. PHP 8.1 and older no longer get releases from the PHP project. Its security team published minimal source backports for 7.4, 8.0 and 8.1, and Linux distributions and long-term support vendors got the patches in advance. Mallory, a security firm, counted about 884,000 internet-facing hosts whose banners reported PHP 8.1 or older on October 20, per The Hacker News. That is 59% of the roughly 1.5 million hosts that report a version at all. Banners prove nothing about a given host. They are still a rough map.

Attackers did not wait for the announcement. Amazon's threat intelligence team says its MadPot honeypots recorded an exploitation attempt on October 17, four days before disclosure, from an address tied to a commercial anonymization service, per Help Net Security. Amazon advises starting any investigation from October 17. Cloudflare's chief executive said the company saw thousands of attempts in the ten hours before the announcement and millions afterward, per The Register. Cloudflare has pushed WAF rules for known exploit paths to every plan, including free ones.

How much of that traffic works is unclear. Dataminr says observed activity is scanning and non-working exploits so far, with no known compromises, and most public proof-of-concept code crashes PHP workers instead of running code. CISA had not added either CVE to its Known Exploited Vulnerabilities catalog as of October 23.

PHP is also embedded in products people don't think of as PHP. Palo Alto Networks says all PAN-OS and Panorama versions are affected, with no fixed release yet at the time of its update. Fortinet and Cisco were checking dozens of products. Control panels and appliances that bundle their own PHP need their own updates.

What if a server can't be patched today? PHP lists interim steps and says they "do not make an installation safe." Set memory_limit=-1 where applications can't override it. Lower post_max_size to 8M without uploads or 32M with them. Turn off session.upload_progress.enabled in php.ini or the FPM pool, then restart every worker. Setting it with ini_set() or .user.ini does not count. The UK's National Cyber Security Centre goes further and suggests taking offline any system that can't be fixed right away.

There is a third advisory. On October 23 PHP described CVE-2026-115560, another session-handling flaw that needs a specific configuration, and it recommends session.upload_progress.enabled=0 until the next regular release.

For detection, watch for php-fpm, php-cgi, httpd or apache2 starting shells, interpreters or download tools, and check web roots and cron jobs for new files since October 17. Searchlight Cyber published an open-source scanner that tests a host for both CVEs. Our Artex piece on South Korea's bank hacks covers how quickly automated tools now turn a disclosure into attacks.

Find every PHP install you run, including the ones inside control panels, appliances and old marketing sites, and move each to 8.5.12, 8.4.27, 8.3.36 or 8.2.35 today. Anything on 8.1 or older needs a vendor backport, an upgrade, or to come off the internet, and any server that was exposed should be checked for intrusions back to October 17.