CVE-2026-39315 json
Unhead has a hasDangerousProtocol() bypass via leading-zero padded HTML entities in useHeadSafe()
published 2026-04-09 7 mo ago modified 2026-10-26 13 d ago also EUVD-2026-20992 , GHSA-95h2-gj7x-gx9w
- cvss
- 6.1
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.3%
- EPSS 0.3% chance of exploitation in 30 days, percentile 22%
- public exploits
- 0
- none known
Summary
Unhead is a document head and template manager. Prior to 2.1.13, useHeadSafe() is the composable that Nuxt's own documentation explicitly recommends for rendering user-supplied content in <head> safely. Internally, the hasDangerousProtocol() function in packages/unhead/src/plugins/safe.ts decodes HTML entities before checking for blocked URI schemes (javascript:, data:, vbscript:). The decoder uses two regular expressions with fixed-width digit caps. The HTML5 specification imposes no limit on leading zeros in numeric character references. When a padded entity exceeds the regex digit cap, the decoder silently skips it. The undecoded string is then passed to startsWith('javascript:'), which does not match. makeTagSafe() writes the raw value directly into SSR HTML output. The browser's HTML parser decodes the padded entity natively and constructs the blocked URI. This vulnerability is fixed in 2.1.13.
Patch / fix
- npm unhead 2.1.13
- unjs unhead 2.1.13
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- no
- Technical impact
- partial
- Assessed
- 6 mo ago
Exploit prediction
0.30% chance of exploitation in the next 30 days, higher than 22% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/unjs/unhead/security/advisories/GHSA-95h2-gj7x-gx9w referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| GitHub | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | unhead | <2.1.13 |
2.1.13 |
Affected products
- unjs unhead
Classification
- Weakness
-
- CWE-184 Incomplete List of Disallowed Inputs
References
-
github.com
/unjs/unhead/commit/961ea781e091853812ffe17f8cda17105d2d2299
web, patch
-
github.com
/unjs/unhead/security/advisories/GHSA-95h2-gj7x-gx9w
exploit, web, mitigation, vendor-advisory
-
github.com
/unjs/unhead/releases/tag/v2.1.13
web, product, release-notes
-
nvd.nist.gov
/vuln/detail/CVE-2026-39315
advisory
-
github.com
/unjs/unhead
package
Sources
- CVE List CVE-2026-39315
- GitHub Advisory GHSA-95h2-gj7x-gx9w
- NVD CVE-2026-39315
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.