CVE-2024-24558: @tanstack/react query next experimental Cross-Site Scripting Vulnerability
HIGHCVE-2024-24558 is a HIGH (CVSS 8.2) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting @tanstack/react query next experimental libraries in the npm ecosystem. The issue involves react-query-streamed-hydration cross-site scripting vulnerability. Remediation is available by upgrading affected packages to version 5.18.0.
CVE-2024-24558 at a Glance
Security Impact
CVSS: 8.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N).
How to Fix CVE-2024-24558
To remediate this vulnerability, upgrade all affected @tanstack/react query next experimental dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @tanstack/react-query-next-experimental@5.18.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @tanstack/react-query-next-experimental
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-24558, inspect your project dependencies using npm:
npm ls @tanstack/react-query-next-experimental
Analyze the terminal output to locate any version of @tanstack/react query next experimental in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.18.0), your application is affected.
Note: The npm ls @tanstack/react-query-next-experimental command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product 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. In @tanstack/react query next experimental, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-24558 Affected @tanstack/react query next experimental Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@tanstack/react-query-next-experimental
|
npm |
≥ 5.0.0
< 5.18.0
|
5.18.0
|
References
Frequently Asked Questions
What is CVE-2024-24558?
Which @tanstack/react query next experimental versions are affected?
What version fixes CVE-2024-24558?
Is @tanstack/react-query-next-experimental affected?
What is the CVSS score of CVE-2024-24558?
What CWE is associated with CVE-2024-24558?
How can I check npm dependencies for CVE-2024-24558?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-997g-27x8-43rf",
"modified" : "2024-01-30T21:34:04Z",
"published" : "2024-01-30T20:57:22Z",
"aliases" : [ "CVE-2024-24558" ],
"summary" : "react-query-streamed-hydration Cross-site Scripting vulnerability",
"details" : "### Impact\n\nThe `@tanstack/react-query-next-experimental` NPM package is vulnerable to a cross-site scripting vulnerability. To exploit this, an attacker would need to either inject malicious input or arrange to have malicious input be returned from an endpoint.\n\nThis vulnerability arises from improper handling of untrusted input when `@tanstack/react-query-next-experimental` performs server-side rendering of HTML pages. To fix this vulnerability, we implemented appropriate escaping to prevent javascript injection into rendered pages.\n\n### Patches\n\nTo fix this issue, please update to version 5.18.0 or later.\n\n### Workarounds\n\nThere are no known workarounds for this issue. Please update to version 5.18.0 or later.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@tanstack/react-query-next-experimental"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0"
}, {
"fixed" : "5.18.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/TanStack/query/security/advisories/GHSA-997g-27x8-43rf"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-24558"
}, {
"type" : "WEB",
"url" : "https://github.com/TanStack/query/commit/f2ddaf2536e8b71d2da88a9310ac9a48c13512a1"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/TanStack/query"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-01-30T20:57:22Z",
"nvd_published_at" : "2024-01-30T20:15:45Z"
}
}