chore(deps): update devdependency unhead to v2.1.11 [security]#925
Merged
chore(deps): update devdependency unhead to v2.1.11 [security]#925
Conversation
✅ Deploy Preview for friendly-lamington-fb5690 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #925 +/- ##
=======================================
Coverage 30.18% 30.18%
=======================================
Files 12 12
Lines 328 328
Branches 98 98
=======================================
Hits 99 99
Misses 229 229 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
danielroe
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.1.10→2.1.11GitHub Vulnerability Alerts
CVE-2026-31873
The
link.hrefcheck inmakeTagSafe(safe.ts, line 68-71) usesString.includes(), which is case-sensitive:Browsers treat URI schemes case-insensitively.
DATA:text/css,...is the same asdata:text/css,...to the browser, but'DATA:...'.includes('data:')returnsfalse.PoC
SSR output:
The browser loads this as a CSS stylesheet. An attacker can inject arbitrary CSS for UI redressing or data exfiltration via CSS attribute selectors with background-image callbacks.
Any case variation works:
DATA:,Data:,dAtA:,JAVASCRIPT:, etc.Suggested fix
CVE-2026-31860
Summary
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.Details
XSS via
data-*attribute name injectionThe
acceptDataAttrsfunction (safe.ts, line 16-20) allows any property key starting withdata-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 result gets merged into every tag's props at line 114:
Then
propsToString(propsToString.ts, line 26) interpolates property keys directly into the HTML string with no sanitization:A space in the key breaks out of the attribute name. Everything after the space becomes separate HTML attributes.
PoC
The most practical vector uses a
linktag.<link rel="stylesheet">firesonloadonce the stylesheet loads, giving reliable script execution:SSR output:
The browser parses
onload=alert(document.domain)as its own attribute. Once the stylesheet loads, the handler fires.The same injection works on any tag type since
acceptDataAttrsis applied to all of them at line 114. Here's the same thing on ametatag (the injected attributes render, thoughonclickdoesn't fire on non-interactive<meta>elements):Realistic scenario
A Nuxt app accepts SEO metadata from a CMS or user profile. The developer uses
useHeadSafe()as the docs recommend. An attacker puts adata-*key with spaces and an event handler into their input. The payload renders into the HTML on every page load.Suggested fix
For vulnerability 1, validate that attribute names only contain characters legal in HTML attributes:
Release Notes
unjs/unhead (unhead)
v2.1.11Compare Source
🐞 Bug Fixes
View changes on GitHub
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.