# CVE-2025-35939: Craft CMS stores arbitrary content provided by unauthenticated users in session files

Source: https://junglewise.ai/threats/cve-2025-35939-craft-cms-arbitrary-code-injection-in-session-files  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-05-08. Updated: 2026-05-15  
License: CC BY 4.0 with a link back

CVE-2025-35939 · Severity: critical · CVSS 3.1 · Exploited in the wild · Published 2025-05-08

Craft CMS, a popular content management system, contains a vulnerability that allows unauthenticated users to inject malicious data into server session files. By manipulating web parameters that the system assumes are safe, an attacker can place arbitrary code on the server's disk. This could lead to a full system takeover if combined with other vulnerabilities, potentially resulting in data theft or website defacement.

Technologies: [Craft CMS](https://junglewise.ai/threats/technologies/craft-cms), [craftcms/cms (Packagist)](https://junglewise.ai/threats/technologies/craftcms-cms). Vendors: [Craft CMS](https://junglewise.ai/threats/vendors/craft-cms), [Packagist](https://junglewise.ai/threats/vendors/packagist).

## Quick answers

**Is CVE-2025-35939 exploited in the wild?** Yes. CVE-2025-35939 is known to be exploited in the wild, first recorded on 2 June 2025. Treat it as urgent.

**How severe is CVE-2025-35939?** Critical severity, with a CVSS score of 3.1, published 8 May 2025.

**Which products and versions are affected?** craftcms/cms (Packagist) ECOSYSTEM:introduced=5.0.0-alpha.1,fixed=5.7.5.

**Is there a fix for CVE-2025-35939?** Yes. craftcms/cms (Packagist): upgrade to 5.7.5 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2025-35939 attacked?** It is attacked over the network, in a web application.

**Am I affected by CVE-2025-35939?** Check whether you run Craft CMS or craftcms/cms (Packagist) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- craftcms/cms (Packagist): upgrade to 5.7.5 or later

  ```sh
  composer require craftcms/cms:^5.7.5
  ```


## Technical details

Craft CMS is vulnerable to an 'External Control of Assumed-Immutable Web Parameter' (CWE-472). When an unauthenticated user attempts to access a protected resource, the application redirects them to the login page and stores the requested return URL in a session file located at '/var/lib/php/sessions'. Because the return URL parameters are not properly sanitized, an attacker can inject arbitrary PHP code into these session files. While this vulnerability primarily allows for file poisoning, it can be chained with other vulnerabilities (such as CVE-2024-58136) to achieve remote code execution. The issue is addressed in Craft CMS versions 5.7.5 and 4.15.3.

## Affected products

- Pixel & Tonic Craft CMS Versions up to 4.15.3 and 5.0.0 up to 5.7.5

## Identifiers

- CVE-2025-35939
- GHSA-7vrx-9684-xrf2

## Timeline

- 2025-05-28: disclosed: Initial vulnerability details shared by CISA
- 2025-06-02: advisory: NVD advisory published
- 2025-06-02: kev added: Added to CISA Known Exploited Vulnerabilities catalog
- 2025-06-03: patched: Patches confirmed in versions 4.15.3 and 5.7.5

## Related threats

- [Craft CMS SQL injection in getNext/getPrev methods](https://junglewise.ai/threats/cve-2026-123489-craft-cms-4-0-0-before-4-18-9-and-5-0-0-before-5-11-2-contains-a)
- [Craft CMS: Stored XSS in the control panel via unescaped draft name](https://junglewise.ai/threats/cve-2026-72787-craft-cms-stored-xss-in-the-control-panel-via-unescaped-draft)
- [Craft CMS: Arbitrary user password reset leading to administrator account takeover](https://junglewise.ai/threats/cve-2026-72786-craft-cms-arbitrary-user-password-reset-leading-to-administrator)
- [Craft CMS authorization bypass in category structure modification](https://junglewise.ai/threats/craft-cms-authorization-bypass-in-category-structure-modification-1555f980)
- [Craft CMS authenticated RCE through Twig sandbox escape](https://junglewise.ai/threats/craft-cms-authenticated-rce-through-twig-sandbox-escape-32ee5ec1)
