Vulnerability 13 min read Markdown

PHP2Shell (CVE-2026-109618, CVE-2026-109619): Fixed PHP Versions, a Free Checker and the Laravel Patch Order

PHP shipped an out-of-band release on 21 October for two critical remote code execution flaws in PHP itself, both rated CVSS v4.0 9.2. The fixed versions are 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Details leaked a day early and attacks started before the patch was out. Every Laravel application is in scope. Here is how to check a server from the outside, which binaries to patch first, and what Forge and Laravel Cloud users need to do.

Matt King
Matt King
October 21, 2026
Last updated: October 27, 2026
PHP2Shell (CVE-2026-109618, CVE-2026-109619): Fixed PHP Versions, a Free Checker and the Laravel Patch Order

Updated 27 October 2026. PHP shipped the fix on 21 October at 14:00 UTC. The fixed versions are 8.5.12, 8.4.27, 8.3.36 and 8.2.35. If you only have a minute, paste your URL into the free PHP2Shell checker and come back to the patching order below. This post has been updated with the confirmed versions, a section for Forge and Laravel Cloud users, and the checker.

On 21 October 2026 the PHP security team shipped an out-of-band release for what php.net called a critical security issue affecting PHP: two vulnerabilities in PHP itself, tracked as CVE-2026-109618 and CVE-2026-109619 and rated CVSS v4.0 9.2. Both are remote code execution. Details leaked on Hacker News a day before the planned disclosure, an exploit tool calling itself PHP2Shell was circulating, and by the morning of the release Cloudflare and several hosting providers were reporting attacks.

This is not a Laravel bug, and that is the point. It sits in the interpreter underneath every Laravel, Symfony, WordPress and Magento application, which means the usual framework-level reflexes do not apply. Composer constraints, php artisan down, a middleware: none of them are in the path. The fix is a new PHP binary on every server that runs one.

This post covers what is confirmed, what is still second-hand, the order I would do things in, and how to check a server you do not have a shell on.

The fixed versions

Branch Vulnerable below Patched release
8.5 8.5.12 8.5.12
8.4 8.4.27 8.4.27
8.3 8.3.36 8.3.36
8.2 8.2.35 8.2.35
8.1 and older everything no official release

Two caveats that matter in practice. First, php -v on a server describes the CLI binary, not necessarily the one serving traffic; the FPM, mod_php, FrankenPHP or LiteSpeed worker is what counts. Second, Debian, Ubuntu and RHEL backport security fixes while keeping the upstream version string, so a distro box can report 8.3.34 and still be patched. On distro packages, the package changelog is the proof, not the number.

Check a server from the outside

We built a free PHP2Shell checker for the case where you want an answer about a server before you can get a shell on it: a client's site, a staging box someone else manages, the marketing site nobody owns.

It sends one ordinary HTTP request to the URL you give it, reads the PHP version the server advertises in its X-Powered-By or Server header, and compares that with the patched release for the branch. It never sends a payload and never touches the vulnerable code path. If the server runs Apache and exposes a version, the tool points that out, because mod_php is the configuration with the widest blast radius.

Three results are possible:

  • Vulnerable. The advertised version is below the patch for its branch. Patch now, then re-run it.
  • Patched. The advertised version is at or above the patch.
  • Cannot determine. The server does not expose a PHP version. That is the right configuration (expose_php = Off, and no version in the Server header), and it means you confirm on the server itself with the commands below.

The distro caveat applies here too: a box reporting 8.3.34 from Ubuntu's own packages may already carry the backported fix. Treat a "vulnerable" result on a distro package as a strong prompt to check the changelog, not as a verdict.

What is confirmed, and what is not

The official record is now the php.net release of 21 October: two critical vulnerabilities, both CVSS v4.0 9.2, fixed in 8.5.12, 8.4.27, 8.3.36 and 8.2.35, with no complete mitigation other than updating. The PHP2Shell name comes from the exploit tool, not from php.net.

