← back
CVE-2025-35939

Craft CMS stores user-provided content in session files

CVSS 6.9 MEDIUMEPSS 1.1%● KEVCWE-472
In short

Craft CMS stores unsanitized user input in session files on the server, which could be accessed and executed if combined with another vulnerability. An attacker can inject malicious content (like PHP code) into these files without authentication.

Technical detail

Unauthenticated attackers can inject arbitrary content into session files via unsanitized return URL parameters stored by Craft CMS during authentication redirects. Session files are created at predictable locations (/var/lib/php/sessions/sess_[session_value]), and the injected content may be executed if accessed through a separate vulnerability, leading to potential code execution or information disclosure.

Summary generated and translated by AI from the official description.
Craft CMS stores arbitrary content provided by unauthenticated users in session files. This content could be accessed and executed, possibly using an independent vulnerability. Craft CMS redirects requests that require authentication to the login page and generates a session file on the server at '/var/lib/php/sessions'. Such session files are named 'sess_[session_value]', where '[session_value]' is provided to the client in a 'Set-Cookie' response header. Craft CMS stores the return URL requested by the client without sanitizing parameters. Consequently, an unauthenticated client can introduce arbitrary values, such as PHP code, to a known local file location on the server. Craft CMS versions 5.7.5 and 4.15.3 have been released to address this issue.
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Affected products
Craft · CMS

Want to know if your infrastructure is exposed to this?

Talk to TrueHacking →