Patchfirst
CVE-2025-35939 KEV Medium · 5.3 EPSS 1.3%

Craft CMS External Control of Assumed-Immutable Web Parameter Vulnerability

Craft CMS · Craft CMS

Summary

Craft CMS has a flaw in how it handles the return URL for login redirects: it stores the client-supplied URL in the server-side session file without sanitizing its parameters, letting attacker-controlled content end up in files under the PHP session directory. An unauthenticated remote attacker can exploit this over the network with no privileges or user interaction, simply by sending crafted requests that trigger the login redirect, with the attacker-supplied content then possibly executed through a separate, independent vulnerability.

Official description · NVD

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.

Breakdown
56.0 / 100
Exploited
Yes, in CISA KEV
Reports
0
Tactics
3/15

How an attack unfolds

Based on mappings. Select a step to see the evidence.
  1. How attackers get in

  2. What they do

  3. What can follow

First seen exploited 26 days after disclosure.

  1. Disclosedday 0
  2. First seen exploitedVulnCheck KEV evidenceAdded to CISA KEVEU database agrees+26 days

CISA KEV listing is when exploitation was confirmed, not necessarily the first attack.

See the family tree

A fix was bypassed or incomplete once over 10 months. The latest fix listed for craftcms/cms is 5.8.21.

Same bug familyLinked by evidence that a fix failed or the same code was patched again. Oldest first.

  1. This CVECVE-2025-35939Craft CMS External Control of Assumed-Immutable Web Parameter7 May 2025KEV
  2. regression ofHigh

    Why these are linked:

    • Stated in the CVE textThe fix for CVE-2025-35939 in craftcms/cms introduced a strip_tags() call in src/web/User.php to sanitize return URLs before they are stored in the session.
    CVE-2026-31859Craft has Reflective XSS via incomplete return URL sanitization11 Mar 2026

Fixes in craftcms/cmsPackagist package, by fixed version. Earlier and later fixes in the same package, not necessarily the same bug.

  1. 5.5.8CVE-2025-2320918 Jan 2025KEV
  2. 5.6.15CVE-2025-467315 May 2025
  3. 5.6.17CVE-2025-3243225 Apr 2025KEV
  4. 5.7.5CVE-2025-359397 May 2025KEV
  5. 5.8.4CVE-2025-544179 Aug 2025
  6. 5.8.7CVE-2025-5781125 Aug 2025
  7. 5.8.21CVE-2025-684365 Jan 2026Latest listed

techniques

3 , grouped by in kill-chain order 3

Initial AccessTA0001

Exploit Public-Facing Application T1190 Medium
MITRE CTID mapping of the KEV entry · how it is exploited

This vulnerability allows an attacker to write arbitrary files to a known location on the target server, including potentially malicious files such as PHP scripts by leveraging the fact that Craft CMS creates session files for unauthenticated users at the login page. However, this vulnerability does not, by itself, cause any scripts to be executed or any information to be accessed, so it would need to be chained with another vulnerability in order to achieve code execution.

ExecutionTA0002

Command and Scripting Interpreter T1059 Medium
MITRE CTID mapping of the KEV entry · follow-on activity

This vulnerability allows an attacker to write arbitrary files to a known location on the target server, including potentially malicious files such as PHP scripts by leveraging the fact that Craft CMS creates session files for unauthenticated users at the login page. However, this vulnerability does not, by itself, cause any scripts to be executed or any information to be accessed, so it can only write files and would need to be chained with another vulnerability in order to achieve code execution.

PersistenceTA0003

Web Shell T1505.003 Medium
MITRE CTID mapping of the KEV entry · primary impact

Detection

0 rules for this CVE · 279 general rules for its techniques

Rules for this CVE

0 that reference CVE-2025-35939 directly.

CVE-specific rules are not available in this build. Search SigmaHQ ↗

General rules for this CVE’s techniques

These detect the technique in general, not this specific vulnerability.

Sigma rules © SigmaHQ, Detection Rule License 1.1; linked, not reproduced.

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

1 package in 1 ecosystem. Main package: craftcms/cms.

Packagistcraftcms/cmsGHSA-7vrx-9684-xrf2

Upgrade to 5.7.5 or later

Fixes this CVE and 3 other known vulnerabilities in this package (CVE-2024-56145, CVE-2025-23209, +1).

Set the version to 5.7.5 or later in your composer.json.

The first fix for CVE-2025-35939.

Affected versions, by release line

If you runUpgrade to
5.0.0-alpha.1 up to 5.7.55.7.5
All versions before 4.15.34.15.3

“Up to” means the second version is the fix and is not affected.

Check your lockfile against all CVEs

What security researchers reported

Not named in any threat report yet

Also mentioned in 50 community threat pulses (AlienVault OTX)

Weaker evidence

Pulses are indicator collections that anyone can publish. A mention is not confirmation of exploitation.

References

6 links, grouped by NVD tag
↑ ↓ chooseEnter openEsc close