MEDIUM

CVE-2025-35939

Craftcms Craft Cms 2025-05-07 CVSS v3.1
CVSS
5.3
KEV

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.

Summary dbcve.org

Craft CMS versions 5.7.5 and 4.15.3 contain an input sanitization flaw where the return URL parameter is stored in session files without sanitization. An unauthenticated attacker can inject arbitrary values (including PHP code) into session files at '/var/lib/php/sessions' by manipulating the return URL. The session filename is predictable from the Set-Cookie header value, enabling known-location file writes. However, code execution requires an independent vulnerability.

Mitigation

Upgrade to Craft CMS version 5.7.5 or 4.15.3 to patch the unsanitized return URL parameter storage. Additionally, ensure PHP session files are stored outside the web root and consider implementing additional input validation at the web server level.

Patch Commit

Weakness (CWE)

CWE-472

EPSS Score

1.32%
Probability of exploitation in next 30 days
69.5th percentile

References

View on dbcve.org
Base CVE data derived from NVD (public domain). Enrichment by dbcve.org (CC-BY-4.0). Fetched via API.
Back to CVE