Skip to navigation

Threat reportVulnerabilityTL-2026-6478

phpAfterShell (CVE-2026-126714): PHP Files Session Handler Partial-Overwrite Flaw Bypasses PHP2Shell Fix, Enabling Remote Code Execution

criticalTRACKING

phpAfterShell (CVE-2026-126714) is a CVSS v4.0 9.2 flaw in PHP's default files session save handler: an interrupted in-place session write leaves a mix of new and old data that PHP later deserializes as objects, which can lead to remote code execution.

Key facts

IdentifiersTL-2026-6478, CVE-2026-126714, CVE-2026-115560
Also known asphpAfterShell, PHP session partial overwrite RCE
SeverityCRITICAL
CVSS9.2 (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)
First disclosed
Exploitation statusPublic proof-of-concept exploit for a linked CVE
EPSSCVE-2026-115560: 56.4% (99.0th percentile)
Affected productsPHP Group PHP (ext/session, files save handler)
Weaknesses (CWE)CWE-367, CWE-662
MalwarePHP
MITRE ATT&CK techniquesT1005 Data from Local System, T1059 Command and Scripting Interpreter, T1059.004 Command and Scripting Interpreter: Unix Shell, T1105 Ingress Tool Transfer, T1190 Exploit Public-Facing Application, T1499.004 Endpoint Denial of Service: Application or System Exploitation, T1552.001 Unsecured Credentials: Credentials In Files, T1565.001 Data Manipulation: Stored Data Manipulation
MotivationUNKNOWN
Target sectorstechnology, government administration, finance, health, retail
Target regionsGlobal
Detection rules9 (1 shown free)
Sources10 cited sources

Detection coverage

As of 2026-11-20, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-6478 across Splunk SPL, Microsoft KQL and Sigma, covering 10 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.

Free detection: phpAfterShell Upload-Progress Multipart Burst — Exploitation (SPL)

Detects the unauthenticated request shape used to reach the PHP files session handler partial-overwrite flaw phpAfterShell (CVE-2026-126714, TL-2026-6478): multipart/form-data POSTs carrying the PHP_SESSION_UPLOAD_PROGRESS field, or a one-minute burst of multipart POSTs from one source that coincides with HTTP 5xx responses (worker killed mid-write by OOM or memory_limit, Variant A/B). The marker is only visible where WAF/ModSecurity audit logs capture request bodies; the burst-plus-5xx branch works on plain web logs.

  • Languages: Splunk SPL, Microsoft KQL, Sigma
  • ATT&CK: T1190, T1499.004, T1565.001
  • Data sources: apache:access, nginx:plus:kv, modsec:audit, waf_logs
  • Severity: critical
  • Confidence: high

Splunk SPL

index=web (sourcetype="apache:access" OR sourcetype="nginx:plus:kv" OR sourcetype="modsec:audit") earliest=-24h http_method=POST (http_content_type="multipart/form-data*" OR "PHP_SESSION_UPLOAD_PROGRESS")
| eval progress_marker=if(match(_raw,"PHP_SESSION_UPLOAD_PROGRESS"),1,0), server_error=if(tonumber(status)>=500,1,0)
| bin _time span=1m
| stats count AS multipart_posts sum(progress_marker) AS progress_marker_hits sum(server_error) AS server_errors dc(uri_path) AS distinct_uris values(uri_path) AS uris values(http_user_agent) AS user_agents by _time, src, dest
| where progress_marker_hits>0 OR (multipart_posts>=20 AND server_errors>=3)
| table _time src dest multipart_posts progress_marker_hits server_errors distinct_uris uris user_agents

Microsoft KQL

CommonSecurityLog
| where TimeGenerated > ago(24h)
| where RequestMethod =~ 'POST'
| where AdditionalExtensions has 'PHP_SESSION_UPLOAD_PROGRESS' or Message has 'PHP_SESSION_UPLOAD_PROGRESS' or AdditionalExtensions has 'multipart/form-data'
| extend ProgressMarker = iff(AdditionalExtensions has 'PHP_SESSION_UPLOAD_PROGRESS' or Message has 'PHP_SESSION_UPLOAD_PROGRESS', 1, 0)
| summarize MultipartPosts = count(), ProgressMarkerHits = sum(ProgressMarker), DistinctUris = dcount(RequestURL), Uris = make_set(RequestURL, 10), UserAgents = make_set(RequestClientApplication, 5) by bin(TimeGenerated, 1m), SourceIP, DestinationIP
| where ProgressMarkerHits > 0 or MultipartPosts >= 20
| project TimeGenerated, SourceIP, DestinationIP, MultipartPosts, ProgressMarkerHits, DistinctUris, Uris, UserAgents

Sigma

title: phpAfterShell PHP_SESSION_UPLOAD_PROGRESS Multipart POST (CVE-2026-126714)
id: 6b1f3c2e-8a47-4d1b-9c55-2f0a7e4d1a01
status: experimental
description: Detects web or WAF log records for POST requests carrying the PHP_SESSION_UPLOAD_PROGRESS field, the unauthenticated route to the PHP files session handler partial-overwrite flaw phpAfterShell (CVE-2026-126714, TL-2026-6478).
references:
    - https://depthfirst.com/research/phpaftershell
    - https://github.com/php/php-src/security/advisories/GHSA-fm2m-fjf5-v3cp
