CVE-2026-39315 Details
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.
A vulnerability in Unhead, a document head and template manager, prior to version 2.1.13, allows for the injection of dangerous URI protocols into server-side rendered HTML. This issue arises in the 'useHeadSafe()' composable, which is recommended by Nuxt for safely rendering user-supplied content in the document head. The vulnerability is caused by the 'hasDangerousProtocol()' function, which decodes HTML entities before checking for blocked URI schemes such as 'javascript:', 'data:', and 'vbscript:'. The decoding process uses regular expressions that improperly limit the number of digits, allowing padded entities to bypass the scheme checks and be executed in the browser.
Users can update to Unhead version 2.1.13, which removes the fixed digit caps from the regular expressions that decode HTML entities, allowing for proper validation of leading-zero padded entities before scheme checks are applied.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Apr 13, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/unjs/unhead/security/advisories/GHSA-95h2-gj7x-gx9w | CISA-ADP | ExploitMitigationVendor Advisory |
| https://github.com/unjs/unhead/commit/961ea781e091853812ffe17f8cda17105d2d2299 | [email protected] | Patch |
| https://github.com/unjs/unhead/releases/tag/v2.1.13 | [email protected] | ProductRelease Notes |
| https://github.com/unjs/unhead/security/advisories/GHSA-95h2-gj7x-gx9w | [email protected] | ExploitMitigationVendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-184 | Incomplete List of Disallowed Inputs | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| unjs unhead | < 2.1.13 |
CPE
Remediation
| |
Change History
6 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Oct 26, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Apr 14, 2026 | Initial Analysis | [email protected] |
| Apr 13, 2026 | CVE Modified | CISA-ADP |
| Apr 9, 2026 | New CVE Received | [email protected] |