/

CVE-2026-22029

Severity:

HIGH RISK

(8.0)

XSS in React Router & Remix SPA Navigation

CVE-2026-22029

Modified

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Client-Side Code Execution via XSS

Severity:

HIGH RISK

(8.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Certain SPA navigation flows in React Router and Remix can turn unsafe redirect URLs into executable JavaScript on the client, enabling cross-site scripting (XSS).

The issue arises when redirect URLs in Framework/Data/RSC modes are derived from untrusted input or open redirects, allowing attackers to inject script-capable URLs that the router follows in the browser context.

Affected context

This vulnerability appears in applications using:

  • @remix-run/router prior to 1.23.2
  • react-router versions 7.0.0 through 7.11.0
  • Remix v1/v2 when using Framework Mode, Data Mode, or unstable RSC modes

It affects scenarios where redirect destinations are:

  • Built from untrusted content (e.g., query params, request data, external inputs)
  • Influenced by open redirects or unvalidated external URLs

Applications using Declarative Mode (<BrowserRouter>) exclusively are not impacted by this specific issue.

Exploit preconditions

  • Attack surface: Browser-based navigation within React/Remix SPAs.
  • Required access: Ability to influence redirect targets, typically via:
  • User-controlled input (query parameters, form fields, headers, or body data)
  • External links or open redirect endpoints feeding into router redirects.
  • Trigger point: A loader or action in Framework Mode, Data Mode, or unstable RSC mode issues a redirect using a URL that contains attacker-controlled content.
  • Why exploitation is possible: The router trusts the computed redirect path and forwards the browser to that location without sufficiently validating or constraining the URL scheme/domain, allowing script-capable or XSS-bearing URLs to execute in the client context.

Why this happens

The root cause is insufficient validation and normalization of redirect URLs before they are used for client-side navigation, combined with the powerful control that loaders and actions have over SPA routing.

In the vulnerable modes, redirect paths can be constructed from untrusted values without enforcing strict constraints such as:

  • limiting to same-origin, application-internal paths
  • disallowing dangerous URL schemes
  • sanitizing or rejecting malformed URLs

This maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting), because untrusted input flows into a navigation mechanism that ultimately leads the browser to execute attacker-influenced JavaScript or markup as part of the client experience.

Potential impact

  • Execution of arbitrary JavaScript in the victim's browser.
  • Theft of session tokens, API tokens, or other credentials accessible to the SPA.
  • Account takeover through malicious actions performed on behalf of the user.
  • Unauthorized access to or modification of data exposed through the SPA's APIs.
  • Phishing flows and UI redressing using attacker-controlled pages opened from trusted origins.
  • Lateral movement to other application areas through authenticated client-side actions.

General mitigation guidance

Effective mitigation relies on controlling how redirect URLs are constructed and where they are allowed to point:

  • Prefer strictly internal navigation: restrict redirects from loaders/actions to relative, application-local paths instead of arbitrary URLs.
  • Apply allowlist-based validation on any redirect target built from user input, limiting to known-good paths or identifiers rather than raw URLs.
  • Normalize and validate URL components (path, query, fragment) independently instead of concatenating raw strings.
  • Avoid passing opaque, user-supplied URLs directly to router redirect APIs; instead, map user choices to predefined routes or route IDs.
  • Enforce origin and scheme checks so that navigation stays within HTTPS and trusted domains only.
  • Design redirect logic so that redirects are not dependent on untrusted content where possible; prefer stable, server-controlled routing decisions.

These patterns reduce the chance that untrusted data will control client-side navigation in a way that can lead to XSS.

How teams detect issues like this

Detection involves tracing how redirect URLs are constructed and consumed:

  • Static analysis / code scanning:
  • Flag usage of router redirect APIs where arguments are derived from request data, query strings, or other untrusted sources.
  • Detect string concatenation or template literals that build URLs using unvalidated user input.
  • Identify places where full URLs (with schemes and domains) are allowed, rather than restricted route paths.
  • Code review signals:
  • Redirect logic in loaders or actions that references request.url, searchParams, location, or user-provided fields without validation.
  • Conditional navigation that trusts parameters like redirectTo, returnUrl, or next without checking origin or route membership.
  • Custom wrappers around React Router / Remix redirect helpers that do not enforce origin or scheme constraints.
  • Policy enforcement:
  • Introduce project-wide guidelines that all redirect targets must be:
  • relative paths, or
  • enumerated route names/IDs mapped on the server side.
  • Integrate automated review tools or linters to enforce these rules in CI.

