⚡ Early Access OpenHiveOS Enterprise — Meet Bea (Business Execution Assistant): Watch the 30s Demo & Claim Priority Sandboxgethiveos.com →
Back to Production Traps
Cyber Security6 min read21 Nov 2026

phpAfterShell (CVE-2026-126714): PHP 8.2–8.5 Session RCE Fix

Disclosed Nov 19 by depthfirst, phpAfterShell (CVE-2026-126714, CVSS 9.2) splices PHP file session writes into deserialization RCE on PHP 8.2–8.5.

Author: Logic42 Engineering

Consider a hotel front-desk clerk who erases only the first half of a clipboard guest form instead of taking a clean sheet of paper, leaving yesterday's room numbers spliced onto today's check-in name. That incomplete overwrite is why "phpAfterShell" (Common Vulnerabilities and Exposures CVE-2026-126714, Common Vulnerability Scoring System (CVSS) 9.2) lets unauthenticated attackers turn routine PHP file sessions into Remote Code Execution (RCE).

Disclosed by security researchers at depthfirst on November 19, 2026, CVE-2026-126714 exploits an operational blind spot. Enterprise teams that patched October's PHP2Shell bug (CVE-2026-109618) remain exposed if their PHP runtime (8.2, 8.3, 8.4, or 8.5) still uses the default disk-based files session save handler.

phpAfterShell CVE-2026-126714 — PHP File Session Splicing Deserialization RCE Infographic

Instead of attacking object creation syntax directly, phpAfterShell corrupts the persistent session file on disk before your PHP script ever checks a password or role.

What Is phpAfterShell (CVE-2026-126714) and Why Do PHP2Shell Patches Miss It?

phpAfterShell (CVE-2026-126714, CVSS 9.2) is a critical deserialization RCE vulnerability in PHP's default file-based session handler affecting versions before 8.2.36, 8.3.37, 8.4.28, and 8.5.13. Because it exploits a non-atomic overwrite bug inside session disk storage rather than runtime object restrictions, systems that only applied October 2026 PHP2Shell (CVE-2026-109618) mitigations stay vulnerable.

Before inspecting logs, platform engineers need a crisp separation between October's runtime exploit and November's persistence-layer bypass:

DimensionPHP2Shell (CVE-2026-109618 · Oct 2026)phpAfterShell (CVE-2026-126714 · Nov 19, 2026)
Attack LayerPHP runtime execution and request parsing layer.Session disk persistence layer (session.save_handler = files).
Core MechanismRuntime object creation bypass inside Hypertext Transfer Protocol (HTTP) handlers.Non-atomic in-place file overwrite without prior truncation; an interrupted write splices new prefix bytes onto stale tail bytes.
Pre-Authentication TriggerApplication-layer HTTP request parsing.Unauthenticated multipart upload-progress writes before application code runs.
October Patch StatusMitigated once October 2026 updates are deployed.Still Vulnerable until November 19 patches (8.2.36 / 8.3.37 / 8.4.28 / 8.5.13) are applied.

How Does Non-Atomic File Session Splicing Trigger Deserialization RCE?

Non-atomic file session splicing enables PHP Object Injection (POI) because the default files save handler overwrites existing session files in place without truncating or clearing stale bytes first. When an attacker triggers an unauthenticated session write via PHP upload progress and interrupts a PHP worker mid-write, leftover session tail bytes splice with attacker input, corrupting deserialization boundaries inside session_start().

phpAfterShell Non-Atomic File Session Splice vs Atomic Redis Store Architecture

That three-stage file corruption chain happens reliably on disk-backed session volumes:

  1. Stage 1: Pre-Application Upload-Progress Write: PHP enables session.upload_progress.enabled by default on many web stacks. By submitting an unauthenticated multipart HTTP upload with a matching upload-progress field, a remote caller forces PHP's C core to write attacker-controlled key/value strings into /tmp/sess_<id> before application authentication middleware executes.

  2. Stage 2: Worker Interruption Creates a Corrupted File Splice: Because the files handler writes sequentially over existing disk blocks without prior truncation or atomic temp-file replacement, exhausting worker memory or triggering an early request abort leaves a spliced session file on disk: newly injected prefix bytes concatenated directly to leftover tail bytes from a previous session payload.

  3. Stage 3: session_start() Parses Raw Strings as Objects (POI to RCE): When a subsequent request calls session_start(), PHP's session unserializer loses type alignment across the corrupted boundary. Raw string content is interpreted as a serialized PHP Object (O:...), firing native or framework gadget chains (reusable object sequences that execute commands during deserialization) under the FastCGI Process Manager (PHP-FPM) worker identity.

Which PHP Versions and Session Configurations Are Exposed?