author: Threadlinqs Team
date: 2026/11/19
tags:
    - attack.initial-access
    - attack.t1190
    - attack.impact
    - attack.t1499.004
    - cve.2026.126714
logsource:
    category: webserver
detection:
    keywords:
        - 'PHP_SESSION_UPLOAD_PROGRESS'
    selection_method:
        cs-method: 'POST'
    condition: keywords and selection_method
falsepositives:
    - Applications that legitimately use PHP session upload progress tracking
    - Vulnerability scanners and authorized penetration tests
level: high

Known false positives:

  • Applications that legitimately enable session.upload_progress and send PHP_SESSION_UPLOAD_PROGRESS with large file uploads
  • Bulk file-upload clients or backup tools producing bursts of multipart POSTs, some ending in 5xx under load
  • Authorized vulnerability scanners and penetration tests

Tuning notes: Marker matching needs request-body logging (ModSecurity audit, WAF). Without it only the burst-plus-5xx branch fires; tune multipart_posts>=20 and server_errors>=3 to your upload baseline. Allow-list known upload endpoints and trusted source ranges. Correlate hits with kernel OOM-kill events on the same host in the same minute.

8 more detection rules (Splunk SPL, Microsoft KQL, Sigma) · unlock with TL Creds. Sign up free to unlock the detection rules or query them with the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account)
  • phpAfterShell Upload-Progress Multipart Burst — Exploitation (KQL) · unlock with TL Creds
  • phpAfterShell PHP Worker Spawning Shell or Downloader — Post-Exploitation (KQL) · unlock with TL Creds
  • phpAfterShell Related Community Infrastructure Contact — C2 / Ingress Transfer (KQL) · unlock with TL Creds
  • phpAfterShell Upload-Progress Multipart POST — Exploitation (Sigma) · unlock with TL Creds
  • phpAfterShell PHP Worker Spawning Shell or Downloader — Post-Exploitation (Sigma) · unlock with TL Creds
  • phpAfterShell Related Community Infrastructure Contact — C2 / Ingress Transfer (Sigma) · unlock with TL Creds
  • phpAfterShell PHP Worker Spawning Shell or Downloader — Post-Exploitation (SPL) · unlock with TL Creds
  • phpAfterShell Related Community Infrastructure Contact — C2 / Ingress Transfer (SPL) · unlock with TL Creds

Indicators of compromise

As of 2026-11-20, Threadlinqs Intelligence tracks 10 indicators of compromise for TL-2026-6478.

10 indicators of compromise · unlock with TL Creds. Compare plans

Technical analysis

It was disclosed on 2026-11-19 by depthfirst and works on servers patched for the October PHP2Shell flaws. Sources describe research demonstrations only and report no in-the-wild exploitation.

phpAfterShell is a vulnerability in ext/session in PHP's default `files` session save handler (CVE-2026-126714, CWE-367 and CWE-662). The handler writes updated session data over the existing session file in place, using pwrite() followed by ftruncate(), without clearing the file first. These operations are not atomic. If the PHP worker is interrupted partway through, the file can contain a prefix of the new session followed by the tail of the old one. The mixed file can still parse, but with a different meaning: length fields in the new prefix can make leftover bytes of an ordinary string parse as new session keys and serialized objects.

The most direct trigger is session upload progress (`session.upload_progress.enabled`). During RFC 1867 multipart parsing, PHP's upload-progress callback can open, read, update and rewrite the session file before the target script runs. A single unauthenticated multipart/form-data request is therefore enough to reach the session file, and an application login check does not block it. depthfirst describes two variants. In Variant A the worker is killed during pwrite(), usually by a memory-cgroup OOM kill, and the truncate happens before the write. In Variant B the worker dies between pwrite() and ftruncate(), and the truncate happens after the write. The GitHub advisory (GHSA-fm2m-fjf5-v3cp) lists further triggers: large user-controlled strings stored in sessions and, in threaded builds, a memory-limit failure in another thread that interrupts the write.

The next request that calls session_start() deserializes the promoted objects. The October PHP2Shell patches (CVE-2026-109618 and CVE-2026-109619) made the upload-progress callback carry objects as __PHP_Incomplete_Class. That restriction ends when RFC 1867 processing finishes, and the serialized data still reaches the file, so it does not stop this attack. depthfirst reports chaining the injected object into a memory-corruption bug in a PHP-native class to get code execution in the Apache worker process. The native-class decoder and heap layout were withheld pending coordinated disclosure. The advisory also notes that a suitable application gadget chain can give code execution. Code runs with the privileges of the PHP worker, which can expose credentials, application files and customer records.

