CVE-2026-21884: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in remix-run react-router
React Router is a router for React. In @remix-run/react version prior to 2.17.3. and react-router 7.0.0 through 7.11.0, a XSS vulnerability exists in in React Router's <ScrollRestoration> API in Framework Mode when using the getKey/storageKey props during Server-Side Rendering which could allow arbitrary JavaScript execution during SSR if untrusted content is used to generate the keys. There is no impact if server-side rendering in Framework Mode is disabled, or if Declarative Mode (<BrowserRouter>) or Data Mode (createBrowserRouter/<RouterProvider>) is being used. This issue has been patched in @remix-run/react version 2.17.3 and react-router version 7.12.0.
AI Analysis
Technical Summary
CVE-2026-21884 is a cross-site scripting (XSS) vulnerability categorized under CWE-79 that affects the React Router library, specifically versions @remix-run/react prior to 2.17.3 and react-router versions 7.0.0 through 7.11.0. The vulnerability arises in the <ScrollRestoration> API when used in Framework Mode with Server-Side Rendering (SSR), particularly when the getKey or storageKey properties are utilized to generate keys. During SSR, if these keys are generated from untrusted or unsanitized input, an attacker can inject malicious JavaScript code that executes on the server side, potentially compromising the application's integrity and leaking sensitive data. This issue is confined to SSR in Framework Mode; applications using Declarative Mode (<BrowserRouter>) or Data Mode (createBrowserRouter/<RouterProvider>) are not affected. The vulnerability does not impact applications that disable SSR in Framework Mode. The flaw allows remote attackers to execute arbitrary scripts without requiring authentication, though user interaction is necessary to trigger the vulnerability. The CVSS v3.1 score of 8.2 reflects a high severity due to the potential confidentiality impact and the ease of exploitation over the network without privileges. No known exploits have been reported in the wild as of the publication date. The issue has been addressed in @remix-run/react version 2.17.3 and react-router version 7.12.0, where proper input neutralization and sanitization have been implemented to prevent malicious script injection during SSR key generation.
Potential Impact
The primary impact of this vulnerability is the potential for arbitrary JavaScript execution during server-side rendering, which can lead to several security risks including theft of sensitive data, session hijacking, and unauthorized actions performed on behalf of users. Since React Router is widely used in modern web applications built with React, many organizations relying on SSR in Framework Mode with vulnerable versions are at risk. Exploitation could compromise the confidentiality and integrity of web applications, potentially allowing attackers to manipulate rendered content or steal user credentials. Although availability is not directly affected, the breach of trust and data exposure can have severe reputational and financial consequences. The vulnerability's network accessibility and lack of required privileges increase the risk profile, especially for public-facing web applications. Organizations that do not use SSR in Framework Mode or use other routing modes are not impacted, reducing the overall attack surface. However, given the popularity of React and React Router in enterprise and consumer web applications, the scope of affected systems is significant worldwide.
Mitigation Recommendations
Organizations should immediately upgrade to @remix-run/react version 2.17.3 or later and react-router version 7.12.0 or later to apply the official patch that addresses this vulnerability. For applications that rely on SSR in Framework Mode, review and sanitize all inputs used in getKey and storageKey props to ensure no untrusted data is used for key generation. Implement strict Content Security Policy (CSP) headers to reduce the impact of potential XSS attacks. Conduct thorough code audits focusing on SSR implementations and routing configurations to identify any unsafe usage patterns. If upgrading is not immediately feasible, consider disabling SSR in Framework Mode or switching to Declarative or Data Mode routing temporarily to mitigate exposure. Additionally, monitor application logs and network traffic for unusual activity that could indicate attempted exploitation. Educate development teams about secure coding practices related to SSR and input handling in React applications to prevent similar issues.
Affected Countries
United States, Germany, United Kingdom, Canada, Australia, France, Japan, South Korea, India, Brazil
CVE-2026-21884: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in remix-run react-router
Description
React Router is a router for React. In @remix-run/react version prior to 2.17.3. and react-router 7.0.0 through 7.11.0, a XSS vulnerability exists in in React Router's <ScrollRestoration> API in Framework Mode when using the getKey/storageKey props during Server-Side Rendering which could allow arbitrary JavaScript execution during SSR if untrusted content is used to generate the keys. There is no impact if server-side rendering in Framework Mode is disabled, or if Declarative Mode (<BrowserRouter>) or Data Mode (createBrowserRouter/<RouterProvider>) is being used. This issue has been patched in @remix-run/react version 2.17.3 and react-router version 7.12.0.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-21884 is a cross-site scripting (XSS) vulnerability categorized under CWE-79 that affects the React Router library, specifically versions @remix-run/react prior to 2.17.3 and react-router versions 7.0.0 through 7.11.0. The vulnerability arises in the <ScrollRestoration> API when used in Framework Mode with Server-Side Rendering (SSR), particularly when the getKey or storageKey properties are utilized to generate keys. During SSR, if these keys are generated from untrusted or unsanitized input, an attacker can inject malicious JavaScript code that executes on the server side, potentially compromising the application's integrity and leaking sensitive data. This issue is confined to SSR in Framework Mode; applications using Declarative Mode (<BrowserRouter>) or Data Mode (createBrowserRouter/<RouterProvider>) are not affected. The vulnerability does not impact applications that disable SSR in Framework Mode. The flaw allows remote attackers to execute arbitrary scripts without requiring authentication, though user interaction is necessary to trigger the vulnerability. The CVSS v3.1 score of 8.2 reflects a high severity due to the potential confidentiality impact and the ease of exploitation over the network without privileges. No known exploits have been reported in the wild as of the publication date. The issue has been addressed in @remix-run/react version 2.17.3 and react-router version 7.12.0, where proper input neutralization and sanitization have been implemented to prevent malicious script injection during SSR key generation.
Potential Impact
The primary impact of this vulnerability is the potential for arbitrary JavaScript execution during server-side rendering, which can lead to several security risks including theft of sensitive data, session hijacking, and unauthorized actions performed on behalf of users. Since React Router is widely used in modern web applications built with React, many organizations relying on SSR in Framework Mode with vulnerable versions are at risk. Exploitation could compromise the confidentiality and integrity of web applications, potentially allowing attackers to manipulate rendered content or steal user credentials. Although availability is not directly affected, the breach of trust and data exposure can have severe reputational and financial consequences. The vulnerability's network accessibility and lack of required privileges increase the risk profile, especially for public-facing web applications. Organizations that do not use SSR in Framework Mode or use other routing modes are not impacted, reducing the overall attack surface. However, given the popularity of React and React Router in enterprise and consumer web applications, the scope of affected systems is significant worldwide.
Mitigation Recommendations
Organizations should immediately upgrade to @remix-run/react version 2.17.3 or later and react-router version 7.12.0 or later to apply the official patch that addresses this vulnerability. For applications that rely on SSR in Framework Mode, review and sanitize all inputs used in getKey and storageKey props to ensure no untrusted data is used for key generation. Implement strict Content Security Policy (CSP) headers to reduce the impact of potential XSS attacks. Conduct thorough code audits focusing on SSR implementations and routing configurations to identify any unsafe usage patterns. If upgrading is not immediately feasible, consider disabling SSR in Framework Mode or switching to Declarative or Data Mode routing temporarily to mitigate exposure. Additionally, monitor application logs and network traffic for unusual activity that could indicate attempted exploitation. Educate development teams about secure coding practices related to SSR and input handling in React applications to prevent similar issues.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-01-05T17:24:36.928Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6961c40f19784dcf52ace86a
Added to database: 1/10/2026, 3:14:23 AM
Last enriched: 2/27/2026, 8:03:26 AM
Last updated: 3/25/2026, 3:04:05 AM
Views: 159
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.