PHP session flaw phpAfterShell can lead to code execution
Original title: phpAfterShell Explained: How Hackers Could Turn a PHP Session Flaw Into Code Execution
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.
- 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.
Impact: Attacker-chosen session objects, and code execution with a gadget chain
| Product | Affected | Fixed in |
|---|---|---|
| PHP | 8.2 before 8.2.36 | 8.2.36 |
| PHP | 8.3 before 8.3.37 | 8.3.37 |
| PHP | 8.4 before 8.4.28 | 8.4.28 |
| PHP | 8.5 before 8.5.13 | 8.5.13 |
- 1.Install 8.2.36, 8.3.37, 8.4.28 or 8.5.13 for your branch, then rebuild and redeploy containers.
- 2.If you cannot update and do not use upload progress, set session.upload_progress.enabled to 0 and restart PHP workers.
- 3.Move PHP 8.1 and older to a supported branch.
- CVEs
- CVE-2026-126714
- Vendors
- PHP
- Organizations
- Depthfirst
Vulnerabilities mentioned
All| CVE | Vulnerability | CVSS | EPSS | Signals | Published |
|---|---|---|---|---|---|
| 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.
thehackernews.com
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.