DEV Community

CVE Reports
CVE Reports

Posted on • Originally published at cvereports.com

CVE-2026-39315: CVE-2026-39315: Cross-Site Scripting Filter Bypass in Unhead useHeadSafe()

CVE-2026-39315: Cross-Site Scripting Filter Bypass in Unhead useHeadSafe()

Vulnerability ID: CVE-2026-39315
CVSS Score: 6.1
Published: 2026-04-09

The Unhead document head manager contains a security bypass vulnerability in the useHeadSafe() composable. An incomplete regular expression fails to decode HTML numeric character references padded with excessive leading zeros, allowing attackers to bypass protocol blocklists and achieve Cross-Site Scripting (XSS).

TL;DR

A regular expression limitation in Unhead versions prior to 2.1.13 allows attackers to bypass XSS filters by padding HTML entities with leading zeros. This enables the execution of malicious javascript: URIs via the useHeadSafe() API.


⚠️ Exploit Status: POC

Technical Details

  • CWE ID: CWE-184
  • CVSS Score: 6.1 (Medium)
  • Attack Vector: Network
  • Exploit Status: PoC Available
  • CISA KEV: Not Listed
  • Impact: Cross-Site Scripting (XSS)

Affected Systems

  • unhead (npm package)
  • Nuxt.js applications utilizing the unhead module
  • unhead: < 2.1.13 (Fixed in: 2.1.13)

Code Analysis

Commit: 961ea78

Fix regex quantifier for decoding HTML entities in safe plugin

Exploit Details

  • Vulnerability Report: Proof of Concept demonstrating the bypass using excessive leading zeros in HTML numeric character references.

Mitigation Strategies

  • Update the unhead npm package to version 2.1.13 or newer.
  • Implement a strict Content Security Policy (CSP) blocking inline scripts and dangerous URI schemes.
  • Sanitize inputs at the application boundary prior to passing them to useHeadSafe().

Remediation Steps:

  1. Identify all projects utilizing the unhead package or Nuxt.js framework.
  2. Execute npm update unhead or yarn upgrade unhead in the project root.
  3. Verify the installed version is >= 2.1.13 using npm ls unhead.
  4. Run the application test suite to ensure no regressions occur with the updated validation logic.
  5. Deploy the updated application to production environments.

References


Read the full report for CVE-2026-39315 on our website for more details including interactive diagrams and full exploit analysis.

Top comments (0)