Combining targeted static checks with focused code review on routing and redirect flows helps surface similar issues early.

Sources

SourceLink
github.comgithub.com/remix-run/react-router/security/advisories/GHSA-2w69-qvjg-hvjx
access.redhat.comaccess.redhat.com/errata/RHSA-2026:13542
access.redhat.comaccess.redhat.com/errata/RHSA-2026:13548
access.redhat.comaccess.redhat.com/errata/RHSA-2026:1517
access.redhat.comaccess.redhat.com/errata/RHSA-2026:17468
access.redhat.comaccess.redhat.com/errata/RHSA-2026:17469
access.redhat.comaccess.redhat.com/errata/RHSA-2026:17474
access.redhat.comaccess.redhat.com/errata/RHSA-2026:19712
access.redhat.comaccess.redhat.com/errata/RHSA-2026:20041
access.redhat.comaccess.redhat.com/errata/RHSA-2026:20042
access.redhat.comaccess.redhat.com/errata/RHSA-2026:2147
access.redhat.comaccess.redhat.com/errata/RHSA-2026:2148
access.redhat.comaccess.redhat.com/errata/RHSA-2026:2149
access.redhat.comaccess.redhat.com/errata/RHSA-2026:21658
access.redhat.comaccess.redhat.com/errata/RHSA-2026:2350
access.redhat.comaccess.redhat.com/errata/RHSA-2026:2456
access.redhat.comaccess.redhat.com/errata/RHSA-2026:2568
access.redhat.comaccess.redhat.com/errata/RHSA-2026:2572
access.redhat.comaccess.redhat.com/errata/RHSA-2026:26413
access.redhat.comaccess.redhat.com/errata/RHSA-2026:26420
access.redhat.comaccess.redhat.com/errata/RHSA-2026:2694
access.redhat.comaccess.redhat.com/errata/RHSA-2026:3087
access.redhat.comaccess.redhat.com/errata/RHSA-2026:34100
access.redhat.comaccess.redhat.com/errata/RHSA-2026:36651
access.redhat.comaccess.redhat.com/errata/RHSA-2026:36882
access.redhat.comaccess.redhat.com/errata/RHSA-2026:3782
access.redhat.comaccess.redhat.com/errata/RHSA-2026:3958
access.redhat.comaccess.redhat.com/errata/RHSA-2026:3959
access.redhat.comaccess.redhat.com/errata/RHSA-2026:3960
access.redhat.comaccess.redhat.com/errata/RHSA-2026:40118
access.redhat.comaccess.redhat.com/errata/RHSA-2026:40945
access.redhat.comaccess.redhat.com/errata/RHSA-2026:40984
access.redhat.comaccess.redhat.com/errata/RHSA-2026:41064
access.redhat.comaccess.redhat.com/errata/RHSA-2026:41928
access.redhat.comaccess.redhat.com/errata/RHSA-2026:5633
access.redhat.comaccess.redhat.com/errata/RHSA-2026:5636
access.redhat.comaccess.redhat.com/errata/RHSA-2026:8218
access.redhat.comaccess.redhat.com/errata/RHSA-2026:8229
access.redhat.comaccess.redhat.com/errata/RHSA-2026:9848
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-22029
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2428412
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-22029.json

Frequently asked

questions

Exploitability depends on whether your application constructs redirect URLs from untrusted data or uses open redirects that feed into router navigation. If all redirect targets are hard-coded, validated internal routes, the practical risk is significantly reduced even on vulnerable versions.

An attacker typically needs the ability to influence the redirect destination through user-controllable inputs such as query parameters, form fields, or other data that your loaders/actions read. In some cases, control over an upstream open redirect endpoint is enough if its output is used by the router without validation.

The safest pattern is to constrain all redirect operations to a controlled set of internal routes. Accept only route identifiers or known-safe path fragments, apply strict validation, and resolve them to canonical internal URLs rather than accepting arbitrary URLs from user input.

Establish routing and redirect design guidelines: treat all user-influenced URLs as untrusted, use allowlists for redirect destinations, enforce same-origin navigation, and integrate static checks for redirect APIs that accept dynamic input. Regular security reviews of navigation and authentication flows help catch new instances early.

Find out what's already
exploitable in your codebase.