Cybersecurity protects your systems. Cybersecurity risk management protects your business.®

The Information Highway

The Information Highway

Font size: + –
6 minutes reading time (1276 words)

Cybersecurity Threat Advisory: phpAfterShell Flaw Puts PHP Web Servers at Risk of Takeover

Threat update

A month after the PHP2Shell scare, PHP is back on the patch list. On November 19, the PHP team shipped security updates for every supported branch, fixing 18 CVEs in all. Two of them stand out: CVE-2026-126714, nicknamed phpAfterShell, and CVE-2026-115560. Both are rated critical (CVSS 4.0 score of 9.2) and both could let an attacker with no username or password run their own code on a PHP web server. PHP runs a huge share of the internet, including WordPress, Drupal, Magento, and countless line-of-business portals, and it's often buried inside other products where no one thinks to look. No active exploitation has been reported yet, but a proof of concept is public, and attackers moved fast on PHP2Shell. If you host anything built on PHP, get it on this week's patch list.

Technical Detail and Additional Info

What is the threat?

Both flaws live in how PHP handles sessions; the small files PHP keeps on the server to remember who a visitor is between page loads. Each one gives an attacker a way to slip malicious data into a session file that PHP later "unpacks" (deserializes) and trusts. With the right building blocks in the application, that leads to remote code execution.

CVE-2026-126714 (phpAfterShell)

  • The bug: PHP's default file-based session handler writes new session data on top of the old file first, then trims the leftovers. Those two steps don't happen as one action.
  • The trick: If the PHP worker is interrupted in between, the file ends up holding the start of the new session glued to the tail of the old one. An attacker who controls that content can craft it so PHP reads part of it as serialized objects.
  • The easy path: PHP's session upload progress feature, which is on by default, updates the session file while a file upload is still being processed, before the website's own code even runs. That gives an outside attacker a way in.
  • Old code: PHP says the affected code has been around since PHP 4.1.0. Security firm Depthfirst found and named the flaw, reported it privately in late October, and has published a harmless proof of concept while holding back the full attack chain.

CVE-2026-115560 (sometimes called "PHP2Shell, the third one")

  • The bug: PHP can save session data in more than one format. If upload progress writes a session in one format and the application later reads it back in a different one, an attacker can hide a delimiter in the data that turns plain text into an object.
  • The catch: This only works in an unusual setup, where the server is configured with the php_binary or php_serialize handler and the application switches it to php at runtime. PHP itself calls this unlikely, which is why it waited for the regular release instead of issuing an emergency patch when it first disclosed the bug on October 23.

Affected versions for both are PHP 8.2.0 through 8.2.35, 8.3.0 through 8.3.36, 8.4.0 through 8.4.27, and 8.5.0 through 8.5.12. End-of-life releases (PHP 8.1 and older) get no official fix and are likely vulnerable too. 

Why is it noteworthy?

PHP is everywhere, and that's the problem. It powers most of the web's content management systems, and it's quietly bundled inside appliances, control panels, and vendor software. CISA pointed out during PHP2Shell that PHP is often a component of other products and may not be directly visible. A lot of businesses don't know how many PHP installs they actually have.

The timing matters too. In October, the PHP2Shell flaws (CVE-2026-109618 and CVE-2026-109619) went from disclosure to real-world exploitation within days, and attackers were probing honeypots before the patches even shipped. The patches for those flaws do not fix phpAfterShell. If you patched in October and checked the box, you're not done.

The November release also fixed several other critical and high-severity issues, including a PHP-FPM request smuggling flaw (CVE-2026-129289) and a local privilege escalation in PHP-FPM (CVE-2026-129291) that can reach root in some setups. Each needs specific conditions, but one update covers all of them.

What is the exposure or risk?

 Organizations face the most risk when:

  • Internet-facing websites, portals, or apps run PHP 8.2 through 8.5 below the fixed releases, or any version of PHP 8.1 or older
  • Sessions are stored as files on disk, which is PHP's default (sessions kept in Redis or a database are not affected by phpAfterShell, according to Depthfirst)
  • Session upload progress is still turned on, which was the default until this release
  • Applications store user-supplied data in sessions, or switch session settings in code
  • PHP is running inside a vendor product, appliance, or hosting control panel that nobody is tracking for updates
  • Only the command-line PHP was updated, while the web server's PHP workers are still running the old version

If attackers exploit these flaws, they could:

  • Run their own code on the web server with the permissions of the PHP process
  • Steal database credentials, API keys, and other secrets stored in configuration files
  • Read or tamper with customer data, orders, and form submissions
  • Plant web shells or malware for long-term access, or deface the site
  • Use the compromised server as a foothold to move deeper into your network

What are the recommendations?

 LBT Technology Group recommends the following actions:

  • Patch now, starting with internet-facing sites. Upgrade to PHP 8.5.13, 8.4.28, 8.3.37, or 8.2.36 (or later). If you use OS packages from Ubuntu, Red Hat, Debian, or similar, check your vendor's advisory for the backported package version.
  • Restart PHP after patching and confirm it took. Restart or reload PHP-FPM, Apache, or whatever serves PHP, then verify the version the web workers report, not just php -v on the command line.
  • Find all your PHP. Inventory every server, container, appliance, and vendor product that runs PHP. Ask vendors and hosting providers directly whether they've applied the November 19 fixes.
  • Turn off session upload progress if you can't patch today. Set session.upload_progress.enabled = 0 in php.ini or the FPM pool configuration and restart the workers. Setting it in application code with ini_set() is too late to help. This closes the easiest attack path for phpAfterShell, but it doesn't fix the underlying flaw, so treat it as a stopgap.
  • Keep session formats consistent. Make sure every application that shares session storage uses the same session.serialize_handler, and don't change it at runtime. After any change, clear out old session data.
  • Plan your way off end-of-life PHP. PHP 8.1 and older won't get official fixes. Get a vendor-supported backport in place now and schedule the upgrade.
  • Watch for warning signs. Review web and PHP logs for unusual worker crashes, fatal errors, session-related errors, or unexpected processes started by the web server. If an unpatched PHP site has been exposed to the internet, treat it as potentially compromised until it's updated and checked.
  • Add a layer in front. A web application firewall (WAF) can help filter malicious upload requests while you patch, but it isn't a replacement for updating.

Not sure where PHP is running in your environment, or whether your websites and vendor apps are on a fixed release? Contact LBT Technology Group for a no-pressure review of your web servers and patch management. 

References

 For more in-depth information about the recommendations, please visit the following links:

Your IT Tools Weren't Supposed to Be the Attack Ve...
When the Outage Is the Attack: What the Microsoft ...

Top Breaches Cost ($) of 2024

HEALTHCARE
FINANCIAL
INDUSTRIAL
TECHNOLOGY
ENERGY
Source: IBM Cost of a Data Breach Report 2024