New CVE Detected

CVE-2026-126714 – phpAfterShell: RCE via Partially Overwritten Session Files – PHP

Get a free Attack Surface scan to see if you’re exposed.

Be the first to know when new zero-days emerge:

Summary

CVE-2026-126714 ("phpAfterShell") is a critical remote code execution vulnerability in PHP’s default file-based session handler. It was disclosed by depthfirst and fixed by PHP on November 19, 2026. An interrupted session write can leave a session file that mixes new and old data. When PHP loads that file, attacker-chosen objects can be deserialized, and with a suitable gadget chain in the application this leads to code execution. It is rated CVSS v4.0 9.2 (Critical).

Technical details

  • Root cause: when updating a session, the files save handler writes the new data into the existing file and truncates the file only if the new data is shorter. If the write is interrupted, the file keeps the start of the new session followed by the end of the old one (CWE-367, CWE-662).
  • Trigger: the attacker needs to influence the session contents and interrupt the write at a useful point. Session upload progress is the easiest input path for a remote client. Applications that store large user-controlled strings in the session are another path.
  • Impact: the next session_start() deserializes the mixed data. With a suitable gadget chain in the application, this gives code execution with the privileges of the PHP worker.
  • Scope: only the files session save handler, which is PHP’s default. Redis, database and other session handlers are not affected by this defect.
  • Attack vector: network, no privileges or user interaction required.

Affected software

  • PHP 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.
  • The October 21, 2026 releases (8.2.35, 8.3.36, 8.4.27, 8.5.12), which fixed PHP2Shell, do not fix this issue.
  • PHP 8.1 and older are end-of-life, contain the same session write code and will not be fixed.

Severity

  • CVSS v4.0 base score: 9.2 (Critical)
  • Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Mitigation and recommended actions

  • Upgrade to PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13 or later. Rebuild container images and confirm that production runs the new version. Move PHP 8.1 and older to a supported branch.
  • If you cannot upgrade immediately, set session.upload_progress.enabled = 0 in php.ini and restart the PHP workers. This removes the easiest attack path, not the flaw.
  • Limit the untrusted data your application stores in sessions.
  • A session handler that replaces records atomically, such as Redis or a database, is not affected by this file-write defect.

References

Get a free Attack Surface scan to see if you’re exposed.

Get a free Attack Surface scan to see if you’re exposed.

How IONIX’s External Exposure Management Platform Detects and Validates
Zero-Days to Shrink MTTR

1

Map your entire attack surface (continously)

IONIX uses multi-factor discovery methods, including DNS analysis, certificate mapping, metadata inspection, and more, to automatically map every internet-facing asset across your environment. This includes cloud instances, third-party platforms, shadow IT, and even forgotten infrastructure that traditional tools miss.

2

Monitor for new CVEs

Dozens of threat intel feeds using agentic technology are continuously analyzed to detect the appearance of proof-of-concept code, exploit kits, and indicators of active targeting. IONIX goes further by applying AI to proactively evaluate whether emerging vulnerabilities are likely to be exploited, even before PoCs go public.

3

Identify Potential External Exposures

Not all CVEs matter. IONIX filters vulnerabilities by asking attacker-centric questions: Can it be reached from the internet? Does it require authentication? Is it being exploited in the wild? This dramatically reduces noise and focuses teams on threats that can actually be weaponized.

4

Create Safe, Scalable Exploit Validations

IONIX transforms real-world PoCs into safe, non-intrusive test payloads that can be run in production environments without disruption. These simulations are precisely targeted to the systems that are vulnerable, ensuring rapid validation without unnecessary load.

5

Execute Exploit Validations

By combining context about software stack, versioning, exposure status, and reachability, IONIX ensures that only the right payloads are executed against the right assets, maximizing efficiency and minimizing risk.

6

Drive Fast and Actionable Remediation

Results are routed through integrations with ticketing, SOAR, and SIEM tools. Issues are written in plain language, bundled into remediation clusters, and prioritized based on asset criticality, exploitability, and blast radius. This shortens mean time to remediation (MTTR) and empowers teams to act with confidence.

Are you exposed?

Get a free report of your organization’s exposure to this CVE and threat

Subscribe to Threat Center RSS

Copy/paste the link below into your preferred RSS reader or follow these instructions to subscribe to Slack alerts.

Get Real-Time CVE Alerts to Your Email

Be the first to know when new zero-days emerge