CriticalCVE-2025-35939

    Craft CMS stores user-provided content in session files (CVE-2025-35939)

    Published In CISA KEV since Sources: pwn.watch, CVE.org, OSV

    Share

    What is affected, what to do

    Craft CMS stores arbitrary content provided by unauthenticated users in session files. This content could be accessed and executed, possibly using an independent vulnerability.

    The vulnerability is being actively exploited; treat it as a priority. Update Craft CMS to version 5.7.5, Craft CMS to version 4.15.3. Immediate actions, mitigation and detection rules are in the runbook below.

    Affected
    • Craft CMS lt *..5.7.5
    • Craft CMS lt *..4.15.3
    Fixed in
    • Craft CMS 5.7.5
    • Craft CMS 4.15.3

    Not sure whether and how you are affected? Ask a question about this vulnerability

    Metrics

    6.9

    Priority

    XIEM Effective CVSS: highest available CVSS rating from NVD and vendor data.

    Source: NVD, CVSS v4

    5.3

    CVSS v3

    Severity Medium on the scale from 0 to 10.

    Source: pwn.watch, CVE.org, OSV

    1.4 %

    EPSS score

    Moderate — model estimates 1-10% exploitation likelihood.

    Source: FIRST EPSS, percentile 71.6

    Show all metrics
    Severity
    Critical
    Priority (0–325)

    The priority score is a consolidated metric that condenses several individual signals into a single, action-guiding ranking: technical severity (CVSS), exploitation likelihood (EPSS), known-exploited status (KEV) and the context of the affected asset. The aim is to answer the only truly important question in vulnerability management: what first?

    Read in glossary
    184.27 Methodology
    Exploit maturity

    An exploit is code or a technique that specifically uses a concrete vulnerability to force unintended behaviour — such as executing code or escalating privileges. It is the tool that turns a theoretical flaw into a practical attack.

    Read in glossary
    actively exploitedSource: VulnCheck KEV (opens in a new tab) How we classify
    XIEM Effective CVSS

    XIEM® is the tiered managed-security operating model from NEOSEC and a registered trademark of NEOSEC GmbH. It extends classic SIEM — the central collection, normalisation and correlation of security-relevant events — with endpoint forensics, network visibility and deception technology, and consolidates them into three building tiers: Sentry, Orchestrate and Command.

    Read in glossary
    6.9 Methodology
    CVSS v3

    CVSS is the globally established, open standard for assessing the technical severity of a vulnerability on a scale from 0 to 10. It describes how easily a flaw can be exploited and what damage it can cause — but not how likely its actual exploitation is. CVSS and the complementary EPSS deliberately answer different questions.

    Read in glossary
    5.3
    CVSS v4

    CVSS is the globally established, open standard for assessing the technical severity of a vulnerability on a scale from 0 to 10. It describes how easily a flaw can be exploited and what damage it can cause — but not how likely its actual exploitation is. CVSS and the complementary EPSS deliberately answer different questions.

    Read in glossary
    6.9
    EPSS score

    The EPSS score is the absolute model output for an individual vulnerability: the estimated probability of real-world exploitation within the next 30 days, expressed as a value between 0 and 1 (i.e. 0 % to 100 %). A score of 0.42 means „the model estimates a 42 % chance of real-world exploitation within 30 days“.

    Read in glossary
    1.4 %
    Moderate — model estimates 1-10% exploitation likelihood.
    EPSS percentile

    The EPSS percentile is the relative position of a vulnerability within all EPSS-scored CVEs, expressed as a value between 0 and 1. A percentile of 0.90 means „this CVE has a higher EPSS score than 90 % of all other scored CVEs“. Unlike the EPSS score, it is not a probability — but a positioning within a ranking.

    Read in glossary
    71.6
    High — this CVE ranks above the median of all CVEs scored today (rank ≥ 36%).
    KEV status

    The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.

    Read in glossary
    Actively exploited
    Published
    In CISA KEV since

    The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.

    Read in glossary
    CISA assessment (SSVC)
    Exploitation: active · automatable · Technical impact: partial
    Source: CISA Vulnrichment, as of 6 June 2025
    CWE

    CWE is a catalogue of typical weakness types in software and hardware — such as flawed input validation, unsafe memory handling or poor authentication. Where a CVE names a concrete vulnerability in a concrete product, a CWE describes the underlying class of defect.

    Read in glossary
    CWE-472

    Response and mitigation

    Why act now?

    Prioritisation rationale

    This CVE made the KEV list because — although in isolation it is only an unauthenticated write primitive with limited integrity impact — attackers chain it with CVE-2025-32432 to achieve full remote code execution. Opportunistic scanning for exposed Craft CMS instances is ongoing: operators drop PHP payloads into session files, then trigger execution through the second flaw. The typical target profile is public-facing content sites, agency hosting estates and multi-tenant setups with internet-reachable CMS backends — particularly relevant in NIS2 scope where Craft CMS backs citizen or customer portals. Treat as high priority for any internet-exposed Craft instance below 5.7.5 / 4.15.3, medium for purely internal deployments with a segmented admin UI.

    1. Runbook step 1

      Immediate response (0-24 h)

      • Upgrade Craft CMS to 5.7.5 (5.x branch) or 4.15.3 (4.x branch) immediately — both releases close the flaw. Use composer require craftcms/cms:^5.7.5 or ^4.15.3, then run php craft migrate/all and php craft clear-caches/all.
      • After patching, purge existing PHP session files in /var/lib/php/sessions/sess_* (or your configured session.save_path); pre-staged payloads may already be sitting there waiting to be chained via CVE-2025-32432 / CVE-2024-58136.
      • Inventory every Craft CMS instance — public, staging and dev. The flaw is unauthenticated over HTTP, so any reachable instance is in scope.
      • Rotate the security.key value in .env and invalidate active admin sessions (php craft invalidate-tokens, or wipe the session directory) to contain pre-patch compromise.
      • Until the patch has fully rolled out, configure the upstream reverse proxy or WAF to block query parameters containing PHP tags (<?php, <?=) in return URLs and login redirects.
    2. Runbook step 2

      Mitigation layers

      • Network segmentation: expose the Craft CMS backend (/admin) only via VPN or IP allow-list; rate-limit front-end login flows (e.g. 10 req/min per IP).
      • WAF rule: drop HTTP requests whose query string or return/redirect parameters contain PHP opening tags, base64_decode(, system(, passthru(, eval( or assert(, including URL-encoded variants (%3C%3Fphp).
      • Filesystem hardening: move session.save_path outside the web root and constrain it via open_basedir so the PHP interpreter cannot include session files as scripts. Consider mounting /var/lib/php/sessions with noexec.
      • PHP configuration: set session.use_strict_mode = 1 so client-supplied session IDs are rejected; disable allow_url_include and expose_php.
      • Least privilege: the web server user (www-data, nginx) should have read-only access to the Craft project tree, with write access limited to storage/, web/cpresources/ and the session directory. No executable bit on session paths.
      • Chain hygiene: verify patch status of CVE-2025-32432 (Craft CMS image-transform RCE) and CVE-2024-58136 (Yii) in parallel — on its own, CVE-2025-35939 is only a write primitive; combined, it is full RCE.
    3. Runbook step 3

      Detection rules

      • Web server access logs: hunt for return= or redirect= parameters carrying URL-encoded PHP tags. KQL shape: WebLogs | where UriQuery matches regex @"(?i)(return|redirect)=.*(%3C%3Fphp|<\?php|%3C%3F%3D)".
      • auditd on the session directory: -w /var/lib/php/sessions -p wa -k php_session_write — unusual write patterns or files containing <?php fire an alert. Sweep manually with grep -rlE "<\?(php|=)" /var/lib/php/sessions.
      • Process ancestry (Sysmon for Linux / EDR): php-fpm or apache2 child processes spawning sh, bash, curl, wget, python or nc — classic post-exploitation signal after a successful chain.
      • Craft CMS logs (storage/logs/web-*.log): login requests with abnormally long return parameters (> 512 bytes) or non-ASCII content in the redirect target.
      • Network telemetry (Suricata/Zeek): HTTP requests to /index.php?p=admin/login or /admin/login carrying POST/GET parameters with binary or script signatures; Sigma shape selection: cs-uri-query|contains: ['<?php', '<?='].

    Detection rules

    No NEOSEC detection rule is available for this vulnerability yet.

    Classification under NIS2 and CRA

    Rule-based classification from exploitation status and severity. It does not replace a case-by-case assessment.

    NIS2

    NIS2 is EU Directive (EU) 2022/2555 to raise the level of cybersecurity across the Union. It substantially broadens obligations compared with the first NIS directive: more sectors, mandatory risk management, staged reporting duties and personal accountability of senior management.

    Read in glossary
    Actively exploited: treat the vulnerability as a priority in vulnerability handling under Art. 21(2)(e) NIS2. If it is exploited in your environment, check the reporting obligation under Art. 23 (early warning within 24 hours).
    CRA

    The CRA is EU Regulation (EU) 2024/2847 setting horizontal cybersecurity requirements for „products with digital elements“ — from industrial controllers and software to connected consumer devices. For the first time manufacturers must ensure security across the entire product lifecycle, handle vulnerabilities and provide security updates.

    Read in glossary
    Since 11.09.2026, manufacturers of affected products with digital elements must report actively exploited vulnerabilities under Art. 14 CRA, with an early warning within 24 hours via ENISA's single reporting platform.
    ISO/IEC 27001

    ISO/IEC 27001 is the internationally leading standard for an information security management system (ISMS). It describes a risk-based, process-oriented framework to systematically plan, implement, review and improve information security.

    Read in glossary
    Control A.8.8, management of technical vulnerabilities: assess relevance to your systems, plan remediation and keep evidence.

    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.

    Source: pwn.watch, NVD (NIST), OSV (Open Source Vulnerabilities), cvelistv5, CISA KEV Catalog, CVE.org (MITRE)

    Affected products

    The following versions are affected. Older releases of the same product line are also vulnerable unless stated otherwise.

    Affected products
    Affected versionsFixed in
    CraftCMS
    • < 4.15.3
    • < 5.7.5
    • 4.15.3
    • 5.7.5
    craftcmscraft_cms
    • < 4.15.3
    • 5.0.0 – < 5.7.5
    • 4.15.3
    • 5.7.5
    packagistcraftcms/cms
    • 3.0.22
    • 4.4.11
    • 2.7.7.3
    • 3.8.6
    • 3.0.20
    • 5.2.0
    • 3.0.40
    • 5.4.0.1
    • 4.13.9
    • 2.5.0-beta.2720
    • 3.0.0-beta.32
    • 4.14.4
    • 4.10.2
    • 1.4.0-alpha.2476
    • 5.4.7.1
    • 2.3.2641
    • 3.2.0-RC1
    • 3.0.0-RC4
    • 3.3.6
    • 5.7.0-beta.1
    • 4.10.5
    • 3.4.23
    • 3.6.14
    • 3.8.11
    • 5.2.3
    • 5.2.6
    • 4.15.0.2
    • 3.7.19.1
    • 3.4.4.1
    • 2.3.2629
    • 4.7.3
    • 4.8.10
    • 1.3.0-alpha.2374
    • 5.4.3
    • 5.0.0-alpha.8
    • 4.12.0
    • 1.3.2485
    • 5.0.0-alpha.1
    • 3.3.15
    • 3.0.41.1
    • 3.5.17.1
    • 3.1.0-beta.4
    • 3.1.34
    • 1.4.0-alpha.2491
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —

    Vendors and products

    Weakness classes (CWE)

    • CWE-472External Control of Assumed-Immutable Web Parameter

      Base

      The web application does not sufficiently verify inputs that are assumed to be immutable but are actually externally controllable, such as hidden form fields.

      Entry at MITRE CWE-472

    Public exploit references

    Publicly reported proof-of-concepts, exploit modules and detection templates for this vulnerability. NEOSEC links to the original sources only and does not provide any exploit code.

    Public exploit references
    CISA KEV CatalogCISA Known Exploited Vulnerability (opens in a new tab)cisa.govactively exploited

    References & sources

    Embed badge

    Show the severity and KEV status of this vulnerability on your site – with a link back here. The image is updated hourly.

    Badge preview for CVE-2025-35939
    <a href="https://intel.neosec.eu/en/cve/CVE-2025-35939"><img src="https://intel.neosec.eu/badge/cve/CVE-2025-35939.svg?lang=en" alt="CVE-2025-35939 – NEOSEC Intel" height="20"></a>