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

- Severity: None 0.0 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.27%, higher than 20% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-03-12T14:19:25.000Z
- Modified: 2026-06-17T10:34:40.490Z
- Also known as: GHSA-5339-hvwr-7582
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- unjs unhead: < 2.1.11; before 2.1.11
- unhead (npm): before 2.1.11

## Every score

- GitHub_M: CVSS:3.1 0.0 None `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N`
- GitHub: CVSS:3.1 0.0 Low `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`

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

## Sources

- CVE List: [CVE-2026-31873](https://www.cve.org/CVERecord?id=CVE-2026-31873), CVE Terms of Use, modified 2026-03-12
- GitHub Advisory Database: [GHSA-5339-hvwr-7582](https://github.com/advisories/GHSA-5339-hvwr-7582), CC-BY-4.0, modified 2026-03-14
- NVD: [CVE-2026-31873](https://nvd.nist.gov/vuln/detail/CVE-2026-31873), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-31873 · Whole record: https://cve.day/CVE-2026-31873.json · Rebuilt by cve.day 2026-11-25T22:59:15.839Z
