How the session file can become unsafe
The PHP project says the file-based session handler can leave parts of two serialized sessions in one file if a write is interrupted. An attacker who can influence session contents and interrupt a replacement write may affect what PHP deserializes when the session is read again. A suitable object gadget chain in the application could turn this into remote code execution.
The issue is CVE-2026-126714. It affects PHP before 8.2.36, 8.3.37, 8.4.28 and 8.5.13 in the listed branches. This is a configuration and application dependent path; do not assume that every PHP site can be exploited in the same way.
Check how sessions are stored
Identify PHP applications that use the file-based session handler and check whether untrusted users can influence session values. Review object deserialization and the application’s classes for gadget chains. Also check whether session files share a filesystem with other services.
Use the PHP advisory and your package supplier’s status to confirm the installed build. A package may contain a backport even when its version string is older than the upstream fixed version.
Update the runtime and session users
Install a fixed PHP release through the supported package channel. Restart PHP-FPM, web-server modules, queue workers and long-running CLI processes so they use the new runtime. Confirm the version on the process that handles requests.
Review session permissions, storage ownership and backup exposure. These controls limit access to session files but do not replace the PHP update.
