PHP Session Deserializer Use-After-Free
CVE-2015-6835 is a use-after-free vulnerability in PHP's session deserialization logic affecting PHP before 5.4.45, 5.5.x before 5.5.29, and 5.6.x before 5.6.13. The flaw is triggered when the session deserializer performs multiple php_var_unserialize calls and mishandles object lifetime, allowing freed memory to be reused while still referenced. In practice, crafted session content can cause PHP to deserialize truncated or malformed serialized data into unintended objects, creating a path to memory corruption. In exploit chains documented at the time, the bug was particularly relevant when session data was stored outside PHP's standard session storage, such as in MySQL-backed session stores, where truncation of serialized session data could transform attacker-controlled input into a dangerous deserialization state. Successful exploitation can lead to arbitrary code execution or application crashes.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
Successful exploitation can result in arbitrary code execution in the context of the PHP process or denial of service through process crashes caused by use-after-free memory corruption. Where the vulnerable deserialization path can be influenced remotely through attacker-controlled session content, the flaw can be used as the memory-corruption component of a broader exploit chain to achieve full compromise of the web application environment.
If you can’t patch tonight, do this now.
Avoid storing raw serialized PHP session data in backends that can alter, truncate, or otherwise transform the serialized byte stream before it is deserialized. If a database-backed session store is required, encode session data in a form that preserves byte integrity before storage. Prefer PHP's standard session storage where feasible, as it was noted as not being affected in the same way in the documented exploit context. As a defense-in-depth measure in MySQL-backed deployments, enable strict SQL modes such as STRICT_TRANS_TABLES or STRICT_ALL_TABLES to prevent silent truncation that can help create exploitable malformed session data.
Patch, then assume compromise.
Upgrade PHP to a fixed release: 5.4.45 or later, 5.5.29 or later, 5.6.13 or later, or a newer unaffected branch such as 7.0.0 or later. Systems using distribution-packaged PHP should apply the vendor-provided security update that includes the fix for CVE-2015-6835. Where the vulnerability is part of an application-specific exploit chain, update the affected application components as well.
No validated public exploits yet. Hidden: 1 not yet analyzed, such as Exploit-DB entries.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
2 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.