The PHP development team has released security updates addressing CVE-2026-126714, a critical vulnerability dubbed phpAfterShell that can turn partially overwritten session files into an arbitrary deserialization primitive and potentially remote code execution. The flaw carries a CVSS v4.0 score of 9.2, Critical and affects PHP applications using the default file-based session handler.
Unlike a vulnerability confined to one CMS or framework, phpAfterShell exists in PHP itself. Applications built with WordPress, Laravel, custom PHP frameworks, or other software can therefore fall within the exposure scope if they run a vulnerable PHP release and store sessions as files. Applications using Redis, databases, or other non-file session handlers are outside this specific defect.
The vulnerability stems from how PHP updates existing session files. If an update is interrupted at the right moment, part of the new session data can overwrite the beginning of the file while bytes from the previous session remain at the end. PHP may later interpret this hybrid file as valid session state and deserialize attacker-controlled objects when the application calls session_start().
Successful exploitation requires several conditions, including attacker influence over session data, an interruption at a useful point during the write, and a suitable deserialization path. Depthfirst demonstrated that the primitive could be chained with a separate PHP-native memory-corruption technique to achieve code execution inside the PHP worker process.
The issue is especially relevant because PHP’s session upload-progress feature can modify a session while PHP is still parsing an unauthenticated multipart request, before application code begins executing. This can give an attacker a pre-authentication path to manipulate file-backed session state under vulnerable configurations.
Organizations can use SOC Prime’s AI-Native Detection Intelligence Platform to operationalize vulnerability intelligence and accelerate hunting for exploitation behavior across SIEM, EDR, XDR, and Data Lake environments.
Detect CVE-2026-126714 by correlating suspicious multipart uploads, abnormal PHP session behavior, repeated worker crashes, and unexpected operating-system activity originating from PHP-FPM, Apache, or other PHP worker processes.
CVE-2026-126714 analysis
CVE-2026-126714 affects supported PHP branches prior to 8.2.36, 8.3.37, 8.4.28, and 8.5.13 when applications use file-backed sessions. PHP 8.6.0 was released with the correction included. Older PHP 8.1 and earlier releases are end-of-life and should be migrated to a supported branch rather than relied upon for ongoing security updates.
The vulnerability is located in PHP’s default files session save handler:
session.save_handler = files
PHP stores each session in a file such as:
<session.save_path>/sess_<SESSION_ID>
When session data changes, PHP serializes the new state and writes it into the existing file. The vulnerable design did not treat this update as a fully atomic transaction.
Under the default PHP session serialization format, multiple values are stored consecutively as records consisting of a session key and serialized value. Serialized strings contain explicit length information that tells PHP where a value ends and where parsing should continue.
That creates an important exploitation opportunity. Data that is harmless while positioned inside a serialized string can become active syntax when the beginning of the file is replaced with another carefully constructed session prefix.
Depthfirst researchers showed that two individually legitimate sessions could therefore be combined into a third valid but attacker-influenced session if the update process stops at the appropriate moment.
PHP writes the replacement session using filesystem operations such as pwrite() and ftruncate(). These operations are not guaranteed to behave as one atomic session commit. If the worker process terminates during or between these operations, stale bytes from the previous file may remain on disk.
Researchers identified two useful interruption scenarios. In one, the worker dies while a larger replacement session is being written, leaving a prefix of the new state combined with the old file’s tail. In another, the new shorter state is written successfully but the worker terminates before ftruncate() removes the remaining old bytes.
A later request that calls session_start() loads the resulting file as trusted server-side state. Carefully manipulated serialized lengths can then cause previously inert bytes in the old tail to be interpreted as additional session entries or serialized objects.
The easiest externally reachable path identified by researchers involves PHP’s session upload-progress mechanism. When enabled, a multipart request containing PHP_SESSION_UPLOAD_PROGRESS can cause PHP to open and update session state during request parsing, before the application’s own PHP script begins.
This means an application does not necessarily need to provide a dedicated upload function. The multipart request only needs to reach a PHP Web SAPI where upload progress is enabled, and the attacker must later reach an application path that loads the manipulated session.
The attack still requires the session write to be interrupted at an advantageous point. Depthfirst demonstrated techniques involving memory pressure and worker termination to create the required partially updated session file. In one fresh test run, researchers produced the targeted object state after 11 attempts. This result describes their laboratory environment and should not be interpreted as a fixed exploitation success rate across real deployments.
The CVE-2026-126714 PoC publicly demonstrates the core session-manipulation primitive using a harmless stdClass object. Security advisories now note that proof-of-concept material is publicly available, while Depthfirst has withheld key details of its separate PHP-native memory-corruption chain used to turn deserialization into end-to-end code execution.
This distinction matters because arbitrary deserialization is not automatically equivalent to universal RCE. In a typical deployment, exploitation requires the target application to expose a suitable gadget chain that performs dangerous actions when attacker-controlled objects are reconstructed.
Depthfirst states that its own RCE demonstration does not depend on an application-defined gadget. Instead, researchers identified a second flaw in PHP-native classes that provides memory corruption and eventually redirects execution inside the PHP worker. The underlying decoder and final heap-layout details remain withheld for coordinated disclosure.
The issue is closely related to October’s PHP2Shell research. PHP released fixes for CVE-2026-109618 and CVE-2026-109619 on October 21, but those updates did not correct phpAfterShell.
The earlier remediation restricted class resolution during the upload-progress callback, preventing the original exploitation technique from activating objects at that moment. However, PHP still wrote updated session data back to the same file, leaving the underlying interrupted-write behavior intact.
Therefore, environments updated to PHP 8.2.35, 8.3.36, 8.4.27, or 8.5.12 for PHP2Shell remain exposed and must apply the November security releases.
For CVE-2026-126714 detection, defenders should monitor both the initial web behavior and subsequent host activity. Potential indicators include unusual multipart requests carrying session upload-progress fields, repeated manipulation of the same session identifier, abnormal PHP session parsing failures, worker terminations, out-of-memory events, and unexpected session corruption.
Endpoint telemetry is particularly valuable for identifying successful exploitation. Security teams should investigate PHP-FPM, Apache, Nginx/PHP-FPM, or other PHP worker processes unexpectedly launching utilities such as sh, bash, cmd.exe, PowerShell, curl, wget, Python.
Unexpected outbound network connections from PHP workers, newly created executable files, modifications to web application directories, persistence mechanisms, or credential-access behavior should significantly increase confidence that exploitation progressed beyond session corruption.
Traditional CVE-2026-126714 IOCs such as fixed IP addresses, domains, malware hashes, or command-and-control infrastructure are currently of limited value. phpAfterShell is a vulnerability primitive rather than a malware campaign, and neither PHP nor Depthfirst has reported active exploitation in the wild.
Organizations should therefore prioritize version and configuration exposure assessment alongside behavior-based detection rather than waiting for campaign-specific blocklists.
Security teams looking for additional details for CVE-2026-126714 should verify the PHP runtime that actually handles production web requests. Container images, hosting platforms, application appliances, and custom runtime bundles may use a different PHP build from the command-line version available on the host.
CVE-2026-126714 Mitigation
The primary remediation is to install the PHP security release for the affected branch. PHP published the fixes on November 19, 2026.
| PHP branch | Vulnerable versions | Fixed version |
| 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 |
| PHP 8.6 | Pre-release builds affected during development | 8.6.0 includes fix |
PHP’s official changelog identifies CVE-2026-126714 as a session vulnerability in which partially overwritten session files can lead to remote code execution.
Organizations running containers should rebuild affected images and redeploy rather than merely updating packages on the underlying host. Administrators should then verify the PHP version used by production web workers because command-line PHP and the runtime serving HTTP requests can differ.
Linux distributions may also backport the correction without changing PHP’s upstream version number in the same way, so package-vendor advisories should be checked when determining whether a distribution-supplied build is secure.
If immediate patching is impossible, organizations that do not require session upload progress should disable it:
session.upload_progress.enabled = 0
PHP workers must be restarted after the configuration change. Depthfirst describes this as removing the easiest exploitation path, not as a complete fix, because applications may expose other ways for attackers to influence session data.
The fixed PHP releases also disable session upload progress by default. Administrators should nevertheless inspect active php.ini files, hosting-panel settings, and application-specific overrides because an existing configuration can explicitly switch the feature back on.
Applications using Redis, a database, or another session store that atomically replaces records are not affected by this specific file-handler defect. Moving away from file-backed sessions can reduce exposure to the issue, but installing the patched PHP release remains the recommended remediation.
Security teams should also reduce the amount of attacker-controlled data placed into session values. Even after remediation, minimizing untrusted serialized state reduces the attack surface for application-level deserialization gadget chains.
Because there is currently no evidence of active exploitation, retrospective hunting should focus on high-confidence anomalies rather than assuming every malformed upload indicates compromise. However, internet-facing PHP servers that experienced unexplained worker crashes, out-of-memory events, or unusual subprocess execution before patching warrant additional investigation.
Detection content may not be available for every CVE. Check the SOC Prime Platform for current coverage. If relevant detections are not yet available, check again as new threat intelligence and detection content are continuously added.
FAQ
What is CVE-2026-126714 and how does it work?
CVE-2026-126714, also called phpAfterShell, is a critical vulnerability in PHP’s file-based session handler. PHP can update an existing session file without atomically replacing its previous contents. If that write is interrupted, the resulting file may contain the beginning of new session data followed by leftover bytes from the previous state. An attacker can manipulate serialized lengths so those leftover bytes are interpreted as new session entries or serialized objects during a later session_start(), creating an arbitrary deserialization primitive.
When was CVE-2026-126714 first discovered?
Depthfirst has not published an exact discovery date. The company states that its AI-assisted security research team discovered the vulnerability while examining the October PHP2Shell remediation and privately reported it to the PHP project in late October 2026. PHP released the coordinated security fixes and publicly disclosed the issue on November 19, 2026.
What is the impact of CVE-2026-126714 on systems?
Successful exploitation can corrupt server-side session state, inject serialized objects, manipulate application session values, and potentially execute arbitrary code with the privileges of the PHP worker. Session manipulation can also affect values used for identity, authorization, CSRF protection, password-reset processes, and application workflows. RCE requires a usable deserialization gadget chain or another technique capable of turning attacker-controlled object reconstruction into code execution.
Can CVE-2026-126714 still affect me in 2026?
Yes. Systems remain exposed if they use an affected PHP release with file-based sessions and have not installed the November 19 security updates. Importantly, PHP versions released on October 21 to fix PHP2Shell do not contain this correction. Applications using WordPress, Laravel, or other frameworks are not automatically protected because the vulnerability resides in PHP itself rather than in a specific framework.
How can I protect myself from CVE-2026-126714?
Upgrade to PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13, PHP 8.6.0, or a vendor package containing the equivalent backport. Rebuild and redeploy containers, restart PHP workers, and verify the version actually processing production requests. If patching cannot be completed immediately, disable session.upload_progress.enabled when the application does not require it and minimize attacker-controlled session data. Systems still running end-of-life PHP branches should migrate to a supported release.