XSS in Craftcms Cms
CVE-2026-31859
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.
Vulnerability class: XSS (Cross-Site Scripting)
EPSS: 0.002 (8.4th percentile) — read the EPSS interpretation.
CVSS v3 metric
CVSS v3 base score 6.1 (Medium). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
Affected products
- Craftcms Cms — versions >= 4.15.3, < 4.17.3, >= 5.7.5, < 5.9.7
- Craftcms Craft_cms
Weakness classification (CWE)
References
- security-advisories@github.com (x_refsource_CONFIRM, Patch, Vendor Advisory)
Frequently asked questions
- What is CVE-2026-31859?
- CVE-2026-31859 is a medium-severity vulnerability in Craftcms Cms, classified under Cross-site Scripting. CVSS score: 6.1/10. Published 2026-03-11.
- How severe is CVE-2026-31859?
- Medium severity. CVSS v3 base score is 6.1 out of 10.