PHP has fixed a critical vulnerability in its default file-based session handler after researchers demonstrated an exploit chain that could let a remote attacker execute code on an affected server. Tracked as CVE-2026-126714 and named phpAfterShell, the flaw carries a CVSS v4.0 score of 9.2.

The PHP security advisory says an interrupted session-file write can leave parts of two serialized sessions in the same file, allowing attacker-controlled objects to be deserialized when the application later reads the session.

The problem lies in how PHP rewrites an existing session file. The update uses file operations that are not atomic, so a worker interrupted at the right point can leave a new session prefix followed by the old file’s remaining data. An attacker must be able to influence session contents and interrupt the replacement write at a useful point. A suitable object-gadget chain in the application can then turn the deserialization primitive into code execution. In its technical analysis published November 19, researcher Depthfirst said it combined the issue with a memory-corruption flaw in a PHP-native class to demonstrate remote code execution.

The vulnerability affects PHP’s files session handler, which is the default storage method. The advisory lists PHP 8.2 releases before 8.2.36, 8.3 releases before 8.3.37, 8.4 releases before 8.4.28 and 8.5 releases before 8.5.13 as affected. It says the issue is not limited to session upload progress, although multipart uploads provide one way to influence session data. Applications storing sessions in Redis or a database are not affected by this specific file-write flaw. Fixed releases include PHP 8.5.13, alongside 8.2.36, 8.3.37 and 8.4.28.

READ
Java4Shell Probes Continue, GreyNoise Sees No Intrusions

Depthfirst said the weakness remained after October’s PHP2Shell fixes because those updates restricted class resolution during upload-progress processing but did not change the underlying session-file write behavior. CVE-2026-126714 is separate from the earlier PHP2Shell vulnerabilities, tracked as CVE-2026-109618 and CVE-2026-109619. The public disclosures describe a researcher-demonstrated exploit; they do not report confirmed exploitation in live attacks.


Buy ExpressVPN with PayPal or Credit Card
Advertisement