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.

Severity (CVSS 3.1)0.0None
Exploit odds (30 days)0.2%top 84.0% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
npmunhead2.1.11GHSA-5339-hvwr-7582

Affected products (as reported)

VendorProductVersions
unjs unhead < 2.1.11

Weakness: CWE-79 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N

References