CVE-2026-39315: CWE-184: Incomplete List of Disallowed Inputs in unjs unhead
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.
AI Analysis
Technical Summary
Unhead is a document head and template manager. Before version 2.1.13, the useHeadSafe() composable recommended by Nuxt for safe rendering of user content in <head> relied on hasDangerousProtocol() to block dangerous URI schemes such as 'javascript:', 'data:', and 'vbscript:'. This function decodes HTML entities using regex patterns with fixed-width digit caps. However, the HTML5 specification allows numeric character references with unlimited leading zeros. When such padded entities exceed the regex digit limit, the decoder skips them, causing the raw string to be passed unchecked to startsWith('javascript:'). Consequently, makeTagSafe() writes this raw value directly into SSR HTML output. Browsers decode the padded entity natively, reconstructing the blocked URI and potentially enabling unsafe script execution. This vulnerability is addressed in unhead version 2.1.13.
Potential Impact
The vulnerability allows bypassing of URI scheme filtering in user-supplied content rendered in the document head, potentially enabling execution of dangerous protocols like 'javascript:' in browsers. This can lead to limited confidentiality and integrity impacts as indicated by the CVSS vector (C:L/I:L/A:N). There are no known exploits in the wild at this time.
Mitigation Recommendations
This vulnerability is fixed in unhead version 2.1.13. Users should upgrade to version 2.1.13 or later to remediate this issue. Patch status is not explicitly confirmed in the vendor advisory content provided, but the description states the issue is fixed in 2.1.13. No other mitigation steps are indicated.
CVE-2026-39315: CWE-184: Incomplete List of Disallowed Inputs in unjs unhead
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.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Unhead is a document head and template manager. Before version 2.1.13, the useHeadSafe() composable recommended by Nuxt for safe rendering of user content in <head> relied on hasDangerousProtocol() to block dangerous URI schemes such as 'javascript:', 'data:', and 'vbscript:'. This function decodes HTML entities using regex patterns with fixed-width digit caps. However, the HTML5 specification allows numeric character references with unlimited leading zeros. When such padded entities exceed the regex digit limit, the decoder skips them, causing the raw string to be passed unchecked to startsWith('javascript:'). Consequently, makeTagSafe() writes this raw value directly into SSR HTML output. Browsers decode the padded entity natively, reconstructing the blocked URI and potentially enabling unsafe script execution. This vulnerability is addressed in unhead version 2.1.13.
Potential Impact
The vulnerability allows bypassing of URI scheme filtering in user-supplied content rendered in the document head, potentially enabling execution of dangerous protocols like 'javascript:' in browsers. This can lead to limited confidentiality and integrity impacts as indicated by the CVSS vector (C:L/I:L/A:N). There are no known exploits in the wild at this time.
Mitigation Recommendations
This vulnerability is fixed in unhead version 2.1.13. Users should upgrade to version 2.1.13 or later to remediate this issue. Patch status is not explicitly confirmed in the vendor advisory content provided, but the description states the issue is fixed in 2.1.13. No other mitigation steps are indicated.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-04-06T19:31:07.266Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69d7ee091cc7ad14da04a8c9
Added to database: 4/9/2026, 6:20:57 PM
Last enriched: 4/17/2026, 12:01:53 PM
Last updated: 5/25/2026, 2:43:32 AM
Views: 92
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.