CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-X7MM-9VVV-64W8

GHSA-X7MM-9VVV-64W8: Reflected Cross-Site Scripting in unhead Streaming SSR

Amit Schendel
Amit Schendel
Senior Security Researcher

Apr 11, 2026·5 min read·21 visits

Executive Summary (TL;DR)

Reflected XSS in unhead's streaming SSR allows unauthenticated attackers to execute arbitrary JavaScript in the victim's browser via an unvalidated streamKey parameter.

The unhead package, specifically its streaming server-side rendering (SSR) functionality, is vulnerable to Reflected Cross-Site Scripting (XSS). The vulnerability stems from improper validation and unsafe string interpolation of the developer-configurable streamKey property when rendering inline JavaScript payload tags for client-side state hydration.

Vulnerability Overview

The unhead library provides document head management for server-side rendered (SSR) JavaScript applications. The streaming SSR implementation synchronizes state between the server environment and the client browser during hydration. This synchronization relies on a developer-configurable identifier known as the streamKey.

GHSA-X7MM-9VVV-64W8 tracks a Cross-Site Scripting (XSS) vulnerability classified under CWE-79: Improper Neutralization of Input During Web Page Generation. The flaw resides in the specific sub-packages responsible for handling streaming SSR, such as @unhead/ssr.

When the streamKey parameter is derived from untrusted input, the application fails to sanitize or validate the string before interpolating it into an inline script tag. The resulting output is rendered directly into the HTML document, permitting unauthenticated attackers to execute arbitrary JavaScript in the context of the user's browser session.

Root Cause Analysis

The vulnerability originates from unsafe string interpolation within the createBootstrapScript function. This function generates a bootstrapping script payload required for the client-side hydration process. The script initializes an array on the global window object using the streamKey variable as the property name.

In the vulnerable implementation, the streamKey string is directly appended to the window. object reference without prior lexical validation. The system implicitly trusts that the provided string strictly conforms to valid JavaScript identifier naming conventions.

If the streamKey configuration relies on dynamically parsed query parameters or multi-tenant headers without intermediary sanitization, an attacker gains direct control over the injected string. The JavaScript parser evaluates the raw input as code, breaking the intended dot-notation assignment and allowing execution of contiguous JavaScript expressions.

Code Analysis

The flaw manifests in packages/unhead/src/stream/server.ts. The original createBootstrapScript function utilized standard template literals to construct the payload.

// Vulnerable implementation example
export function createBootstrapScript(streamKey: string = DEFAULT_STREAM_KEY): string {
  return `<script>window.${streamKey}={_q:[],push(e){this._q.push(e)}}</script>`
}

The remediation, introduced in commit 64b5ac0aa30cc256ea6677ce3dc4f132f81b2ff6, implements strict input validation. The fix introduces a regular expression, VALID_STREAM_KEY_RE, which restricts the streamKey to standard ASCII JavaScript identifiers.

// Patched implementation with validation
const VALID_STREAM_KEY_RE = /^[$_a-z][$\w]*$/i
 
function assertValidStreamKey(streamKey: string): void {
  if (typeof streamKey !== 'string' || !VALID_STREAM_KEY_RE.test(streamKey)) {
    throw new Error(
      `[unhead] Invalid streamKey: must be a valid JavaScript identifier...`
    )
  }
}

The developers injected the assertValidStreamKey validation routine at three distinct lifecycle junctions. The system now validates the key upon entry in createStreamableHead, upon retrieval via getStreamKey, and immediately before code generation in createBootstrapScript. This layered defense strategy prevents malicious payloads from advancing to the rendering stage.

Exploitation

Exploitation requires the attacker to influence the streamKey variable passed to the server-side rendering logic. This precondition is met if an application routes unvalidated request parameters, such as a user-controlled subdomain or URL query string, directly into the unhead configuration object.

An attacker constructs a payload that properly terminates the intended JavaScript statement before initiating an arbitrary function call. A standard proof-of-concept payload utilizes a semicolon to separate expressions, followed by the malicious code and a trailing comment indicator.

Payload structure: __unhead__;alert(1)//

When the SSR engine processes this input, it generates the following HTML output:

<script>window.__unhead__;alert(1)//={_q:[],push(e){this._q.push(e)}}</script>

The browser's JavaScript engine evaluates the first expression, window.__unhead__;, which functions as a valid property access. It subsequently executes the injected function call alert(1). The trailing // converts the remainder of the original bootstrapping template into a comment, circumventing syntax errors that would otherwise halt script execution.

Impact Assessment

Successful exploitation results in Reflected Cross-Site Scripting. Because the injected script executes within the context of the vulnerable application's origin, the attacker inherits the permission scope of the victim's browser session.

The execution allows an attacker to access sensitive DOM elements, extract authentication tokens stored in localStorage or sessionStorage, and hijack active user sessions. Furthermore, the attacker can silently issue unauthorized HTTP requests on behalf of the authenticated user to restricted internal application programming interfaces.

The vulnerability primarily affects end users accessing the compromised uniform resource locator. Administrative users interacting with the malicious link face higher exposure, as session compromise in elevated contexts facilitates broader administrative control over the application infrastructure.

