Ad

CVE-2026-31860

MEDIUM CVSS 4.0: 5.3 EPSS 0.04%
Updated Mar 16, 2026
Unjs
Parameter Value
CVSS 5.3 (MEDIUM)
Affected Versions before 2.1.11
Fixed In 2.1.11
Type CWE-79 (Cross-Site Scripting (XSS))
Vendor Unjs
Public PoC No

Unhead is a document head and template manager. Prior to 2.1.11, useHeadSafe() can be bypassed to inject arbitrary HTML attributes, including event handlers, into SSR-rendered <head> tags. This is the composable that Nuxt docs recommend for safely handling user-generated content.

The acceptDataAttrs function (safe.ts, line 16-20) allows any property key starting with data- through to the final HTML. It only checks the prefix, not whether the key contains spaces or other characters that break HTML attribute parsing. This vulnerability is fixed in 2.1.11.

Attack Parameters

Attack Vector
Network
Can be exploited remotely
Attack Complexity
Low
Easy to exploit
Attack Requirements
None
No additional conditions
Privileges Required
None
No privileges needed
User Interaction
Passive
Minimal interaction

Impact Assessment

Confidentiality
None
No data leak
Integrity
None
No data modification
Availability
None
No disruption

CVSS Vector v4.0

Vulnerable Products 1

Configuration From (including) Up to (excluding)
Unjs Unhead
cpe:2.3:a:unjs:unhead:*:*:*:*:*:*:*:*
2.1.11

Related Vulnerabilities