Skip to main content
VulnerabilityPublished

CVE-2026-31859: craftcms cms · Cross-site Scripting

Affects craftcms cmsSource CVE Database V5

0

Mentioned vulnerabilities

Not known to be exploited · CVSS 6.9 Medium : upgrade to 5.9.7 or 4.17.3 when convenient.

Data as of 26 Oct 2026, 17:16 UTC

CVSS 4.0 base score
6.9Medium
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.1% chance of exploitation in 30 days – higher than 8% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 5.9.7, 4.17.3
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 11 Mar 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.

What to do

Upgrade cms and craftcms/cms to 5.9.7 or 4.17.3.

Affected software

ProductAffectedFixed in
craftcmscmsAffected
  • >=5.7.5 <5.9.7
Fixed in
  • 5.9.7
craftcmscmsAffected
  • >=4.15.3 <4.17.3
Fixed in
  • 4.17.3
GitHubcraftcms/cmspkg:github/craftcms/cmsOther threatsAffected
  • <4.17.3
  • <5.9.7
Fixed in
  • 4.17.3
  • 5.9.7

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

  1. Upgrade Craft CMS to version 4.17.3 or 5.9.7 or later, where the vulnerability is fixed.
  2. Review and enhance input validation and sanitization for all user-controllable URL parameters, ensuring that dangerous URL schemes such as javascript:, data:, vbscript: are explicitly blocked or filtered.
  3. Avoid relying solely on strip_tags() for sanitizing URLs or HTML attributes; instead, use robust URL parsing and validation libraries that enforce scheme whitelisting.
  4. Implement Content Security Policy (CSP) headers to restrict the execution of inline scripts and limit the impact of potential XSS vulnerabilities.
  5. Conduct thorough security testing, including automated and manual penetration testing focused on XSS vectors, especially in URL parameters and session handling code.
  6. Educate developers on secure coding practices related to output encoding and context-aware sanitization to prevent similar issues.
  7. Monitor web application logs and traffic for suspicious requests containing unusual URL schemes or XSS payload patterns.
  8. If immediate upgrade is not feasible, consider temporary mitigations such as web application firewall (WAF) rules to detect and block malicious payloads targeting return URL parameters.

Description

Craft is a content management system (CMS). The 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. However, strip_tags() only removes HTML tags (angle brackets) -- it does not inspect or filter URL schemes. Payloads like javascript:alert(document.cookie) contain no HTML tags and pass through strip_tags() completely unmodified, enabling reflected XSS when the return URL is rendered in an href attribute. This vulnerability is fixed in 5.9.7 and 4.17.3.

References

Community reviews

Loading reviews…