PHP2Shell: no fixed release for PHP older than 8.2. Exposure check and containment, $495 fixed →
Articles · PHP security

PHP2Shell on PHP older than 8.2: what you can do without a release

· Skyhawk Labs

The short answer depends on your PHP version. On 8.2 or newer, install the fixed release. On 7.4, 8.0 or 8.1 there is no release, but the PHP security team published source patches, and your Linux distribution may already ship them. On 7.3 or older there is nothing from the PHP project, so you reduce the exposure and plan the upgrade.

This article is for the owner of an old PHP application and whoever looks after its server. It covers what PHP2Shell is, how to find out where you stand, and what to change today.

What PHP2Shell is

PHP2Shell is the name for two flaws in PHP itself, CVE-2026-109618 and CVE-2026-109619. Both are rated critical. They are in the PHP engine, not in your application, a framework or a plugin, so they affect a site no matter how carefully its code was written.

An attacker needs no login. A crafted web request can make PHP mishandle its own memory, and the PHP project reports that this can lead to the attacker running their own code on the server. The project confirmed a working attack against Apache with mod_php, the setup most old PHP applications still use.

The fixes were released on October 21, 2026, for supported PHP versions only. PHP 8.1 and everything older no longer receive releases from the PHP project.

Step 1: find out which PHP serves your site

The version that matters is the one answering web requests. It is often not the one a command line reports, because a server can have several PHP versions installed.

Step 2: see what exists for your version

Your PHPWhat existsWhat to do
8.2, 8.3, 8.4, 8.5Fixed releases: 8.2.35, 8.3.36, 8.4.27 and 8.5.12.Install the fixed release and restart PHP.
7.4, 8.0, 8.1No release. The PHP security team published source-only patches, and some Linux distributions and paid long-term-support vendors ship patched packages.Check whether your distribution or vendor has a patched package. If not, apply the settings below and plan the upgrade.
7.3 and olderNothing from the PHP project.Apply the settings below, limit what the server accepts, and plan the upgrade. A paid long-term-support vendor may cover your version.

The source patches for 7.4, 8.0 and 8.1 are not something to install with one command. They are changes to PHP's source code, meant for people who build PHP themselves. If your server uses PHP packages from a distribution or a host, the practical question is whether that supplier has shipped them.

Step 3: apply the PHP project's interim settings

The PHP project published settings that block the attack paths it has confirmed. It is direct about their limit: they are not a complete fix, and only updating is.

memory_limit = -1
post_max_size = 8M          ; 32M if the site takes file uploads
upload_max_filesize = 8M    ; keep it below post_max_size
session.upload_progress.enabled = 0

Removing the memory limit sounds backwards, and on its own it means one runaway request can use all the server's memory. The PHP project suggests pairing it with a memory cap on the container or service instead. It warns against the older process limits RLIMIT_AS and RLIMIT_DATA, which can trigger the flaw.

Step 4: limit what reaches PHP

The confirmed attacks use file-upload requests. The less of that traffic reaches PHP, the smaller the exposure.

Step 5: look for signs someone got in first

Attack attempts were reported the day the fixes came out. If the server sat exposed for weeks, check before assuming it is clean:

Finding any of these means the job has changed from prevention to incident response, which is separate, specialist work.

Why “just upgrade PHP” is not one step

For a modern application, moving to a fixed PHP version is an afternoon. For an old one it is a project, because the application was written for the old PHP. CakePHP 2, for example, was never built for PHP 8, so the framework has to move before PHP can. We cover that path on the CakePHP rescue page.

There is also a second date. PHP 8.2 loses security support on December 31, 2026, so a server patched to 8.2 today is unsupported again in weeks. Plan the upgrade to land on 8.3 or newer.

Want this done for you? Our PHP2Shell check covers steps 1 to 4 on one server for $495 fixed, with a written summary of what we found and changed.

See the PHP2Shell check

Sources