CVE-2026-31873

Unhead has a Bypass of URI Scheme Sanitization in makeTagSafe via Case-Sensitivity

Published Mar 12, 2026 CVSS 3.1 · 0 Low EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-5339-hvwr-7582 Unhead Vulnerable to Bypass of URI Scheme Sanitization in makeTagSafe via Case-Sensitivity
History
Type Values Removed Values Added
CPEs cpe:2.3:a:unjs:unhead:*:*:*:*:*:*:*:*
Type Values Removed Values Added
First Time appeared Unjs
Unjs unhead
Vendors & Products Unjs
Unjs unhead
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title Unhead has a Bypass of URI Scheme Sanitization in makeTagSafe via Case-Sensitivity
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 0, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Mar 12, 2026, 5:46 PM
Reserved
Mar 9, 2026, 7:02 PM
Status
Analyzed
Published
Mar 12, 2026, 6:16 PM
Modified
Jun 17, 2026, 10:34 AM