
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-126714 is a critical remote code execution vulnerability in PHP's default file-based session handler, informally tracked under the name "PHPAfterShell." The flaw arises because the ps_files_write() function overwrites session files in-place without first truncating them, allowing a partially written file to contain a mix of old and new session data that can be deserialized as attacker-controlled objects. Affected versions include PHP 8.2.x before 8.2.36, 8.3.x before 8.3.37, 8.4.x before 8.4.28, and 8.5.x before 8.5.13. It was disclosed on November 19, 2026, with a CVSS v4.0 base score of 9.2 (Critical) (GitHub Advisory).
The root cause is a Time-of-Check Time-of-Use (TOCTOU) race condition combined with improper synchronization (CWE-367, CWE-662) in PHP's ext-session files save handler. When a session write is interrupted mid-operation — for example, via a hard memory-limit failure in a threaded PHP build or by timing a multipart upload via session upload progress — the session file can contain a prefix of the new session data followed by a suffix of the old session data. PHP's session decoder then deserializes this hybrid file, and bytes that were originally part of an ordinary string in the old session can be reinterpreted as serialized object data. If the application contains a suitable gadget chain (e.g., Guzzle, Monolog), this deserialization of attacker-controlled objects can lead to arbitrary code execution. The file lock used during writes prevents concurrent access but does not guarantee atomicity of the write itself (GitHub Advisory).
Successful exploitation allows an unauthenticated remote attacker to execute arbitrary PHP code with the privileges of the PHP worker process, resulting in full confidentiality, integrity, and availability compromise of the affected system. An attacker can read sensitive data, modify application files, deploy web shells, or pivot laterally within the network. Session data corruption is also possible even without a gadget chain, potentially disrupting application availability. The scope of impact depends on the PHP worker's privileges and the presence of a suitable deserialization gadget chain in the application (GitHub Advisory).
As of the disclosure date (November 19, 2026), no public proof-of-concept exploit code has been confirmed, and there is no evidence of active in-the-wild exploitation (GitHub Advisory). The EPSS score is reported at 0.0, reflecting the early stage of public awareness. The vulnerability is not currently listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires specific preconditions: attacker influence over session data, the ability to interrupt a session write at a precise moment, and the presence of a deserialization gadget chain in the target application, making opportunistic mass exploitation less trivial than a straightforward injection flaw.
files session save handler (the PHP default) on versions 8.2.x < 8.2.36, 8.3.x < 8.3.37, 8.4.x < 8.4.28, or 8.5.x < 8.5.13. Confirm that session upload progress is enabled (session.upload_progress.enabled = 1, which is the default).vendor/ directory) for known PHP deserialization gadget chains such as those in Guzzle or Monolog that can trigger code execution upon object instantiation.session_start() on the corrupted session file. PHP deserializes the hybrid file, reconstructing the attacker-controlled object and invoking its __wakeup() or __destruct() method via the gadget chain.Content-Type: multipart/form-data requests; outbound connections from the web server to unexpected external IPs or ports following session activity./tmp/ or the configured session.save_path with anomalous sizes (larger than expected or containing binary/non-printable data); unexpected web shells or PHP files created in the web root or upload directories; new cron jobs or scheduled tasks owned by the web server user.PHPSESSID cookies; PHP-FPM logs showing worker crashes or memory limit errors coinciding with session write activity.bash, curl, wget, python, nc); network connections initiated by the PHP worker process to non-standard destinations (GitHub Advisory).Upgrade PHP to the patched versions: 8.2.36, 8.3.37, 8.4.28, or 8.5.13, which fix the issue by truncating the session file to zero before writing replacement data. After upgrading, restart PHP-FPM, Apache, or the process running PHP. As a temporary workaround prior to upgrading, disable session upload progress by setting session.upload_progress.enabled = 0 in php.ini and in every PHP-FPM pool configuration file (not via ini_set() in application code), then restart workers — note this closes one input path but does not protect applications that independently store attacker-controlled data in sessions. Additionally, consider using an atomic session storage backend (e.g., Redis, Memcached, or a database) as an alternative to the default files handler, and audit application code to minimize untrusted data stored in sessions (GitHub Advisory).
The vulnerability received significant media coverage upon disclosure, with outlets including The Hacker News, BleepingComputer, SecurityWeek, and Infosecurity Magazine reporting on the PHP November 2026 security release that addressed this and other critical flaws. Security researchers and community members on X (Twitter) and Mastodon highlighted the severity of the session handler flaw, with accounts such as @IntCyberDigest and @DarkWebInformer amplifying the disclosure. Cloudflare Radar published a Zero Wire post specifically covering the "PHPAfterShell" nickname for this vulnerability. Checkmarx noted the complexity of exploitation while cautioning organizations to patch promptly. The Roots.io and Patchstack communities specifically addressed implications for WordPress and Joomla deployments running on PHP. Ox Security and DepthFirst published dedicated research posts analyzing the gadget chain exploitation potential (GitHub Advisory).
Fix availability across major Linux distributions and their releases.
bookworm
php8.2: 8.2.36-1~deb12u1
sid
php8.4: 8.4.28-2
trixie
php8.4: 8.4.28-1~deb13u1
bionic (esm-infra)
php7.2: 7.2.24-0ubuntu0.18.04.17+esm15
devel
php8.5
focal (esm-infra)
php7.4: 7.4.3-4ubuntu2.29+esm6
jammy
php8.1: 8.1.2-1ubuntu2.29
noble
php8.3: 8.3.6-0ubuntu0.24.04.14
resolute
php8.5: 8.5.4-0ubuntu1.6
trusty (esm-infra-legacy)
php5: 5.5.9+dfsg-1ubuntu4.29+esm19
xenial (esm-infra-legacy)
php7.0: 7.0.33-0ubuntu0.16.04.16+esm23
RHEL 8
:appstream:php-0:7.4-8100020261119125714.f7998665.src
RHEL 9
:appstream:php-0:8.2-9080020261120141350.9.src
RHEL 10
php8.4-0:8.4.28-1.el10_2.src
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."