Quick answers
- Is This vulnerability exploited in the wild?
- No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
- How severe is This vulnerability?
- Medium severity, with a CVSS score of 4, published 10 April 2026.
- Which products and versions are affected?
- unhead (npm) SEMVER:introduced=3.0.0-beta.5,fixed=3.0.1.
- Is there a fix for This vulnerability?
- Yes. unhead (npm): upgrade to 3.0.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is This vulnerability attacked?
- It is attacked over the network.
- Am I affected?
- Check whether you run unhead (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- unhead (npm): upgrade to 3.0.1 or later
npm install unhead@3.0.1
Technical details
The vulnerability is a script injection (CWE-79) stemming from insufficient input validation. The `createStreamableHead()` and `createBootstrapScript()` functions embed the `streamKey` parameter directly into inline script tags via string interpolation (e.g., `window.${streamKey}={...}`) without identifier validation or escaping. An attacker-controlled value like `__unhead__;globalThis.PWNED=1;//` breaks out of the intended dot-notation property access and injects arbitrary JavaScript. The vulnerability requires that an application explicitly routes untrusted request data into the `streamKey` configuration parameter—a pattern that is neither documented nor recommended. The fix, released in unhead 3.0.1, validates `streamKey` against a conservative ASCII JavaScript-identifier regex (`/^[$_a-z][$\w]*$/i`) at all injection points and throws immediately on invalid values.
Affected products
- unjs unhead 3.0.0-beta.5 through 3.0.0
Timeline
- 2026-04-10: disclosed: Advisory GHSA-x7mm-9vvv-64w8 published
- 2026-04-10: patched: Fixed in unhead 3.0.1 via commit 64b5ac0