
Advisory and analysis for CVE-2026-126714, a critical PHP file-based session handler flaw enabling object injection and RCE, with detection steps, affected versions, and patch guidance.

Fast YAML-based vulnerability scanner with template-driven detection engine for automated security testing across web apps, APIs, networks, DNS, and cloud infrastructure.

Open-source web application security scanner for automated vulnerability detection, manual penetration testing, and API security testing with a proxy-based interception engine.

This repository contains the scanner component for Greenbone Community Edition.
PHPAfterShellCRITICAL PHP SESSION HANDLING VULNERABILITY
π΄ Understand β’ Analyze β’ Detect β’ Patch β’ Protect
PHPAfterShell (CVE-2026-126714) is a critical vulnerability in PHP's default file-based session handler.
The vulnerability occurs when PHP partially overwrites an existing session file during an interrupted write operation.
This can result in a session file containing fragments of two different serialized sessions. When PHP subsequently reads the session, attacker-controlled serialized objects may be created.
Under suitable application conditions, including the presence of a usable PHP object gadget chain, this can lead to Remote Code Execution (RCE).
π΄ Security impact: Remote Code Execution
β οΈ Affected component: PHP ext-session
β οΈ Default configuration: File-based sessions
| Attribute | Details |
|---|---|
| Vulnerability | PHPAfterShell |
| CVE | CVE-2026-126714 |
| Vendor | PHP Group |
| Component | PHP Session Handler |
| Severity | Critical |
| CVSS | 9.2 / 10 (CVSS 4.0) |
| CWE | CWE-367, CWE-662 |
| Attack Vector | Network |
| Attack Complexity | Low |
| Attack Requirements | Present |
| Privileges Required | None |
| User Interaction | None |
| Primary Impact | Remote Code Execution |
The vulnerability exists in PHP's file-based session storage mechanism.
Default configuration:
session.save_handler = files
During session updates, PHP writes new serialized session data into an existing session file.
If the write operation is interrupted before completion, the file may contain:
When a subsequent request invokes:
session_start();
PHP processes the session data and may deserialize attacker-controlled objects.
If the application contains a suitable gadget chain, object injection can potentially escalate into arbitrary code execution.
ATTACKER
|
v
HTTP REQUEST / SESSION INPUT
|
v
PHP FILE SESSION HANDLER
|
v
INTERRUPTED WRITE OPERATION
|
v
PARTIALLY OVERWRITTEN FILE
|
v
SESSION DESERIALIZATION
|
v
PHP OBJECT INJECTION
|
v
GADGET CHAIN EXECUTION
|
v
REMOTE CODE EXECUTION
β οΈ Successful exploitation requires suitable control over session contents, a useful interruption point, and an applicable gadget chain.
| 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 |
Note: PHP 8.1 and older are unsupported upstream branches. Plan migration to a supported, patched release.
| Impact | Description |
|---|---|
| π΄ Remote Code Execution | Potential arbitrary code execution |
| π΄ Object Injection | Attacker-controlled object deserialization |
| π΄ Session Corruption | Mixed or malformed session data |
| π΄ Data Integrity | Unauthorized modification |
| π΄ Confidentiality | Potential exposure of sensitive data |
| π΄ Availability | Potential service compromise |
php -v
php -i | grep -E \
'session.save_handler|session.save_path|session.upload_progress.enabled'
php-fpm -v
<?php
echo "PHP Version: " . PHP_VERSION . PHP_EOL;
echo "Session Handler: " .
ini_get('session.save_handler') . PHP_EOL;
echo "Session Path: " .
ini_get('session.save_path') . PHP_EOL;
echo "Upload Progress: " .
ini_get('session.upload_progress.enabled') . PHP_EOL;
β οΈ Run these checks in the actual web-serving PHP environment. CLI configuration may differ from PHP-FPM or Apache.
Install a patched PHP version:
PHP 8.2.36
PHP 8.3.37
PHP 8.4.28
PHP 8.5.13
If the feature is unnecessary, temporarily disable it:
session.upload_progress.enabled = 0
This removes one important attacker-controlled session input path, but does not eliminate every possible exploitation scenario.
Review applications using:
session.save_handler = files
Evaluate alternative session storage backends where appropriate.
Example:
sudo systemctl restart php8.4-fpm
Adjust the service name to your installed version.
php -v
php-fpm -v
Also verify the PHP version used by the actual web application and all running workers.
| Resource | Link |
|---|---|
| Official PHP Advisory | GHSA-fm2m-fjf5-v3cp |
| CVE Database | CVE-2026-126714 |
| Technical Analysis | Depthfirst Research |
| Red Hat Advisory | Red Hat CVE |
| PHP Releases | PHP.net |
π΄ DETECT β’ ANALYZE β’ PATCH β’ PROTECT
PHPAfterShell | CVE-2026-126714 | 2026
Stay curious. Stay ethical. Stay secure.