{"cve":"CVE-2026-31860","nvd":{"published":"2026-03-12T18:16:24.227","modified":"2026-06-17T10:34:38.983","status":"Analyzed","description":"Unhead is a document head and template manager. Prior to 2.1.11, useHeadSafe() can be bypassed to inject arbitrary HTML attributes, including event handlers, into SSR-rendered <head> tags. This is the composable that Nuxt docs recommend for safely handling user-generated content. The acceptDataAttrs function (safe.ts, line 16-20) allows any property key starting with data- through to the final HTML. It only checks the prefix, not whether the key contains spaces or other characters that break HTML attribute parsing. This vulnerability is fixed in 2.1.11.","cvss_v4":{"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","score":5.3},"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1},"cwes":["CWE-79"],"references":["https://github.com/unjs/unhead/security/advisories/GHSA-g5xx-pwrp-g3fv","https://github.com/unjs/unhead/security/advisories/GHSA-g5xx-pwrp-g3fv"],"products":["unjs:unhead"],"source":"nvd","synced_at":"2026-10-19T22:25:53.701907451+00:00"},"epss":{"cve":"CVE-2026-31860","score":0.00269,"percentile":0.19085,"date":"2026-11-01"},"kev":null,"osv":[{"id":"GHSA-g5xx-pwrp-g3fv","url":"https://osv.dev/vulnerability/GHSA-g5xx-pwrp-g3fv","summary":"Unhead has XSS bypass in `useHeadSafe` via attribute name injection and case-sensitive protocol check","modified":"2026-03-14T06:26:21.163867Z","packages":[{"ecosystem":"npm","name":"unhead","purl":"pkg:npm/unhead","ranges":["<2.1.11"],"fixed":["2.1.11"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}