Remediation

The primary remediation strategy requires upgrading the unhead dependency to a version encompassing commit 64b5ac0aa30cc256ea6677ce3dc4f132f81b2ff6. The patch natively rejects any dynamically generated streamKey that contains non-alphanumeric or special characters outside the bounds of the VALID_STREAM_KEY_RE regular expression.

If an immediate dependency upgrade is administratively unfeasible, security engineers must implement input sanitization upstream of the unhead configuration instantiation. All request-derived data mapped to the streamKey parameter must undergo strict validation enforcing an allow-list of known-good identifiers.

Network defense teams can deploy web application firewall rules configured to monitor for anomalous identifier patterns. Specifically, rules targeting the presence of semicolons, parentheses, or comment structures within parameters destined for SSR state hydration endpoints will effectively interrupt exploitation attempts.

Official Patches

unjsCommit 64b5ac0 resolving the streamKey interpolation vulnerability

Fix Analysis (1)

Technical Appendix

CVSS Score
8.1/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N

Affected Systems

unhead@unhead/ssr

Affected Versions Detail

Product
Affected Versions
Fixed Version
unhead
unjs
All versions lacking commit 64b5ac0Version containing commit 64b5ac0
AttributeDetail
CWE IDCWE-79
Attack VectorNetwork
CVSS Score8.1
Exploit StatusProof of Concept
ImpactHigh
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1059.007Command and Scripting Interpreter: JavaScript
Execution
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

Known Exploits & Detection

Research AnalysisProof of concept payload utilizing inline script comment truncation to achieve execution.

Vulnerability Timeline

Fix commit pushed to repository
2026-04-10

References & Sources

  • [1]GitHub Security Advisory: GHSA-X7MM-9VVV-64W8
  • [2]Fix Commit in unhead repository
  • [3]unhead Project Repository

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 2 hours ago•CVE-2026-53766
6.1

CVE-2026-53766: Workspace Boundary Bypass in chrome-devtools-mcp via Symbolic Link Resolution Failure

A workspace boundary bypass vulnerability exists in the Chrome DevTools for Agents (chrome-devtools-mcp) Model Context Protocol (MCP) server from version 0.24.0 up to 1.1.0. The vulnerability allows an agent or malicious workspace containing symbolic links to read or modify arbitrary files outside the configured project workspace root directory. This occurs because the path validation function resolves paths lexically rather than physically.

Alon Barad
Alon Barad
1 views•7 min read
•about 3 hours ago•CVE-2026-56677
8.6

CVE-2026-56677: Unauthenticated Server-Side Request Forgery in 9Router OIDC Test Endpoint

A high-severity security vulnerability exists in 9Router, an AI router and token saver dashboard. When dashboard authentication features are disabled or left in default configurations, the application exposes administrative testing routines directly to the public internet. Unauthenticated network adversaries can exploit the OIDC configuration validation endpoint to initiate arbitrary HTTP requests, routing unauthorized traffic to local loops, adjacent container ports, and cloud resource metadata interfaces.

Amit Schendel
Amit Schendel
2 views•5 min read
•about 4 hours ago•CVE-2026-64849
9.3

CVE-2026-64849: Server-Side Request Forgery (SSRF) in MLflow Webhooks via DNS Rebinding

CVE-2026-64849 is a critical Server-Side Request Forgery (SSRF) vulnerability affecting MLflow tracking servers prior to version 3.15.0. It allows unauthenticated remote attackers to bypass outbound request destination filters using DNS rebinding or HTTP redirects. This exposure risks compromising sensitive cloud infrastructure metadata and internal microservices.

Alon Barad
Alon Barad
3 views•5 min read
•about 5 hours ago•CVE-2026-69146
6.5

CVE-2026-69146: Missing Authorization Bypass in MLflow Basic Authentication Middleware

This technical report details a missing authorization vulnerability (CVE-2026-69146 / GHSA-3p64-6gvh-82v5) affecting the MLflow platform from version 3.13.0 to 3.15.0. When MLflow is configured with the built-in basic-auth plugin, authenticated users can bypass run-level UPDATE authorization checks, enabling unauthorized dataset and model lineage metadata injection.

Alon Barad
Alon Barad
2 views•7 min read
•about 6 hours ago•CVE-2026-69148
7.1

CVE-2026-69148: Broken Object Level Authorization (BOLA) in MLflow Model Registry

MLflow prior to version 3.15.0 fails to perform proper authorization checks when registering model versions, allowing authenticated users with access to a registered model to link and access artifacts from runs and models belonging to other users without authorization.

Amit Schendel
Amit Schendel
5 views•7 min read
•about 7 hours ago•CVE-2026-59893
7.5

CVE-2026-59893: Regular Expression Denial of Service in sqlparse Lexer

A high-severity Regular Expression Denial of Service (ReDoS) vulnerability in the sqlparse Python library prior to version 0.6.0 allows unauthenticated remote attackers to trigger CPU exhaustion and application denial of service via crafted SQL inputs containing unmatched dollar-quoted literals or unclosed multiline comments.

Alon Barad
Alon Barad
6 views•6 min read