Confirmed:

  • Fixed versions. 8.5.12, 8.4.27, 8.3.36 and 8.2.35, released 21 October. Only the supported branches got official builds.

  • Both bugs are in the runtime. CVE-2026-109618 is described as an out-of-memory corruption bug and CVE-2026-109619 as a stale global state bug. Both trigger before application code runs and need no authentication.

  • mod_php is the worst case. Apache with mod_php was singled out as the highest risk configuration, with a demonstrated single-request path. PHP-FPM, php-cgi, FrankenPHP and LiteSpeed are affected too.

  • watchTowr reproduced CVE-2026-109618 and says both flaws are real remote code execution in PHP core.

  • Cloudflare reported attacks at 07:43 UTC on 21 October and deployed WAF rules. Patchstack had exploitation reports from hosting partners at about the same time.

  • A PHP core developer has said publicly that patching is the only mitigation.

Still second-hand:

  • Affected range. The PHP2Shell tool claims to work against every release from 5.4.0 onwards. Since 8.1 and older got no official build, the practical answer is the same either way: anything below 8.2 needs upgrading, not patching.
  • Trigger. Reports point at PHP's handling of multipart/form-data request bodies, which PHP parses before any application code runs. The partial mitigations below rest on this being right, which is why they are partial, and why none of them replaces the patch.

I am not publishing a payload or speculating further on the root cause. The mechanism above is enough to reason about exposure.

Why Laravel does not protect you here

Three things teams reach for first, none of which help:

Maintenance mode. php artisan down is checked by the framework, inside the PHP process, after PHP has finished parsing the request. If the bug is in request parsing, the exploit has run before Laravel looks for the down file. Sansec made the same point about Magento and WordPress maintenance modes. It applies to all of them.

Middleware, rate limiting, authentication. Same reason. Everything in the HTTP kernel runs after the SAPI has populated $_POST and $_FILES. An unauthenticated POST to a route that does not exist is still parsed by PHP.

composer audit. It checks your Composer dependencies. PHP is not one of them, and the "php": "^8.3" line in composer.json describes a constraint, not the binary on the server. A clean audit says nothing about this.

Step 1: find every PHP binary you run

The question is not "what version is my app on". It is "which PHP binaries accept requests, where did they come from, and how do they get updated". For a typical Laravel estate:

Where it runs Where PHP comes from How it updates
Forge, Ploi, or a hand-built Ubuntu box The ondrej/php PPA via apt apt upgrade, then restart FPM
Debian or Ubuntu distro packages The distribution's own php8.x packages Backported fix; version string may not change
Docker The official php:8.x-fpm image or a derivative Rebuild against the patched tag, redeploy
Octane with FrankenPHP PHP is embedded in the FrankenPHP binary New FrankenPHP build; a system php upgrade does nothing
Octane with Swoole or RoadRunner The system PHP binary Upgrade PHP, then fully restart Octane
Vapor, Laravel Cloud, other PaaS Provider-managed runtime Wait for the provider's notice; check your dashboard
RHEL, Alma or Rocky with Remi The Remi repository Sansec reports Remi will not publish today; see below

Prioritise by exposure. PHP-FPM and Octane processes that take HTTP from the internet come first. Queue workers, Horizon and the scheduler run PHP too, but they do not parse untrusted request bodies, so they are second. Developer machines on Herd, Homebrew or Sail come last, but do not skip them.

On a server, remember that php -v describes the CLI binary, which is not necessarily what serves traffic:

php -v                     # the CLI binary
php-fpm8.3 -v              # the FPM binary on ondrej/Ubuntu; adjust the branch
ls /usr/sbin/php-fpm*      # how many FPM binaries are installed at all

Old minor versions left installed from a previous upgrade are a common surprise here. If FPM for 8.1 is still running on a box that was "upgraded to 8.3", that pool is in scope and will never get a patch.

