Skip to content
NewA calmer, faster ZeroHour

PHP session flaw phpAfterShell can lead to code execution

Original title: phpAfterShell Explained: How Hackers Could Turn a PHP Session Flaw Into Code Execution

The Hacker News ()5 min read
Part of a story covered by 2 sourcesPHP patches phpAfterShell session flaw CVE-2026-126714Merged summary & timeline
AI summary · x-ai/grok-4.7Summaries by Vani AI

Fixed releases are 8.2.36, 8.3.37, 8.4.28 and 8.5.13; the October 21 updates do not include this fix.

PHP’s default file session handler can leave a cut-off write that mixes old and new serialized data, so the next session_start() may create an attacker-chosen object. With a suitable gadget chain, that can become code execution on the server. Maintainers rate CVE-2026-126714 at 9.2. Depthfirst reported the flaw. Sessions stored in Redis or a database are outside this defect, and no attacks are reported.

Unconfirmed: No attacks are reported, and code execution still requires a suitable gadget chain in the application.

Key facts
  • Affected ranges are 8.2 before 8.2.36, 8.3 before 8.3.37, 8.4 before 8.4.28 and 8.5 before 8.5.13.
  • PHP 8.6.0, also released today, includes the fix.
  • Upload progress can write the session before the application’s own code runs.
  • Turning off session.upload_progress.enabled closes only the upload path.
  • Fixed releases empty the session file before each write and disable upload progress by default.
Security assessment · AI, from the articlePublic proof of concept

Impact: Attacker-chosen session objects, and code execution with a gadget chain

ProductAffectedFixed in
PHP8.2 before 8.2.368.2.36
PHP8.3 before 8.3.378.3.37
PHP8.4 before 8.4.288.4.28
PHP8.5 before 8.5.138.5.13
What to do
  1. 1.Install 8.2.36, 8.3.37, 8.4.28 or 8.5.13 for your branch, then rebuild and redeploy containers.
  2. 2.If you cannot update and do not use upload progress, set session.upload_progress.enabled to 0 and restart PHP workers.
  3. 3.Move PHP 8.1 and older to a supported branch.
Analyze CVE-2026-126714 with Vani AIImpact, affected versions, exploitation, mitigations and detection

Vulnerabilities mentioned

All
CVEVulnerabilityCVSSEPSSSignalsPublished
CVE-2026-126714
Partial session-file overwrite RCE in PHP
9.2—

From the original article

5 min read at thehackernews.com

PHP's default file-based session storage can be made to return objects an attacker chose, by cutting off a session write at the right moment. When combined with a second weakness, such as a suitable gadget chain in the app, those objects can allow the attacker to run code on the server. Today's PHP releases fix the flaw, called phpAfterShell.

The Hacker News

thehackernews.com

Read the full article at The Hacker News

A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.