Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2026-31860— Unhead has a XSS bypass in `useHeadSafe` via attribute name injection and case-sensitive protocol check

Quick assessment

Affected
unjs unhead
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

unhead是UnJS开源的一个文档头和模板管理器。 unhead 2.1.11之前版本存在跨站脚本漏洞,该漏洞源于useHeadSafe函数可被绕过,可能导致向SSR渲染的<head>标签注入任意HTML属性,包括事件处理程序。

AI Predicted 8.1 Difficulty: Easy EPSS 0.28% · P19
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2026-31860

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
Unhead has a XSS bypass in `useHeadSafe` via attribute name injection and case-sensitive protocol check
Source: CVE Program / CVE List V5
Vulnerability Description
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.
Source: CVE Program / CVE List V5
CVSS Information
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
Source: CVE Program / CVE List V5
Vulnerability Type
在Web页面生成时对输入的转义处理不恰当(跨站脚本)
Source: CVE Program / CVE List V5
Vulnerability Title
unhead 跨站脚本漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
unhead是UnJS开源的一个文档头和模板管理器。 unhead 2.1.11之前版本存在跨站脚本漏洞,该漏洞源于useHeadSafe函数可被绕过,可能导致向SSR渲染的<head>标签注入任意HTML属性,包括事件处理程序。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

Vendor Product Affected Versions CPE Subscribe
unjs unhead < 2.1.11 -

II. Public POCs for CVE-2026-31860

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2026-31860

请登录查看更多情报信息。

Vendor Advisories for CVE-2026-31860 (1)

IV. Related Vulnerabilities

V. Comments for CVE-2026-31860

No comments yet


Leave a comment