// AI threat desk · 26 Nov 2026
Home/CVE · Vulns & Patches
Vulns & PatchesCriticalRCECVSS 9.2

PHP’s phpAfterShell flaw could enable remote code execution

HKCERT said a critical PHP flaw can enable unauthenticated remote code execution on vulnerable servers. Depthfirst disclosed it on Nov 19, 2026, with CVSS 9.2.

AI-generated image of a security analyst monitoring blurred server dashboards and vulnerability alerts in a dim operations centre.
AI-generated image, not a photo of the event.
Key takeaways
  • The flaw affects PHP’s default file-based session handler. HKCERT said it is tracked as CVE-2026-126714 with a CVSS v4.0 score of 9.2.
  • HKCERT said PHP fixed the issue in 8.2.36, 8.3.37, 8.4.28 and 8.5.13.

PHP published fixes on Nov 19, 2026, for phpAfterShell, a vulnerability in its default file-based session handler. HKCERT said the flaw is tracked as CVE-2026-126714 and has a critical CVSS v4.0 score of 9.2.

PHP says an attacker who can influence session contents and interrupt a replacement write may be able to make PHP later deserialize attacker-controlled objects. A suitable object gadget chain in an application can turn that into remote code execution, and HKCERT said the attack can work without authentication on vulnerable servers.

The issue affects PHP applications using file-based sessions. PHP said the affected code has been present since PHP 4.1.0, based on code inspection, while sessions stored in Redis, a database or another non-file handler are not affected by this specific defect.

On this page

Interrupted session writes can splice valid data

Depthfirst found reliable ways to interrupt session-file updates during session upload-progress updates. That allowed the researchers to splice the prefix of one valid session with the suffix of another.

HKCERT said PHP can update a session before application code runs. As a result, an application login check does not prevent PHP from reaching the affected code.

Depthfirst said that in a fresh HTTP run, the promoted object appeared on attempt 11.

PHP’s October releases did not include the fix

HKCERT said Depthfirst disclosed the flaw on Nov 19 and demonstrated how it could be combined with a separate PHP bug to run code remotely. Depthfirst also reported the vulnerability to PHP, which assigned the CVE and critical CVSS score.

The Hacker News said PHP 8.6.0 also includes the fix. HKCERT said PHP 8.0 and 8.1 are out of support.

Depthfirst said the vulnerability was discovered by its frontier AI models working with its researchers.

PHP’s fix truncates the session file to zero before writing replacement data and aborts the write if truncation fails. HKCERT said the fixed branches are PHP 8.2.36, 8.3.37, 8.4.28 and 8.5.13.

Depthfirst reported the issue privately in late October and worked with PHP maintainers on patches for all four supported branches. PHP published the fix and its advisory on Nov 19, 2026.

ReleaseFix status
PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35Do not contain the fix
PHP 8.2.36, 8.3.37, 8.4.28 and 8.5.13Fixed releases
PHP 8.6.0Includes the fix

What to do now

  1. Upgrade to the fixed release for your PHP branch when it becomes available.
  2. If you run an affected version, install the fixed release for your branch, rebuild container images, redeploy, and confirm production is running the new version.
  3. If you still run PHP 8.0 or 8.1, move to a supported release.

FAQ

What is the phpAfterShell PHP vulnerability?

It is a flaw in PHP’s default file-based session handler that can leave mixed old and new session data after an interrupted write. An attacker who can influence session contents and interrupt a replacement write may be able to make PHP deserialize attacker-controlled objects.

Can phpAfterShell lead to remote code execution?

Yes. A suitable object gadget chain in the application can turn the deserialization primitive into remote code execution, and HKCERT said the attack can be unauthenticated on vulnerable servers.

Which PHP versions contain the phpAfterShell fix?

HKCERT said the fixed releases are PHP 8.2.36, 8.3.37, 8.4.28 and 8.5.13. The Hacker News said PHP 8.6.0 also includes the fix.

Are PHP sessions stored in Redis affected?

Applications that store sessions in Redis, a database or another non-file handler are not affected by this specific defect.

Who disclosed the phpAfterShell flaw?

HKCERT said Depthfirst disclosed the flaw on Nov 19, 2026, after Depthfirst privately reported it to the PHP project in late October.

Sources

  1. New phpAfterShell Attack Bypasses PHP2Shell Fix to Enable Remote Code Execution, HKCERTPrimary
  2. Partially overwritten session files can lead to remote code execution, GitHubPrimary
  3. phpAfterShell: From Interrupted Session Writes to Remote Code Execution | depthfirst, DepthfirstPrimary
  4. phpAfterShell, DepthfirstPrimary
  5. phpAfterShell Explained: How Hackers Could Turn a PHP Session Flaw Into Code Execution, The Hacker News
How we checked this story
ClaimSourceStatus
HKCERT said phpAfterShell can lead to unauthenticated remote code execution on vulnerable PHP servers, even when the October PHP2Shell patches are installed.HKCERTAttributed
The vulnerability affects PHP’s default file-based session handler and can make interrupted writes leave mixed old and new session data.PHP, via GitHubConfirmed
HKCERT said the vulnerability is tracked as CVE-2026-126714 and has a CVSS v4.0 score of 9.2.HKCERTAttributed
Depthfirst reported the vulnerability to PHP, which assigned CVE-2026-126714 and a critical CVSS score of 9.2.DepthfirstConfirmed
HKCERT said depthfirst disclosed the flaw on November 19 and demonstrated combining it with a separate PHP bug to run code remotely.HKCERTAttributed
A suitable application object gadget chain can turn the deserialization primitive into remote code execution.PHP, via GitHubConfirmed
HKCERT said upload progress can cause PHP to update a session before application code runs, so an application login check may not prevent access to the vulnerable code.HKCERTAttributed
Depthfirst found reliable ways to interrupt session-file updates and splice one valid session prefix with another session suffix.DepthfirstConfirmed
HKCERT said the fixed releases are PHP 8.2.36, 8.3.37, 8.4.28, and 8.5.13.HKCERTAttributed
The Hacker News said pHP 8.6.0 also includes the fix.The Hacker NewsAttributed
The October 21 PHP releases 8.5.12, 8.4.27, 8.3.36, and 8.2.35 do not contain this fix.DepthfirstConfirmed
PHP sessions stored in Redis or a database are not affected by this specific file-handler flaw.DepthfirstConfirmed
Disabling upload progress removes an input path but does not fix applications that independently store attacker-controlled session data.PHP, via GitHubConfirmed
The fix truncates the session file before writing replacement data and aborts if truncation fails.PHP, via GitHubConfirmed
Depthfirst reported the issue privately in late October, and PHP published the fix and advisory on November 19, 2026.DepthfirstConfirmed
The affected code has been present since PHP 4.1.0, based on code inspection.PHP, via GitHubConfirmed
In a fresh HTTP run, the researchers’ promoted object appeared on attempt 11.DepthfirstConfirmed
Depthfirst says its vulnerability discovery involved frontier AI models working with its researchers.DepthfirstConfirmed
depthfirst.com published its report on Nov 19, 2026.depthfirst.comConfirmed

Could not verify

  • Whether phpAfterShell has been exploited in the wild is not established.
  • How many PHP servers or applications are affected is not established.
  • Whether the separate PHP memory-corruption bug used in the research chain is fixed is not established.
  • Whether the reported remote-code-execution chain works against specific PHP applications is not established.
Explore with AI