- What: two critical vulnerabilities (CVSS 9.2) in the PHP engine itself, fixed on 21 October 2026. Under the right conditions, someone with no account can run code on the server.
- Who: any site served by PHP, whatever it is built with. Laravel included.
- First fixed in: PHP 8.2.35, 8.3.36, 8.4.27 and 8.5.12.
- Install now: the latest release of your branch. PHP shipped further security releases on 19 November: 8.2.36, 8.3.37, 8.4.28 and 8.5.13.
- The catch: deploying your application, or running
composer update, does not change the PHP version. Someone has to update the server or rebuild the image, then restart PHP. - PHP 8.1 and older: no official release. Time to plan the upgrade.
What happened, in plain terms
Most security news about PHP sites is about the application: a plugin, a form, a forgotten admin page. PHP2Shell is different. The flaws are in PHP itself, the engine that runs your code. The researchers put it bluntly: a one-line “Hello World” script on an affected version is exposed.
There are two bugs, both in how PHP manages memory when something goes wrong mid-request:
- CVE-2026-109618. If PHP runs out of memory at the wrong moment, it can be left holding half-built internal data, and then treats that data as valid while cleaning up.
- CVE-2026-109619. Internal state from one request can survive into the next request handled by the same worker, after the memory behind it has been freed.
An attacker who can trigger either one gets to run commands as the web server user, or to read the PHP process’s memory. That memory holds whatever your application holds: database passwords, API keys, session tokens. The researchers showed working attacks against stock WordPress, Drupal and Joomla, but nothing about the bugs is specific to those. The PHP project’s advisory covers every way of serving web requests with PHP: PHP-FPM, Apache with mod_php, FrankenPHP and the rest.
Three research teams reported the same root cause independently within weeks of each other, with AI tools doing much of the digging. Then the disclosure itself went sideways: details and a demo video leaked a day early, and the release was pulled forward.
Is it being used? The PHP team said it knew of no working exploits on release day. Cloudflare, which shipped firewall rules for it, has since reported attack attempts against sites it protects. Assume people are trying.
Why your last deploy did not fix it
Here is the conversation we keep having. “Are we patched?” “We deployed on Tuesday and everything is up to date.” Both people are being honest, and the server is still vulnerable.
A deploy ships your code and your Composer packages. PHP is not a Composer package. It is installed on the server, or baked into a Docker image, and it stays at whatever version it was until someone updates that server or rebuilds that image. The line "php": "^8.3" in composer.json says which versions your code accepts. It does not install anything.
The same goes for the framework. No Laravel release can fix PHP2Shell, because Laravel sits on top of the thing that is broken.
Ask for the output of php -v from the production server, not from someone’s laptop and not from the build pipeline. If nobody can produce it in five minutes, that tells you more than the version number will.
Every place PHP lives
The second reason servers are still unpatched a month later: PHP is in more places than the one everybody thinks of. A fix applied to “the server” often misses half of these.
PHP-FPM answering requests. The exposed part, and the first to fix. A server can have several PHP versions installed, each with its own FPM service.
Long-running processes that loaded PHP when they started. They keep the old version in memory until they are restarted.
The PHP version is frozen at build time. A fixed base image upstream changes nothing until you pull, rebuild and redeploy.
The standalone FrankenPHP binary carries its own copy of PHP, so the system package manager never touches it. Update FrankenPHP itself, then restart; a reload is not enough.
On Lambda-based hosting the runtime is a layer chosen at deploy time. Redeploy to pick up the patched one, and check which version you actually got.
Usually reachable from the internet, usually forgotten, and usually holding a copy of real data or real credentials.
Cron uses the command-line PHP, which can be a different version from the one serving the site. Not the exposed part, but keep it in step.
The old marketing site, the WordPress blog on a subdomain, the tool a contractor set up in 2021. Still online, still on your domain, and never in anyone’s update plan.
The versions to be on
| PHP branch | Vulnerable | First fixed · 21 Oct | Install now · 19 Nov |
|---|---|---|---|
| 8.5 | below 8.5.12 | 8.5.12 | 8.5.13 |
| 8.4 | below 8.4.27 | 8.4.27 | 8.4.28 |
| 8.3 | below 8.3.36 | 8.3.36 | 8.3.37 |
| 8.2 | below 8.2.35 | 8.2.35 | 8.2.36 ends 31 Dec |
| 8.1 and older | All releases | No release from the PHP project. Source patches exist for 7.4, 8.0 and 8.1 so that operating system vendors can ship fixes: check with yours, and plan the upgrade. | |
Two notes on reading that table. PHP 8.2 reaches end of life on 31 December 2026, so a server on 8.2 is patched for now and needs a version upgrade soon. And if PHP came from your operating system’s own packages, the vendor may have fixed it without changing the version number, so check their security notice before you panic or relax.
The patch runbook
For a Laravel application on an Ubuntu server, which is what Forge provisions. Swap 8.4 for your version.
1. Find every PHP on the machine
php -v
ls /etc/php/
systemctl list-units 'php*-fpm*' --no-legendThe first line is the command-line version. The other two show every installed version and which FPM services are running. The site is served by FPM, so that is the version that counts.
2. Update
sudo apt-get update
sudo apt-get install --only-upgrade "php8.4-*"
php-fpm8.4 -vOn Forge you can do the same from the server’s PHP page, which has an option to update an installed version to its latest patch release. Either way, check the version afterwards. If the package source cannot offer a fixed release, you have found a different problem, and it is better to know.
3. Restart everything that runs PHP
sudo systemctl restart php8.4-fpm
php artisan queue:restart
# If you use Horizon:
php artisan horizon:terminateUntil FPM restarts, the old version is still serving requests. queue:restart and horizon:terminate ask workers to finish their current job and exit, and your process manager starts them again on the new version.
4. Docker: rebuild, do not just redeploy
# What is production running right now?
docker run --rm your-image:tag php -v
# Rebuild on a fresh base image
docker build --pull --no-cache -t your-image:new .
docker run --rm your-image:new php -vIf your Dockerfile pins the base image to an exact patch version or a digest, change the pin. Then roll the new image out everywhere the old one runs: web, workers, scheduler.
5. Write it down
Server or image, PHP version, date, who did it. Next month you will be asked again, and the answer should take seconds.
Tell us what you host. You’ll get a reply within 1 business day with what we would check first.
If you cannot upgrade today
The PHP project is direct about this: there are no complete mitigations, and updating is the only safe choice. If you are stuck for a few days, these reduce the exposure:
- Turn off session upload progress. Set
session.upload_progress.enabled=0inphp.inior the FPM pool configuration, then restart the workers. It has to be set there; changing it from application code is too late. Laravel does not use this feature, so nothing should notice. - On PHP 8.5, set
fatal_error_backtraces=0and restart. It closes one confirmed route. - Keep request sizes tight. A
post_max_sizeno larger than your real uploads need, with matching limits at the web server. - Put a firewall in front. Cloudflare and other providers shipped rules for the known attack patterns. Useful as an extra layer; the providers themselves say it does not replace the update.
The advisory also lists memory_limit=-1 as a mitigation. That removes PHP’s own memory ceiling, so a runaway request can now take the whole server down. We would only use it with a memory limit enforced by the container or the operating system, and only for as long as it takes to schedule the real fix.
After you patch
- Check you are on the current release, not the October one. Two days after the fix, PHP published a follow-up advisory about session upload progress, and on 19 November it shipped another round of security releases. A server patched on 22 October and left alone is behind again.
- Think about what the server knew. One of these bugs can leak memory without leaving much trace. If a public server sat unpatched for weeks, rotating its database password and API keys is cheap insurance.
- Look at the logs once. Odd multipart upload requests followed by memory errors, bursts of HTTP 500s, or PHP workers restarting for no reason are the patterns the researchers point to.
- Put the next upgrade in the plan. If you are on 8.2, the clock runs out in December. If you are on 8.1 or older, you are relying on someone else’s backports.
The real finding: nobody owned the runtime
When we take over a product from another team, the PHP version is one of the first things we look at, and not because old versions are embarrassing. It shows whether anyone was responsible for the layer under the code. Usually the developers assumed hosting handled it, hosting assumed the developers did, and the founder assumed that paying for both meant it was covered.
PHP2Shell did not create that gap. It made it expensive. And it is not a one-off: a month later, Nginx2Root did the same thing one layer down, in the web server. Both were found with AI tools that are now reading every widely used codebase, patiently. The PHP team alone has published 15 CVEs since July.
Three questions are worth asking this week, whoever your team is:
- Who is named as responsible for PHP, the web server and the operating system? A person or a partner, written down.
- How would we find out about the next one? Someone should be reading the PHP and web server announcements, not waiting for it to reach the news.
- How long from a critical fix being released to it running in production? If nobody knows, measure it once. Days is fine. “We are not sure” is the answer to fix.
Teams that could answer those spent an afternoon on PHP2Shell. The rest are still finding servers.
Quick answers
Does PHP2Shell affect Laravel applications?
Yes. PHP2Shell is in the PHP engine, not in any framework. Any site served by an affected PHP version is in scope, whatever it is built with, and updating Laravel or your Composer packages does not change the PHP version on the server.
Which PHP versions fix PHP2Shell?
PHP 8.2.35, 8.3.36, 8.4.27 and 8.5.12, released on 21 October 2026, are the first fixed versions. PHP published further security releases on 19 November 2026 (8.2.36, 8.3.37, 8.4.28 and 8.5.13), so install the latest release of your branch rather than the minimum.
What about PHP 8.1 and older?
They no longer receive releases from the PHP project. Source patches were made available for 7.4, 8.0 and 8.1 so that operating system vendors can ship fixes, so check with your vendor. The durable answer is to upgrade to a supported PHP version.
Do I need to restart anything after updating PHP?
Yes. Restart PHP-FPM, and restart queue workers, Horizon and any other long-running PHP process, otherwise they keep running the old version from memory.
Does a web application firewall protect against PHP2Shell?
It helps, but it is not a fix. Providers such as Cloudflare shipped rules for the known attack patterns. The PHP project's own advisory says there are no complete mitigations and that updating is the only safe choice.
Sources
Version numbers, dates and commands in this article come from the primary sources below. Check them before you act, since advisories are updated.
- PHP news archive 2026: security releases and advisories of 20, 21 and 23 October and 19 November
- The PHP Foundation: the security release and how it came about
- php2shell.com: the researchers' summary page
- Wiz Research: PHP2Shell technical write-up
- Cloudflare: firewall rules for the PHP vulnerabilities
Serhii runs Shapelab, a web and mobile development agency in Tallinn, Estonia. The team builds web products, takes them over from other teams and looks after them in production, servers included.