CVE-2025-35939: Craftcms/cms Craft CMS Stores Arbitrary Content Vulnerability

MODERATE
Advisory Identifier: GHSA-7vrx-9684-xrf2
CVSS 5.3
CWE-472
Published
Advisory Summary

CVE-2025-35939 is a MODERATE (CVSS 5.3) craft cms stores arbitrary content vulnerability (CWE-472: External Control of Assumed-Immutable Web Parameter) affecting Craftcms/cms libraries in the Packagist ecosystem. The issue involves craft cms stores arbitrary content provided by unauthenticated users in session files. Remediation is available by upgrading affected packages to version 5.7.5, 4.15.3.

CVE-2025-35939 at a Glance

CVE Identifier CVE-2025-35939
GHSA Identifier GHSA-7vrx-9684-xrf2
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-472: External Control of Assumed-Immutable Web Parameter
Affected Product Craftcms/cms
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N/E:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2025-35939

To remediate this vulnerability, upgrade all affected Craftcms/cms dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

craftcms/cms fixed: 5.7.5
Upgrade craftcms/cms to 5.7.5
craftcms/cms fixed: 4.15.3
Upgrade craftcms/cms to 4.15.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for craftcms/cms

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-35939, inspect your project dependencies for Craftcms/cms:

inspect dependencies for craftcms/cms

Analyze the terminal output to locate any version of Craftcms/cms in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.7.5), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-472: External Control of Assumed-Immutable Web Parameter, where the web application does not sufficiently verify inputs that are assumed to be immutable but are actually externally controllable, such as hidden form fields. In Craftcms/cms, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2025-35939 Affected Craftcms/cms Versions

2 component(s)
Fixed Versions:
5.7.54.15.3
Product / Package Ecosystem Affected Versions Fixed Version
craftcms/cms
Packagist
≥ 5.0.0-alpha.1
< 5.7.5
5.7.5
craftcms/cms
Packagist
< 4.15.3
4.15.3

References

Frequently Asked Questions

What is CVE-2025-35939?
CVE-2025-35939 is a security vulnerability in Craftcms/cms involving Craft CMS stores arbitrary content provided by unauthenticated users in session files under CWE-472: External Control of Assumed-Immutable Web Parameter.
Which Craftcms/cms versions are affected?
Affected versions include releases prior to 5.7.5, 4.15.3 across affected packages: craftcms/cms.
What version fixes CVE-2025-35939?
Upgrading to 5.7.5, 4.15.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is craftcms/cms affected?
Yes, craftcms/cms is affected in releases prior to 5.7.5, 4.15.3. Upgrade your dependency to 5.7.5, 4.15.3 or later.
What is the CVSS score of CVE-2025-35939?
CVE-2025-35939 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N/E:H.
What CWE is associated with CVE-2025-35939?
CVE-2025-35939 is classified under CWE-472: External Control of Assumed-Immutable Web Parameter (The web application does not sufficiently verify inputs that are assumed to be immutable but are actually externally controllable, such as hidden form fields.).
How can I check Packagist dependencies for CVE-2025-35939?
Run the dependency tree command: 'inspect dependencies for craftcms/cms'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7vrx-9684-xrf2",
  "modified" : "2025-10-22T19:30:22Z",
  "published" : "2025-05-08T00:31:12Z",
  "aliases" : [ "CVE-2025-35939" ],
  "summary" : "Craft CMS stores arbitrary content provided by unauthenticated users in session files",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N/E:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "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:A"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "craftcms/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0-alpha.1"
      }, {
        "fixed" : "5.7.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "craftcms/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.15.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-35939"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/craftcms/cms/pull/17220"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/craftcms/cms/commit/e4c7bac8f31010aee048409f9ef6f744a83146b2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/craftcms/cms"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/craftcms/cms/releases/tag/4.15.3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/craftcms/cms/releases/tag/5.7.5"
  }, {
    "type" : "WEB",
    "url" : "https://raw.githubusercontent.com/cisagov/CSAF/develop/csaf_files/IT/white/2025/va-25-147-01.json"
  }, {
    "type" : "WEB",
    "url" : "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2025-35939"
  }, {
    "type" : "WEB",
    "url" : "https://www.cve.org/CVERecord?id=CVE-2025-35939"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-472" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-05-08T14:53:02Z",
    "nvd_published_at" : "2025-05-07T23:15:54Z"
  }
}