For containers, ask the image rather than the host:

docker run --rm your-registry/your-app:latest php -v

For anything you cannot SSH into, the PHP2Shell checker reads the advertised version from outside. Run it against every hostname in your estate, including the ones that are not Laravel. The marketing WordPress and the old Magento store run PHP too.

The open source StackShield scanner records the running PHP version in its framework_eol check and fails at high severity when that version is past security support. It does not know about these CVEs specifically, but it will tell you which deployments are on 8.1 or older, and for this bug that is the group with no patch coming.

Step 2: decide what to do in the gap

The patch is out, so the gap is now whatever time it takes you to get it onto every binary from Step 1. If that is more than an hour for an internet-facing server, use a stopgap for that hour. These are the options reported by Sansec, Patchstack and Cloudflare, in rough order of protection against disruption. None of them is a fix.

Put a WAF in front and lock the origin. Cloudflare has published rules for the known exploit vectors and made them available on all plans including free. They only help if attackers cannot reach your origin directly, so restrict inbound traffic to Cloudflare's published IP ranges at the firewall. Cloudflare itself calls this a stopgap and is updating rules as new vectors appear.

Reject multipart requests before PHP sees them. If the mechanism reports are right, refusing multipart/form-data at the web server removes the trigger. For an API that only accepts JSON this costs nothing. For anything with file uploads it breaks them until you remove the rule, so test the flows you care about. In nginx, inside the location that passes to FPM:

location ~ \.php$ {
    if ($content_type ~* "multipart/form-data") {
        return 415;
    }
    # fastcgi_pass ...
}

Apply the PHP settings that reportedly narrow the attack surface. Sansec and Patchstack both point to two ini values:

session.upload_progress.enabled = 0
session.use_strict_mode = 1

Laravel manages its own sessions and does not use PHP's native session upload progress feature, so disabling it costs a Laravel application nothing. Both sources describe this as partial protection only, not a guarantee. Set it in the FPM pool or php.ini, reload FPM, and verify from a real web request rather than the CLI:

php -r 'echo ini_get("session.upload_progress.enabled");'   # CLI only, not enough
# Verify through FPM: drop a one-line phpinfo() behind an IP allow list, then delete it

Go read-only or offline. Stop PHP-FPM and have nginx serve a static maintenance page, or reject every method except GET and HEAD at the web server. As covered above, php artisan down does not count. Several large sites in the Netherlands, including government services, chose this option this morning rather than stay exposed until 14:00 UTC.

Step 3: patch, in this order

Internet-facing FPM and Octane first, workers and schedulers second, everything else after.

Ubuntu with the ondrej PPA (Forge and most hand-built servers):

sudo apt-get update
sudo apt-get install --only-upgrade 'php8.3*'
sudo systemctl restart php8.3-fpm
php-fpm8.3 -v

Restart, not reload. A reload re-reads configuration; it does not replace the running binary. You want php-fpm8.3 -v to print 8.3.36 or higher (8.4.27, 8.5.12 or 8.2.35 on the other branches).

Laravel Forge specifically. Forge installs PHP from the ondrej PPA, so the apt commands above are the fix, run either from the server's PHP panel in the Forge dashboard or over SSH as the forge user. Three Forge-specific traps:

  • Forge servers often carry more than one PHP version. Every installed version with a running FPM pool is in scope, not just the one your site is set to. ls /usr/sbin/php-fpm* lists them; upgrade and restart each one, and uninstall the ones nothing uses.
  • Forge's "update patch version" does not restart Octane. If a site runs Octane with Swoole or RoadRunner, stop and start it from the site's Octane panel after the PHP upgrade so the parent process picks up the new binary.
  • Forge's PHP tab reports what is installed, not what is running. Confirm with systemctl show php8.3-fpm --property=ActiveEnterTimestamp as described below, or run the checker against the site if it exposes a version.

