Every CVE Search/ Get API key

CVE-2026-31873

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

0.0 NoneFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
None

Exploit likelihood

0.27%Up 0.2 points since Mar 13, 2026
90%50%10%1%

What each source reports

CVE List Score used 0.0

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

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.

Record
CVE-2026-31873
CVSS 3.1
0.0 NoneCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
Weakness
CWE-79
Updated
2026-11-02
EUVDEUVD-2026-11640 No score

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.

Record
EUVD-2026-11640
Updated
2026-11-02
GitHub AdvisoriesGHSA-5339-hvwr-7582 0.0

Unhead Vulnerable to Bypass of URI Scheme Sanitization in makeTagSafe via Case-Sensitivity

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.

PoC

useHeadSafe({
  link: [{
    rel: 'stylesheet',
    href: 'DATA:text/css,body{display:none}'
  }]
})

SSR output:

<link rel="stylesheet" href="DATA:text/css,body{display:none}">

The browser loads this as a CSS stylesheet. An attacker can inject arbitrary CSS for UI redressing or data exfiltration via CSS attribute selectors with background-image callbacks.

Any case variation works: DATA:, Data:, dAtA:, JAVASCRIPT:, etc.

Suggested fix

if (key === 'href') {
  const lower = val.toLowerCase()
  if (lower.includes('javascript:') || lower.includes('data:')) {
    return
  }
  next[key] = val
}
Record
GHSA-5339-hvwr-7582
CVSS 3.1
0.0 NoneCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
Weakness
CWE-79
Updated
2026-11-02
NVD 0.0

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.

Record
CVE-2026-31873
CVSS 3.1
0.0 NoneCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
CVSS 3.1
6.1 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Weakness
CWE-79
Updated
2026-11-02
OSV 0.0

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

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.

Record
CVE-2026-31873
CVSS 3.1
0.0 NoneCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
Weakness
CWE-79
Updated
2026-11-02
OSVGHSA-5339-hvwr-7582 0.0

Unhead Vulnerable to Bypass of URI Scheme Sanitization in makeTagSafe via Case-Sensitivity

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.

PoC

useHeadSafe({
  link: [{
    rel: 'stylesheet',
    href: 'DATA:text/css,body{display:none}'
  }]
})

SSR output:

<link rel="stylesheet" href="DATA:text/css,body{display:none}">

The browser loads this as a CSS stylesheet. An attacker can inject arbitrary CSS for UI redressing or data exfiltration via CSS attribute selectors with background-image callbacks.

Any case variation works: DATA:, Data:, dAtA:, JAVASCRIPT:, etc.

Suggested fix

if (key === 'href') {
  const lower = val.toLowerCase()
  if (lower.includes('javascript:') || lower.includes('data:')) {
    return
  }
  next[key] = val
}
Record
GHSA-5339-hvwr-7582
CVSS 3.1
0.0 NoneCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
Weakness
CWE-79
Updated
2026-11-02
Show 6 moreShow less
OSVCLSA-2026-1788988912 No score

TuxCare security update for unhead (2 CVEs)

TuxCare rebuilt unhead to address 2 CVEs. Fixed in 1.11.20-tuxcare.1.

Record
CLSA-2026-1788988912
Updated
2026-11-02
OSVCLSA-2026-1792161471 No score

TuxCare security update for @unhead/dom (2 CVEs)

TuxCare rebuilt @unhead/dom to address 2 CVEs. Fixed in 1.11.20-tuxcare.1.

Record
CLSA-2026-1792161471
Updated
2026-11-02
OSVCLSA-2026-1792161537 No score

TuxCare security update for @unhead/shared (2 CVEs)

TuxCare rebuilt @unhead/shared to address 2 CVEs. Fixed in 1.11.20-tuxcare.1.

Record
CLSA-2026-1792161537
Updated
2026-11-02
OSVCLSA-2026-1792161579 No score

TuxCare security update for @unhead/ssr (2 CVEs)

TuxCare rebuilt @unhead/ssr to address 2 CVEs. Fixed in 1.11.20-tuxcare.1.

Record
CLSA-2026-1792161579
Updated
2026-11-02
OSVCLSA-2026-1792161644 No score

TuxCare security update for @unhead/vue (2 CVEs)

TuxCare rebuilt @unhead/vue to address 2 CVEs. Fixed in 1.11.20-tuxcare.1.

Record
CLSA-2026-1792161644
Updated
2026-11-02
OSVCLSA-2026-1792162014 No score

TuxCare security update for @unhead/schema (2 CVEs)

TuxCare rebuilt @unhead/schema to address 2 CVEs. Fixed in 1.11.20-tuxcare.1.

Record
CLSA-2026-1792162014
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
unhead
npm
through 2.1.10
2.1.11
unhead
TuxCare:npm
From an advisory covering 2 CVEs
1.11.20-tuxcare.0 up to 1.11.20-tuxcare.1, plus listed versions
1.11.20
1.11.20-tuxcare.1
@unhead/dom
TuxCare:npm
From an advisory covering 2 CVEs
1.11.20-tuxcare.0 up to 1.11.20-tuxcare.1, plus listed versions
1.11.20
1.11.20-tuxcare.1
@unhead/shared
TuxCare:npm
From an advisory covering 2 CVEs
1.11.20-tuxcare.0 up to 1.11.20-tuxcare.1, plus listed versions
1.11.20
1.11.20-tuxcare.1
@unhead/ssr
TuxCare:npm
From an advisory covering 2 CVEs
1.11.20-tuxcare.0 up to 1.11.20-tuxcare.1, plus listed versions
1.11.20
1.11.20-tuxcare.1
@unhead/vue
TuxCare:npm
From an advisory covering 2 CVEs
1.11.20-tuxcare.0 up to 1.11.20-tuxcare.1, plus listed versions
1.11.20
1.11.20-tuxcare.1
@unhead/schema
TuxCare:npm
From an advisory covering 2 CVEs
1.11.20-tuxcare.0 up to 1.11.20-tuxcare.1, plus listed versions
1.11.20
1.11.20-tuxcare.1
unhead
npm
before 2.1.11
2.1.11

History

History
RecordedChangedSources
affected, facts
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-31873 is a none vulnerability (CVSS 0.0) in Unjs Unhead, published March 12, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.27%, the 19th percentile. Fixed in unhead 2.1.11.

References

MoveEnter Open