ren","image":"https://o3.security/opengraph.png","datePublished":"2026-04-10T22:09:39Z","dateModified":"2026-04-10T22:19:21.376374Z","url":"https://o3.security/vulnerability/GHSA-x7mm-9vvv-64w8","inLanguage":"en","author":{"@id":"https://o3.security/#organization"},"publisher":{"@id":"https://o3.security/#organization"},"mainEntityOfPage":{"@type":"WebPage","@id":"https://o3.security/vulnerability/GHSA-x7mm-9vvv-64w8"},"speakable":{"@type":"SpeakableSpecification","cssSelector":["h1",".vuln-summary",".vuln-severity",".vuln-mitigation"]},"about":[{"@type":"SoftwareApplication","name":"unhead","applicationCategory":"npm","softwareVersion":"3.0.1"}],"citation":[{"@type":"CreativeWork","name":"OSV.dev","url":"https://osv.dev/vulnerability/GHSA-x7mm-9vvv-64w8"},{"@type":"CreativeWork","url":"https://github.com/unjs/unhead/security/advisories/GHSA-x7mm-9vvv-64w8"},{"@type":"CreativeWork","url":"https://github.com/unjs/unhead/commit/64b5ac0aa30cc256ea6677ce3dc4f132f81b2ff6"}]} ren","url":"https://o3.security/vulnerability/GHSA-x7mm-9vvv-64w8","identifier":"GHSA-x7mm-9vvv-64w8","datePublished":"2026-04-10T22:09:39Z","dateModified":"2026-04-10T22:19:21.376374Z","inLanguage":"en","license":"https://creativecommons.org/licenses/by/4.0/","keywords":["GHSA-x7mm-9vvv-64w8","CVE","vulnerability","security advisory"],"creator":{"@id":"https://o3.security/#organization"},"isAccessibleForFree":true,"citation":[{"@type":"CreativeWork","name":"OSV.dev","url":"https://osv.dev/vulnerability/GHSA-x7mm-9vvv-64w8"}]}`\n* `renderSSRHeadSuspenseChunk()` returned `window.${streamKey}.push(...)`\n\nNo esc"}},{"@type":"Question","name":"How severe is GHSA-x7mm-9vvv-64w8?","acceptedAnswer":{"@type":"Answer","text":"No CVSS score has been assigned to GHSA-x7mm-9vvv-64w8 yet. Review the advisory details and affected package list to assess your exposure."}},{"@type":"Question","name":"Which packages are affected by GHSA-x7mm-9vvv-64w8?","acceptedAnswer":{"@type":"Answer","text":"GHSA-x7mm-9vvv-64w8 affects the following packages: unhead (npm). Ecosystems affected: npm."}},{"@type":"Question","name":"How do I fix GHSA-x7mm-9vvv-64w8?","acceptedAnswer":{"@type":"Answer","text":"Update unhead to 3.0.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-x7mm-9vvv-64w8 is resolved across your whole dependency graph."}},{"@type":"Question","name":"How do I detect GHSA-x7mm-9vvv-64w8 in my npm dependencies?","acceptedAnswer":{"@type":"Answer","text":"Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for unhead, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version."}},{"@type":"Question","name":"How do I mitigate GHSA-x7mm-9vvv-64w8 if there is no patch (or I can't update yet)?","acceptedAnswer":{"@type":"Answer","text":"If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands."}},{"@type":"Question","name":"Is GHSA-x7mm-9vvv-64w8 actively exploited in the wild?","acceptedAnswer":{"@type":"Answer","text":"No public exploit code has been indexed for GHSA-x7mm-9vvv-64w8 yet. This does not mean the vulnerability cannot be exploited — absence of public exploits does not imply safety. Apply the recommended fix and use O3 Security to monitor your exposure."}},{"@type":"Question","name":"When was GHSA-x7mm-9vvv-64w8 published, and has it been updated?","acceptedAnswer":{"@type":"Answer","text":"GHSA-x7mm-9vvv-64w8 was published on April 10, 2026 and was last updated on April 10, 2026. Advisory data evolves as severity scores, affected ranges, and exploit intelligence are revised — always check the latest version of the advisory before acting."}}]}
NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
📦 npm
Not in CISA KEV

