Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. unhead
  4. ›
  5. CVE-2026-31873

CVE-2026-31873: Unhead Vulnerable to Bypass of URI Scheme Sanitization in makeTagSafe via Case-Sensitivity

March 12, 2026

The link.href check in makeTagSafe (safe.ts, line 68-71) uses String.includes(), which is case-sensitive:

if (key === 'href') {
if (val.includes('javascript:') || val.includes('data:')) {
return
}
next[key] = val
}

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.

References

  • github.com/advisories/GHSA-5339-hvwr-7582
  • github.com/unjs/unhead
  • github.com/unjs/unhead/releases/tag/v2.1.11
  • github.com/unjs/unhead/security/advisories/GHSA-5339-hvwr-7582
  • nvd.nist.gov/vuln/detail/CVE-2026-31873

Code Behaviors & Features

Detect and mitigate CVE-2026-31873 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 2.1.11

Fixed versions

  • 2.1.11

Solution

Upgrade to version 2.1.11 or above.

Impact

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

npm/unhead/CVE-2026-31873.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:55 +0000.