CVE-2025-35939
KEVlargeUnauthenticated session-file content injection in Craft CMS
CISA: Craft CMS External Control of Assumed-Immutable Web Parameter Vulnerability
Craft CMS writes unauthenticated, user-controlled input — specifically the unsanitized return URL from a login-redirect request — into PHP session files stored at a predictable server location (/var/lib/php/sessions/sess_<session_value>), where the session value is disclosed to the client in the Set-Cookie header. Because the input is not sanitized, an unauthenticated network attacker can inject arbitrary content, including PHP code, into a known local file path on the server. That content can subsequently be accessed and potentially executed, likely by chaining this flaw with an independent vulnerability such as a local file inclusion, providing a path toward code execution. Any Craft CMS deployment running affected versions is exposed, and CISA added the issue to its Known Exploited Vulnerabilities catalog on 2025-06-02, indicating exploitation in the wild; EPSS currently estimates a ~1.3% probability of exploitation in the next 30 days.
What to do: Upgrade immediately to Craft CMS 5.7.5 (5.x branch) or 4.15.3 (4.x branch) or newer, per vendor guidance and the KEV/BOD 22-01 required actions for federal agencies. Inspect /var/lib/php/sessions for unexpected content or injected PHP in sess_* files and review web logs for unauthenticated requests supplying unsanitized return URLs; since execution likely depends on chaining with another flaw, also verify the instance is not exposed to related file-inclusion or local-file-access weaknesses.
| craftcms Craft CMS | Versions prior to 4.15.3 (4.x branch) and prior to 5.7.5 (5.x branch); fixed versions 4.15.3 and 5.7.5 have been released |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
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.
- Affected
- Craft CMS Craft CMS
- Required action
- Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.
- Due date
- Ransomware use
- Unknown
- Vendors
- craftcms
- Products
- craft cms
- Weakness
- CWE-472
- Vector
- 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X