unhead: Streaming SSR `streamKey` injected into inline script without identifier validationGHSA-x7mm-9vvv-64w8

Fix: unjs/unhead@64b5ac0

GHSA-x7mm-9vvv-64w8 is a security vulnerability in unhead. A fix is available for unhead — see the affected versions and patch details below.

Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Apr 10, 2026 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

96other npm packages depend on this — each one inherits the vulnerability until it's patched upstream
unheadnpm
6.6Mdownloads / week

Description

Summary

createStreamableHead({ streamKey }) interpolated its streamKey argument directly into the streaming SSR bootstrap and suspense-chunk inline scripts without identifier validation or escaping. If an application forwards untrusted data into that configuration value, the rendered scripts become a script-injection sink.

Details

streamKey was embedded into JavaScript source via dot notation in two public helpers:

  • createBootstrapScript() returned <script>window.${streamKey}={...}</script>
  • renderSSRHeadSuspenseChunk() returned window.${streamKey}.push(...)

No escaping, quoting, or identifier validation was applied before these strings were embedded into HTML. A streamKey such as __unhead__;globalThis.PWNED=1;// broke out of the intended property access and injected arbitrary JavaScript into the page. The JSON escaping used for streamed head entries did not protect streamKey because streamKey was inserted as raw code rather than as serialized data.

Impact

streamKey is a developer-chosen configuration value rather than a data field — the intended usage is a hardcoded identifier-shaped constant (default __unhead__). Exploitation therefore requires an application to explicitly route untrusted input into a configuration sink, which is not a documented or recommended pattern. We have no reports of any downstream project sourcing streamKey from request data.

Applications using the default streamKey, or any hardcoded custom key, are not affected.

PoC

import { createStreamableHead, renderSSRHeadShell } from 'unhead/stream/server'

const { head } = createStreamableHead({
  streamKey: '__unhead__;globalThis.PWNED=1;//',
})

const html = renderSSRHeadShell(
  head,
  '<!doctype html><html><head></head><body></body></html>',
)

// <!doctype html><html><head><script>window.__unhead__;globalThis.PWNED=1;//={_q:[],push(e){this._q.push(e)}}</script>…

Patch

Fixed on main in 64b5ac0. The fix will ship in the next patch release of unhead.

streamKey is now validated against a conservative ASCII JavaScript-identifier pattern (/^[$_a-z][$\w]*$/i) at every sink — createStreamableHead, createBootstrapScript, and the internal stream-key resolver. Invalid values throw immediately instead of being emitted into script output.

Workarounds

Do not pass untrusted data into createStreamableHead({ streamKey }) or createBootstrapScript(key). If per-tenant keys are required, whitelist them against an identifier-safe pattern before constructing the head instance.

Credit

Thanks to @Jvr2022 for the report.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmunhead≥ 3.0.0-beta.5&&< 3.0.13.0.1npm install unhead@3.0.1

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for unhead, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update unhead to 3.0.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-x7mm-9vvv-64w8 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

Frequently Asked Questions

### Summary `createStreamableHead({ streamKey })` interpolated its `streamKey` argument directly into the streaming SSR bootstrap and suspense-chunk inline scripts without identifier validation or escaping. If an application forwards untrusted data into that configuration value, the rendered scripts become a script-injection sink. ### Details `streamKey` was embedded into JavaScript source via dot notation in two public helpers: * `createBootstrapScript()` returned `<script>window.${streamKey}={...}</script>` * `renderSSRHeadSuspenseChunk()` returned `window.${streamKey}.push(...)` No esc
O3 Security · Impact-Aware SCA

Is GHSA-x7mm-9vvv-64w8 in your dependencies?

Find it across npm, including transitive dependencies.

unhead: Streaming SSR `streamKey` injected into inline…