Skip to main content
Vulnerability Database/CVE-2026-102989

CVE-2026-102989: TanStack Router XSS Vulnerability

CVE-2026-102989 is a cross-site scripting flaw in TanStack Router that allows attackers to inject malicious scripts through crafted server-function URLs. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-102989 Overview

CVE-2026-102989 is a cross-site scripting (XSS) vulnerability in TanStack Router, a client-first, server-capable, type-safe router and full-stack framework for the web. An unauthenticated attacker can place non-public fields in a server-function request payload. This causes attacker-controlled middleware state to reach the error path, where a response-shaped object is accepted as a valid HTTP response. The result is that a crafted server-function URL returns attacker-controlled HTML served from the application's origin.

Critical Impact

When a victim opens the crafted URL, injected scripts execute in the application's origin context, gaining access to same-origin data and the ability to issue authenticated requests as the victim [CWE-79].

Affected Products

  • @tanstack/start-server-core versions 1.143.12 through 1.169.38
  • @tanstack/react-start versions 1.143.12 through 1.168.59
  • @tanstack/solid-start versions 1.143.12 through 1.168.56 and @tanstack/vue-start versions 1.143.12 through 1.168.55

Discovery Timeline

  • 2026-10-13 - CVE-2026-102989 published to NVD
  • 2026-10-14 - Last updated in NVD database

Technical Details for CVE-2026-102989

Vulnerability Analysis

The vulnerability resides in the server-function transport layer of TanStack Start. The isSsrResponse type guard in handlerCallback.ts validated candidate response objects using a loose structural check. Any object containing response and serverSsrCleanup properties was accepted as a valid SSR response. Attackers can inject arbitrary objects through server-function request payloads that satisfy this shape.

Because the framework forwarded the entire options object into the server-function context, non-public fields reached middleware state and the error path. An attacker-crafted object masquerading as a response was returned to the client as HTML from the application's origin. The resulting script executes with same-origin privileges, enabling session theft, authenticated API abuse, and data exfiltration.

Root Cause

Two defects combined to produce the vulnerability. First, the server-function invocation at createServerFn.ts spread the full opts object into the server context using ...opts, allowing attacker-supplied keys beyond data and method to influence middleware behavior. Second, isSsrResponse performed only property-existence checks without validating that response was an actual Response instance or that serverSsrCleanup held a valid discriminant value.

Attack Vector

Exploitation requires network access to a server-function endpoint and user interaction such as clicking a crafted link. No authentication is required. The attacker constructs a request payload containing fields that trigger the error path and inject a fake response object, then lures a visitor to open the URL.

typescript
// Patch: packages/router-core/src/ssr/handlerCallback.ts
export function isSsrResponse(value: unknown): value is SsrResponse {
  if (
    typeof value !== 'object' ||
    value === null ||
    !('response' in value) ||
    !(value.response instanceof Response) ||
    !('serverSsrCleanup' in value)
  ) {
    return false
  }

  if (value.serverSsrCleanup === 'none') {
    return true
  }

  return (
    value.serverSsrCleanup === 'stream' &&
    'dispose' in value &&
    typeof value.dispose === 'function'
  )
}
// Source: [GitHub commit d521abd](https://github.com/TanStack/router/commit/d521abd71c69f1ff010bb3def4d417cb5fa058cb)

The patch adds strict validation: response must be a real Response instance, and serverSsrCleanup must equal 'none' or 'stream' with a corresponding dispose function. A second patch in createServerFn.ts replaces ...opts with explicit field selection (data: opts.data, method: opts.method) to prevent attacker-controlled fields from reaching middleware context.

Detection Methods for CVE-2026-102989

Indicators of Compromise

  • Server-function request payloads containing unexpected top-level keys beyond data and method
  • HTTP responses from server-function endpoints returning HTML content types when JSON is expected
  • Outbound requests from authenticated user sessions to attacker-controlled domains shortly after visiting a server-function URL

Detection Strategies

  • Inventory applications depending on @tanstack/start-server-core, @tanstack/react-start, @tanstack/solid-start, and @tanstack/vue-start and compare installed versions against fixed releases
  • Log and inspect server-function invocations for payload shapes that include properties outside the documented API surface
  • Review web application firewall (WAF) logs for requests to /_serverFn/ style endpoints returning unexpected text/html responses

Monitoring Recommendations

  • Alert on server-function responses whose Content-Type header deviates from the application baseline
  • Monitor browser Content Security Policy (CSP) violation reports for inline script executions on application origins
  • Correlate anomalous same-origin API calls with recent navigation to server-function URLs in session telemetry

How to Mitigate CVE-2026-102989

Immediate Actions Required

  • Upgrade @tanstack/start-server-core to 1.169.39 or later immediately
  • Upgrade framework-specific packages: @tanstack/react-start to 1.168.60, @tanstack/solid-start to 1.168.57, and @tanstack/vue-start to 1.168.56
  • Audit application logs for prior exploitation attempts and rotate any session tokens or credentials that may have been exposed

Patch Information

The fix is published in commit d521abd71c69f1ff010bb3def4d417cb5fa058cb and released on 2026-09-30. Review the GitHub Security Advisory GHSA-qx66-fv34-fjm8, Pull Request #8573, and the release notes for complete remediation details.

Workarounds

  • Deploy a strict Content Security Policy that disallows inline scripts on application origins to limit payload execution
  • Place a reverse proxy or WAF rule in front of server-function endpoints that rejects request bodies containing keys outside the expected schema
  • Restrict server-function routes to authenticated sessions where feasible to reduce the exposed attack surface
bash
# Upgrade to patched versions using npm
npm install @tanstack/start-server-core@1.169.39
npm install @tanstack/react-start@1.168.60
npm install @tanstack/solid-start@1.168.57
npm install @tanstack/vue-start@1.168.56

# Verify installed versions
npm ls @tanstack/start-server-core @tanstack/react-start @tanstack/solid-start @tanstack/vue-start

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.