The public proof from depthfirst uses a harmless stdClass object to show the splice (it creates $_SESSION['evil']), and a full-chain HTTP demonstration video is linked. The source article reports no in-the-wild exploitation and lists no IOCs or threat actors. Sessions stored in Redis or a database are reportedly not affected by this specific flaw. The fix (php-src commit c2b02f24dff, 'ext/session: Truncate session file after successful write') changes the truncate ordering. The GHSA advisory says the shipped fix truncates the file to zero before writing and aborts if truncation fails. Interrupted writes may still lose data, but the old suffix is no longer retained. Fixed releases are PHP 8.2.36, 8.3.37, 8.4.28 and 8.5.13. Official PHP 7.4, 8.0 and 8.1 minimal-backport branches are listed as not vulnerable by depthfirst, because the upload-progress callback returns without opening the session. The source article describes PHP 8.0 and 8.1 as out of support. Downstream distribution packages may carry fixes without changing PHP_VERSION.

The PHP2Shell flaws (CVE-2026-109618, memory corruption on OOM, and CVE-2026-109619, a use-after-free in upload progress) were patched on 2026-10-21 and added to CISA KEV on 2026-10-26 after exploitation was confirmed. phpAfterShell itself is not on KEV. A separate, distinct session-related PHP issue, CVE-2026-115560, was disclosed on 2026-10-23. Sources do not say whether it is related to phpAfterShell.

MITRE ATT&CK techniques by tactic:

Collection

T1005 Data from Local System

Execution

T1059 Command and Scripting Interpreter; T1059.004 Command and Scripting Interpreter: Unix Shell

Command and Control

T1105 Ingress Tool Transfer

Initial Access

T1190 Exploit Public-Facing Application

Impact

T1499.004 Endpoint Denial of Service: Application or System Exploitation; T1565.001 Data Manipulation: Stored Data Manipulation

Credential Access

T1552.001 Unsecured Credentials: Credentials In Files

Remediation

Patches

  • PHP 8.2.36
  • PHP 8.3.37
  • PHP 8.4.28
  • PHP 8.5.13
  • Check Linux distribution advisories, since packaged builds may carry the fix under a different version number

Immediate actions

  • Upgrade PHP to a fixed release: 8.2.36, 8.3.37, 8.4.28 or 8.5.13
  • If upgrading must wait, set session.upload_progress.enabled = 0 (php_admin_flag in PHP-FPM pool or Apache config) and restart PHP workers; this blocks the upload-progress route but does not fix the session handler
  • Verify the PHP version serving web requests, not only the CLI binary

Workarounds

  • Set session.upload_progress.enabled = 0 and restart PHP workers
  • Store sessions in Redis or a database instead of the default files handler

Longer-term hardening

  • Move off unsupported PHP 8.0 and 8.1 to a supported release
  • Use a session backend that replaces records atomically, such as Redis or a database
  • Limit untrusted or large user-controlled data stored in sessions
  • Rebuild and redeploy container images with the patched PHP

Affected and fixed versions

  • PHP Group — PHP (ext/session, files save handler)
    Vulnerable versions: 8.2.0 to before 8.2.36; 8.3.0 to before 8.3.37; 8.4.0 to before 8.4.28; 8.5.0 to before 8.5.13
    Fixed in: 8.2.36; 8.3.37; 8.4.28; 8.5.13

Timeline

Last updated · revalidated 1× · latest source

  • PHP announces it will release patches for two critical vulnerabilities (PHP2Shell: CVE-2026-109618 and CVE-2026-109619).
  • PHP ships emergency fixes in 8.2.35, 8.3.36, 8.4.27 and 8.5.12 for the PHP2Shell flaws; the fix restricts which objects can be rebuilt during upload-progress processing but does not change the in-place session file update.
  • PHP discloses a separate session-related RCE, CVE-2026-115560, with upload-progress disablement as the interim mitigation; sources do not state whether it relates to phpAfterShell.
  • CISA adds the two PHP2Shell flaws to the Known Exploited Vulnerabilities catalog after honeypot-confirmed exploitation; phpAfterShell is not listed.
  • Date to which depthfirst's affected-version table is current.
  • NVD publishes CVE-2026-126714 (source security@php.net) with CVSS v4.0 9.2, CWE-367/CWE-662, and references to the php-src GHSA, SUSE, Ubuntu, depthfirst and a Semgrep detection PR.
  • PHP releases fixes in 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0; the changelog references GHSA-fm2m-fjf5-v3cp, and fixed releases disable session upload progress by default (local overrides may re-enable it).
  • Cyber Security News reports the attack; it describes a research demonstration and no in-the-wild exploitation.
  • depthfirst (Yuhang Wu) publishes the phpAfterShell analysis; the PHP security advisory GHSA-fm2m-fjf5-v3cp and the NVD record for CVE-2026-126714 are published the same day, with fixes in PHP 8.2.36, 8.3.37, 8.4.28 and 8.5.13.
  • NVD record modified, status Awaiting Analysis; SSVC assessment lists exploitation 'none', automatable 'yes', technical impact 'total'.

Update history

Sources cited

Other reports on CVE-2026-126714

Other reports on CVE-2026-115560

Previous and next in vulnerability

Drafted by the Threadlinqs research pipeline from 10 sources; published ; last updated .

Threadlinqs Intelligence — Real-Time Threat Detection Platform

// threat_feed
$ sort --newest
Showing all threats

Live intelligence console

Threat level

Latest Threats