{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-31859","id":"CVE-2026-31859","title":"Craft has Reflective XSS via incomplete return URL sanitization","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","descriptionLong":"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.","published":"2026-03-11T17:37:19.065Z","updated":"2026-10-28T02:30:49.346656957Z","reserved":"2026-03-09T19:02:25.012Z","status":"PUBLISHED","rejected":false,"assigner":"GitHub_M","metric":{"version":"4.0","score":6.9,"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","rating":"medium","source":"GitHub_M"},"metrics":[{"version":"4.0","score":6.9,"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","rating":"medium","source":"GitHub_M"},{"version":"4.0","score":null,"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","rating":"unrated","source":"OSV"},{"version":"4.0","score":null,"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","rating":"medium","source":"GitHub"}],"rating":"medium","products":["craftcms cms"],"affectedProducts":[{"vendor":"craftcms","product":"cms","defaultStatus":null,"versions":[{"version":">= 4.15.3, < 4.17.3","status":"affected"},{"version":">= 5.7.5, < 5.9.7","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"Packagist","name":"craftcms/cms","purl":"pkg:composer/craftcms/cms","ranges":[">=4.15.3 <4.17.3",">=5.7.5 <5.9.7"],"fixed":["4.17.3","5.9.7"],"advisory":"GHSA-fvwq-45qv-xvhv"}],"cwes":["CWE-79","CWE-116"],"aliases":["GHSA-fvwq-45qv-xvhv"],"references":[{"url":"https://github.com/craftcms/cms/security/advisories/GHSA-fvwq-45qv-xvhv","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31859.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31859","tags":["advisory"]},{"url":"https://github.com/craftcms/cms/commit/cc9921c14897ee2b592a431c2356af8a04ce4cfe","tags":["web"]},{"url":"https://github.com/craftcms/cms","tags":["package"]}],"patchReferenced":false,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial"},"epss":0.00216,"epssPercentile":0.12227,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-31859","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31859","ok":false,"note":"unavailable (rate limited?)"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-31859","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-fvwq-45qv-xvhv","ok":true,"note":"GHSA-fvwq-45qv-xvhv"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-31859","ok":true,"note":"scored 2026-11-20"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}