All PHP branches running the default files save handler prior to the November 19, 2026 security releases (8.2.36, 8.3.37, 8.4.28, 8.5.13, and 8.6.0) are exposed to CVE-2026-126714. Deployments that route sessions exclusively through external atomic key-value engines such as Redis or Memcached aren't affected by this disk-splice defect, though unpatched binaries still warrant immediate remediation.

PHP Release BranchVulnerable VersionsMandatory Patched Version (Nov 19, 2026)Container & Worker Action
PHP 8.2 Long-Term Support (LTS)< 8.2.368.2.36Upgrade runtime packages & restart all PHP-FPM masters.
PHP 8.3< 8.3.378.3.37Rebuild base container images & cycle worker pools.
PHP 8.4< 8.4.288.4.28Verify php -v across Command-Line Interface (CLI), cron, and PHP-FPM pods.
PHP 8.5< 8.5.138.5.13Apply vendor repository patch & purge stale /tmp/sess_*.
PHP 8.6Pre-release builds8.6.0Patched in the general availability release.

How Do Infrastructure Teams Eliminate phpAfterShell Permanently?

Infrastructure teams can eliminate phpAfterShell permanently by upgrading to the November 19 PHP releases, restarting every PHP-FPM worker pool, disabling session.upload_progress.enabled in php.ini, and migrating session.save_handler from local disk files to atomic redis or memcached stores while keeping perimeter Web Application Firewall (WAF) rules as defense-in-depth.

; /etc/php/8.4/fpm/conf.d/99-sovereign-session-hardening.ini
; 1. Eliminate non-atomic disk file splicing via atomic Redis key-value writes
session.save_handler = redis
session.save_path = "tcp://10.0.12.40:6379?auth=REDACTED_EPHEMERAL_SECRET"
session.serialize_handler = php_serialize

; 2. Block unauthenticated pre-application upload-progress session writes
session.upload_progress.enabled = 0
session.use_strict_mode = 1

Execute four remediation steps to close every exposure path:

  1. Upgrade PHP Binaries and Cycle PHP-FPM Workers: Running apt or yum updates on disk won't protect active requests while long-lived PHP-FPM processes keep the old binary in memory. Verify both php -v and active worker start timestamps immediately after rollout.

  2. Switch session.save_handler to Atomic Key-Value Storage (Redis): File-based sessions on local disks or shared Network File System (NFS) mounts don't give you atomic SET semantics or horizontal container safety. Migrating to Redis with php_serialize prevents leftover-byte splicing structurally.

  3. Disable Unauthenticated session.upload_progress & Enforce Strict Mode: Set session.upload_progress.enabled = 0 unless your frontend explicitly consumes native server upload bars, and keep session.use_strict_mode = 1 so PHP rejects uninitialized caller-supplied session identifiers.

  4. Layer WAF Rules Only as Temporary Perimeter Triage: While vendors such as Cloudflare pushed edge rules targeting known CVE-2026-126714 upload-progress probes, security advisories warn that edge WAF filters don't replace patching the underlying PHP runtime. Audit container patch hygiene against International Organization for Standardization / International Electrotechnical Commission (ISO/IEC) 27001 controls via the ISO/IEC 27001 Infrastructure Continuity Diagnostic.

Never reuse a half-erased clipboard sheet when a clean form costs nothing. Replacing partial disk overwrites with patched November 19 PHP binaries and atomic Redis session keys ensures session_start() never inherits corrupted tail bytes from a failed request.

Share this note
THE MONDAY PRODUCTION TRAP DISPATCH · WEEKLY 09:00 MYT

Enjoyed this autopsy? Get next Monday's architecture teardown + SVG blueprints in your inbox.

1 email every Monday morning. Zero marketing fluff — just real VRAM math, MCP security traps, and sovereign lakehouse patterns.

⚡ HiveOS Enterprise · AI Chief of Staff1-Day Priority Sandbox SLA

See HiveOS Enterprise & Bea (Business Execution Assistant) in Action

HiveOS connects to 5,000+ workplace apps with client-side PII redaction, 3-model consensus verification, and 80%+ local SLM cost savings. Watch the 30-second Executive Overview and 3-minute Walkthrough on gethiveos.com, or download the 6-slide Product Brochure.

Sovereign Practice Diagnostic
4 Pillars · 16 Calibrated Checkpoints

Auditing Runtime & Agentic Containment?

If your engineering teams are deploying autonomous tool loops, MCP servers, or evaluation sandboxes, our cyber practice conducts confidential architectural reviews to expose link-local leakage, SSRF vectors, and credential harvesting paths.

DIRECT PRINCIPAL ARCHITECT PEER REVIEW · NO SALES PITCH

Debugging this pattern in your own stack? Ask a Principal Architect directly or request a free 48-hour architecture sanity check:

Free in Interactive Diagnostic:Boardroom PDF DossierExcel Working Papers (.CSV)Legal & Kernel Playbook (.MD)
Confidential & Zero Third-Party Telemetry · Encrypted Practice Intake