CVE-2026-39315
Unhead has a hasDangerousProtocol() bypass via leading-zero padded HTML entities in useHeadSafe()
Description
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.
INFO
Published Date :
April 9, 2026, 6:17 p.m.
Last Modified :
April 14, 2026, 8:07 p.m.
Remotely Exploit :
Yes !
Source :
[email protected]
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS 3.1 | MEDIUM | [email protected] |
Solution
- Update Unhead to version 2.1.13.
- Apply vendor patches if available.
- Review code for improper use of useHeadSafe().
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2026-39315.
| URL | Resource |
|---|---|
| https://github.com/unjs/unhead/commit/961ea781e091853812ffe17f8cda17105d2d2299 | Patch |
| https://github.com/unjs/unhead/releases/tag/v2.1.13 | Product Release Notes |
| https://github.com/unjs/unhead/security/advisories/GHSA-95h2-gj7x-gx9w | Exploit Mitigation Vendor Advisory |
| https://github.com/unjs/unhead/security/advisories/GHSA-95h2-gj7x-gx9w | Exploit Mitigation Vendor Advisory |
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2026-39315 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2026-39315
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-39315 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2026-39315 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
Initial Analysis by [email protected]
Apr. 14, 2026
Action Type Old Value New Value Added CPE Configuration OR *cpe:2.3:a:unjs:unhead:*:*:*:*:*:node.js:*:* versions up to (excluding) 2.1.13 Added Reference Type GitHub, Inc.: https://github.com/unjs/unhead/commit/961ea781e091853812ffe17f8cda17105d2d2299 Types: Patch Added Reference Type GitHub, Inc.: https://github.com/unjs/unhead/releases/tag/v2.1.13 Types: Product, Release Notes Added Reference Type CISA-ADP: https://github.com/unjs/unhead/security/advisories/GHSA-95h2-gj7x-gx9w Types: Exploit, Mitigation, Vendor Advisory Added Reference Type GitHub, Inc.: https://github.com/unjs/unhead/security/advisories/GHSA-95h2-gj7x-gx9w Types: Exploit, Mitigation, Vendor Advisory -
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Apr. 13, 2026
Action Type Old Value New Value Added Reference https://github.com/unjs/unhead/security/advisories/GHSA-95h2-gj7x-gx9w -
New CVE Received by [email protected]
Apr. 09, 2026
Action Type Old Value New Value Added Description 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. Added CVSS V3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N Added CWE CWE-184 Added Reference https://github.com/unjs/unhead/commit/961ea781e091853812ffe17f8cda17105d2d2299 Added Reference https://github.com/unjs/unhead/releases/tag/v2.1.13 Added Reference https://github.com/unjs/unhead/security/advisories/GHSA-95h2-gj7x-gx9w