{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-31860","id":"CVE-2026-31860","title":"Unhead has a XSS bypass in `useHeadSafe` via attribute name injection and case-sensitive protocol check","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 HTM","descriptionLong":"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.","published":"2026-03-12T17:18:20.452Z","updated":"2026-10-28T02:30:24.349417438Z","reserved":"2026-03-09T19:02:25.012Z","status":"PUBLISHED","rejected":false,"assigner":"GitHub_M","metric":{"version":"4.0","score":5.3,"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","rating":"medium","source":"GitHub_M"},"metrics":[{"version":"4.0","score":5.3,"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","rating":"medium","source":"GitHub_M"},{"version":"4.0","score":null,"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","rating":"unrated","source":"OSV"},{"version":"4.0","score":null,"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","rating":"medium","source":"GitHub"}],"rating":"medium","products":["unjs unhead"],"affectedProducts":[{"vendor":"unjs","product":"unhead","defaultStatus":null,"versions":[{"version":"< 2.1.11","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"npm","name":"unhead","purl":"pkg:npm/unhead","ranges":["<2.1.11"],"fixed":["2.1.11"],"advisory":"GHSA-g5xx-pwrp-g3fv"}],"cwes":["CWE-79"],"aliases":["GHSA-g5xx-pwrp-g3fv"],"references":[{"url":"https://github.com/unjs/unhead/security/advisories/GHSA-g5xx-pwrp-g3fv","tags":["x_refsource_CONFIRM","exploit","advisory","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31860.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31860","tags":["advisory"]},{"url":"https://github.com/unjs/unhead/commit/9ecc4f9568b0e23938f36d4b23fcfa4a18a89045","tags":["web"]},{"url":"https://github.com/unjs/unhead","tags":["package"]},{"url":"https://github.com/unjs/unhead/releases/tag/v2.1.11","tags":["web"]}],"patchReferenced":false,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial"},"epss":0.00292,"epssPercentile":0.22359,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-31860","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31860","ok":false,"note":"unavailable (rate limited?)"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-31860","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-g5xx-pwrp-g3fv","ok":true,"note":"GHSA-g5xx-pwrp-g3fv"},{"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-31860","ok":true,"note":"scored 2026-11-20"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}