Vulnerability · Published Mar 12, 2026 · Assigned by GitHub_M
CVE-2026-31873Unhead has a Bypass of URI Scheme Sanitization in makeTagSafe via Case-Sensitivity
None 0.0
In plain English
A cross-site scripting in unhead from unjs. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 16% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | unhead | 2.1.11 | GHSA-5339-hvwr-7582 |
Affected products (as reported)
Weakness: CWE-79 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
References
- https://github.com/unjs/unhead/security/advisories/GHSA-5339-hvwr-7582 x_refsource_CONFIRM