PHP developers have recently addressed a critical vulnerability in the software’s session handling mechanism that could allow attackers to execute arbitrary code on the server. This flaw, identified as CVE-2026-126714, has been assigned a severity score of 9.2 out of 10 on the CVSS 4.0 scale, highlighting its significance. Security firm Depthfirst discovered the issue and informed PHP maintainers, prompting an urgent update.
Affected Versions and Fix Implementation
The vulnerability affects PHP versions before 8.2.36, 8.3.37, 8.4.28, and 8.5.13. The fix was introduced in these versions and is also included in the newly released PHP 8.6.0. Servers using PHP versions released on October 21, which addressed other critical flaws known as PHP2Shell, remain vulnerable until this latest update is applied. The problem lies in PHP’s default session storage, but those using alternative storage solutions like Redis are not impacted, although they should verify their setup’s integrity.
Understanding the Vulnerability
The vulnerability stems from PHP’s file-based session handler, which can be manipulated to load attacker-chosen objects into the session. If PHP writes session data during a file upload and the process is interrupted, the session file may mix old and new data, potentially leading to code execution. Depthfirst’s analysis revealed that by exploiting this session handling flaw, attackers could insert malicious objects into the session, which would then activate when a session is initiated.
Mitigation and Future Outlook
PHP maintainers recommend updating to the fixed versions to mitigate this vulnerability. For those unable to update immediately, disabling the upload progress feature by setting session.upload_progress.enabled = 0 in php.ini is advised, though it is not a complete solution. Organizations should also consider moving session storage to a database or other secure systems that handle atomic writes. While the current updates significantly improve security, ongoing vigilance and timely updates are crucial to protect against evolving threats.
In conclusion, this PHP session vulnerability highlights the importance of regular software updates and proactive security measures. As cyber threats continue to evolve, staying informed and implementing recommended security practices is essential for maintaining the integrity of web servers and applications.
