CVE-2026-31859: craftcms cms · Cross-site Scripting
Affects craftcms cmsSource CVE Database V5
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
- 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:NExploitation evidence
Disclosed: evidence found.
CVE published 11 Mar 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by 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
| Product | Affected | Fixed in |
|---|---|---|
| craftcmscms | Affected
| Fixed in
|
| craftcmscms | Affected
| Fixed in
|
GitHubcraftcms/cmspkg:github/craftcms/cmsOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
- Upgrade Craft CMS to version 4.17.3 or 5.9.7 or later, where the vulnerability is fixed.
- 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.
- Avoid relying solely on strip_tags() for sanitizing URLs or HTML attributes; instead, use robust URL parsing and validation libraries that enforce scheme whitelisting.
- Implement Content Security Policy (CSP) headers to restrict the execution of inline scripts and limit the impact of potential XSS vulnerabilities.
- Conduct thorough security testing, including automated and manual penetration testing focused on XSS vectors, especially in URL parameters and session handling code.
- Educate developers on secure coding practices related to output encoding and context-aware sanitization to prevent similar issues.
- Monitor web application logs and traffic for suspicious requests containing unusual URL schemes or XSS payload patterns.
- 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.