Laravel Cloud and Vapor. The runtime is managed, so there is nothing for you to apt-get. Laravel publishes the runtime status for these platforms in their own channels; confirm from the dashboard or the status page that your environment is on a patched runtime rather than assuming it. Run the checker against your production hostname as a second opinion; a managed platform should report "cannot determine" because it hides the version, and that is fine. What you still own on Cloud and Vapor is everything outside the managed runtime: any self-hosted worker, a Forge server you kept for cron, the local Herd install.

Distribution packages on Debian or Ubuntu. The fix will arrive as a backport, so the version string may still read 8.2.x. Check the package changelog for the CVE rather than trusting the number:

apt-get changelog php8.2-fpm | grep -i 'CVE-2026-1096'

Docker. Bump the base image to the patched tag, rebuild and redeploy. Pin to the exact patched version rather than php:8.3-fpm once it is published, so you can prove what is running.

Octane. With FrankenPHP, PHP is compiled into the server binary, so you need a new FrankenPHP release and a redeploy. With Swoole or RoadRunner, upgrade the system PHP and then fully stop and start Octane. octane:reload recycles workers but the parent process keeps the binary it started with.

Remi on RHEL-family systems. Sansec reports that the PHP Foundation warned Remi's repository will not publish updated packages today. If that is your source, your options are to build from source, switch to a container with the official image, or sit behind a WAF until Remi ships.

PHP 8.1 and older. No patch is coming. Upgrade, take it off the internet, or put it behind a VPN or WAF with the origin locked. If you have been deferring an 8.1 upgrade, this is the forcing function.

After patching, confirm the running process is the new binary, not just that the file on disk changed:

systemctl show php8.3-fpm --property=ActiveEnterTimestamp

That timestamp should be after your upgrade.

Step 4: if you were exposed, look for signs of compromise

Attacks began before the patch existed. If an internet-facing PHP process accepted requests between the leak on 20 October and the moment you patched, assume it may have been probed and spend thirty minutes checking.

The indicators Huntress expects are PHP worker processes spawning things they never spawn: php-fpm or php launching sh, bash, curl, wget, python or perl, reverse shell patterns such as /dev/tcp/ or mkfifo, and reconnaissance commands like whoami and uname -a. If you have EDR, that is the query. If you do not, Florian Roth's process-watcher runs in observe mode on a plain Linux box.

For a Laravel application specifically:

# Files created or changed since the leak, in the places a webshell would land
find public storage bootstrap/cache vendor -newermt '2026-10-20' -type f | head -50

# Cron for the deploy user, and anyone else
crontab -l; sudo ls -la /etc/cron.d /var/spool/cron/crontabs

# New SSH keys or accounts
find /home /root -name authorized_keys -newermt '2026-10-20'
awk -F: '$3 >= 1000' /etc/passwd

In your access logs, look for POST requests with a multipart/form-data content type to routes that never accept uploads, especially routes that return 404. That is the shape a scanner sweep would take.

If anything looks wrong, stop and follow the incident playbook rather than cleaning up ad hoc. We wrote one in the first hour after a Laravel compromise. Rotating APP_KEY is part of that playbook, not a first move; what a leaked APP_KEY exposes explains why.

Timeline so far (UTC)

When What
20 Oct, ~15:20 A Hacker News post describes two upcoming PHP RCE disclosures and is taken down
20 Oct php.net publishes the advance notice; watchTowr confirms the leak is real
21 Oct, 02:13 A PHP core developer says patching is the only mitigation
21 Oct, 07:34 Patchstack receives exploitation reports from hosting partners
21 Oct, 07:43 Cloudflare reports early attacks and deploys WAF rules
21 Oct, 08:48 PHP Foundation warns that Remi's repository will not publish updates today
21 Oct, morning Dutch government, parliament and media sites go offline as a precaution
21 Oct, 14:00 PHP releases 8.5.12, 8.4.27, 8.3.36 and 8.2.35
27 Oct StackShield publishes the free PHP2Shell checker; this post updated with confirmed versions

