CVE-2026-31873
MEDIUM 6.1CVSS 3.1Unhead Vulnerable to Bypass of URI Scheme Sanitization in makeTagSafe via Case-Sensitivity
Unhead is a document head and template manager. Prior to 2.1.11, The link.href check in makeTagSafe (safe.ts) uses String.includes(), which is case-sensitive. Browsers treat URI schemes case-insensitively. DATA:text/css,... is the same as data:text/css,... to the browser, but 'DATA:...'.includes('data:') returns false. An attacker can inject arbitrary CSS for UI redressing or data exfiltration via CSS attribute selectors with background-image callbacks. This vulnerability is fixed in 2.1.11.
- Published
- 12 Mar 2026
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-79
- Also known as
- GHSA-5339-hvwr-7582
- Sources
- NVDJSONOSV GHSA-5339-hvwr-7582JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | NONE 0.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N |
| OSV | GitHub | CVSS 3.1 | NONE 0.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | unjs | unheadcpe:2.3:a:unjs:unhead:*:*:*:*:*:*:*:* |
< 2.1.11 | 2.1.11 |
| OSV | npm | unhead | < 2.1.11 | 2.1.11 |
References
- https://github.com/unjs/unhead/security/advisories/GHSA-5339-hvwr-7582 · Exploit, Mitigation, Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-31873 · ADVISORY
- https://github.com/unjs/unhead · PACKAGE
- https://github.com/unjs/unhead/releases/tag/v2.1.11 · WEB
History
- 25 Nov 2026 21:01 UTC · NVD: first stored (published 12 Mar 2026)
- 25 Nov 2026 20:10 UTC · OSV: first stored (published 12 Mar 2026)