TanStack Router: Unauthenticated reflected XSS in TanStack Start server-function responses
Affected releases · @tanstack/react-start
- 1.x1.143.12 – 1.168.59Fixed in 1.168.60
On 1.x, the newest line:
npm install @tanstack/react-start@1.168.60Not affected
1.111.10 – 1.143.11
402 releases
Affected
1.143.12 – 1.168.59
267 releases
Fixed
1.168.60 – 1.169.3
6 releases, latest
Affected releases · @tanstack/solid-start
- 1.x1.143.12 – 1.168.56Fixed in 1.168.57
On 1.x, the newest line:
npm install @tanstack/solid-start@1.168.57Not affected
1.114.29 – 1.143.11
375 releases
Affected
1.143.12 – 1.168.56
264 releases
Fixed
1.168.57 – 1.169.3
6 releases, latest
Affected releases · @tanstack/start-server-core
- 1.x1.143.12 – 1.169.38Fixed in 1.169.39
On 1.x, the newest line:
npm install @tanstack/start-server-core@1.169.39Not affected
1.114.5 – 1.143.9
257 releases
Affected
1.143.12 – 1.169.38
164 releases
Fixed
1.169.39 – 1.169.44
6 releases, latest
Is your project affected?
Paste your package.json, or type the range you declare for @tanstack/react-start. It is read in your browser and sent nowhere.
Is your project affected?
Paste your package.json, or type the range you declare for @tanstack/solid-start. It is read in your browser and sent nowhere.
Is your project affected?
Paste your package.json, or type the range you declare for @tanstack/start-server-core. It is read in your browser and sent nowhere.
What happens
Impact
An unauthenticated attacker can craft a URL to a server function in an affected TanStack Start app. If someone opens the link, the app can return attacker-controlled HTML from its own origin and run the attacker's JavaScript there. The script can access same-origin data available to that visitor and make requests with their authority.
Cause
The server-function transport can pass request payload fields into internal middleware state instead of limiting them to public input fields. A malformed payload can leave an attacker-controlled result in the error path. Response handling can then treat a response-shaped object as an HTTP response.
Affected versions
Published versions of @tanstack/start-server-core, @tanstack/react-start, @tanstack/solid-start, and @tanstack/vue-start from 1.143.12 up to, but not including, their respective patched versions are affected. The patched versions are @tanstack/start-server-core@1.169.39, @tanstack/react-start@1.168.60, @tanstack/solid-start@1.168.57, and @tanstack/vue-start@1.168.56.
Fix
The fix limits client-supplied server-function input to public fields and validates responses at the server boundary. Upgrade to the corresponding patched package version.
Temporary mitigations
For the configured server-function path, usually /_serverFn/*, an edge or WAF rule can consider blocking requests without the literal x-tsr-serverFn: true header and browser document navigations such as Sec-Fetch-Mode: navigate or Accept: text/html. A restrictive Content Security Policy on server-function responses can provide another browser-side restriction. These are mitigation suggestions, not a complete fix. The header is client-controlled and is not authentication. Test rules against legitimate GET and POST server functions and use a matching version-specific backport where possible.
Credits
Lovable helped us discover and report this issue. We thank them for their help.