Live threats

All CVEs / Unjs

CVE-2026-31860Unjs Unhead

Medium 5.3 No auth needed

Priority
47
CVSS 4.0
5.3
EPSS
—
Auth required
No
Published
Mar 12, 2026
Updated
Jun 17, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-79
SSVC (CISA)
Exploitation: proof of concept · Automatable: no · Technical impact: partial
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

What happens

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.

Original NVD text.

What to do

  1. Apply the vendor's security update for Unhead.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
npm unhead < 2.1.11 2.1.11 npm install unhead@2.1.11

Per OSV / GitHub Advisories (GHSA-g5xx-pwrp-g3fv). Check the version in your lockfile before upgrading.

Affected products (CPE)

VendorProductVersions
unjsunhead< 2.1.11

Official sources

References

Links published by the sources. Open them with care.