CVE-2026-39315Unjs Unhead
Medium 6.1 No auth needed
Follow: this CVE · Unjs · Unjs Unhead We alert you by email or Slack (account required).
- Priority
- 52
- CVSS 3.1
- 6.1
- EPSS
- —
- Auth required
- No
- Published
- Apr 9, 2026
- Updated
- Oct 26, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-184
- SSVC (CISA)
- Exploitation: proof of concept · Automatable: no · Technical impact: partial
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
What happens
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.
What to do
- Apply the vendor's security update for Unhead.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | unhead |
< 2.1.13 |
2.1.13 |
npm install unhead@2.1.13 |
Per OSV / GitHub Advisories (GHSA-95h2-gj7x-gx9w). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| unjs | unhead | < 2.1.13 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch
- github.com Product Release Notes
- github.com Exploit Mitigation Vendor Advisory