Impact
Unhead's useHeadSafe composable can be bypassed to inject arbitrary HTML attributes, including event handlers, into server‑side rendered <head> tags. The acceptDataAttrs function permits any key starting with data- without checking for spaces or characters that break attribute parsing. This flaw allows an attacker to insert malicious client‑side scripts, resulting in a stored XSS vulnerability.
Affected Systems
Vendors affected are unjs:unhead. All releases prior to version 2.1.11 are vulnerable. Versions 2.1.11 and later contain the fix.
Risk and Exploitability
The CVSS base score is 5.3, indicating moderate severity, while the EPSS score is below 1% and the vulnerability is not listed in the CISA KEV catalog, implying low expected exploitation. The likely attack vector is through user‑supplied data that is passed to useHeadSafe in an SSR context; the attacker can craft a key that starts with data- but contains malicious attribute names to trigger the XSS. No specific exploitation conditions are outlined beyond the presence of user input in useHeadSafe.
OpenCVE Enrichment
Github GHSA