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

- Severity: Medium 6.9 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.22%, higher than 12% of CVEs (2026-12-01)
- Published: 2026-03-11T00:26:13.000Z
- Modified: 2026-06-17T10:34:38.860Z
- Also known as: GHSA-fvwq-45qv-xvhv
- Weaknesses: CWE-79, CWE-116
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- craftcms cms: >= 4.15.3, < 4.17.3; >= 5.7.5, < 5.9.7
- craftcms/cms (Packagist): from 4.15.3 before 4.17.3; from 5.7.5 before 5.9.7
- craftcms craft_cms: from 4.15.3 before 4.17.3; from 5.7.5 before 5.9.7

## Every score

- GitHub_M: CVSS:4.0 6.9 Medium `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`
- GitHub: CVSS:4.0 Medium `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`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/craftcms/cms/security/advisories/GHSA-fvwq-45qv-xvhv> (patch, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-31859> (advisory)
- <https://github.com/craftcms/cms/commit/cc9921c14897ee2b592a431c2356af8a04ce4cfe> (web)
- <https://github.com/craftcms/cms> (package)

## Sources

- CVE List: [CVE-2026-31859](https://www.cve.org/CVERecord?id=CVE-2026-31859), CVE Terms of Use, modified 2026-03-12
- GitHub Advisory Database: [GHSA-fvwq-45qv-xvhv](https://github.com/advisories/GHSA-fvwq-45qv-xvhv), CC-BY-4.0, modified 2026-03-13
- NVD: [CVE-2026-31859](https://nvd.nist.gov/vuln/detail/CVE-2026-31859), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-31859 · Whole record: https://cve.day/CVE-2026-31859.json · Rebuilt by cve.day 2026-11-25T22:59:15.758Z