What this changes

The lesson is older than this bug. The PHP binary is a dependency, and for most Laravel teams it is the one with the least visibility: not in composer.lock, not in CI, upgraded by whoever last SSHed in. The teams that handled today calmly were the ones who could answer "which PHP binaries do we run and where do they come from" in five minutes. The ones who could not are the ones reading the Forge dashboard right now.

Two things you can do in the next five minutes. Run the free PHP2Shell checker against every hostname you are responsible for and patch anything it flags. Then run a free scan to see what else your application advertises about itself: StackShield checks production from the outside on a schedule and flags PHP and framework versions past security support, alongside the misconfigurations that turn a bug like this into a full compromise.

Free security check

Is your Laravel app exposed right now?

34% of Laravel apps we scan have at least one critical issue, and most teams do not find out until something breaks. The free scan checks your live app in 60 seconds. Then StackShield re-runs every check after each deploy, so a fix you ship today does not quietly regress next week.

18% have debug mode on
72% missing security headers
12% have exposed .env
Scan My App Free No signup for the scan. Continuous monitoring on a 14-day trial, no card.

Frequently Asked Questions

Are Laravel applications affected by CVE-2026-109618 and CVE-2026-109619?

Yes, if they run on a PHP version below the patched release for their branch: 8.5.12, 8.4.27, 8.3.36 or 8.2.35. The researchers who reproduced the bugs say every release since PHP 5.4 is affected. The flaws are in the PHP interpreter, not in Laravel, so no framework version, Composer constraint or middleware changes your exposure. The only fix is the patched PHP build from the 21 October 2026 security release, installed on every server that serves or processes requests.

Does php artisan down protect against PHP2Shell?

No. Laravel maintenance mode is checked by the framework, inside the PHP process, after PHP has already parsed the incoming request. The reported bugs are in PHP itself and are triggered before any application code runs, so the request is processed whether or not the maintenance file exists. If you need to take an application offline before you can patch, stop PHP-FPM and serve a static page from the web server instead.

Which PHP versions fix PHP2Shell?

PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, all released on 21 October 2026. Anything below the patched release for its branch is vulnerable. PHP 8.1 and older are past security support and received no official build, so anything on those branches needs upgrading, taking offline or isolating behind a WAF or VPN. Debian, Ubuntu and RHEL backport the fix while keeping the old version string, so on distro packages check the package changelog for the CVE rather than the number.

Is PHP2Shell being exploited in the wild?

Yes, according to several sources. On the morning of 21 October 2026 Cloudflare reported early attacks against PHP sites and deployed WAF rules, and Patchstack said it had received exploitation reports from multiple hosting partners. Huntress had not observed exploitation in its own partner environments as of 20 October. Several Dutch government and media sites went offline as a precaution before the patch was available.

Will composer audit or the StackShield scanner catch this?

composer audit will not, because it checks Composer packages and PHP is not one of them. The open source StackShield scanner records the running PHP version and fails at high severity when that version is past security support, which identifies the installs that will never receive this fix. For the specific CVEs, use the free PHP2Shell checker at stackshield.io/tools/php2shell-check: it reads the PHP version a server advertises and compares it with the fixed release for that branch. None of these substitutes for checking the PHP-FPM binary on each server.

How can I check a server for PHP2Shell from the outside?

Use the free StackShield PHP2Shell checker. Enter a public URL and it sends one ordinary HTTP request, reads the PHP version in the X-Powered-By or Server header, and tells you whether that version is below 8.5.12, 8.4.27, 8.3.36 or 8.2.35. It never sends an exploit payload. If the server hides its version, which it should, the tool says it cannot determine the result from outside and you check on the server instead.

Stay Updated on Laravel Security

Get actionable security tips, vulnerability alerts, and best practices for Laravel apps.