/

CVE-2025-59057

Severity:

HIGH RISK

(7.6)

Cross-Site Scripting (CWE-79) in React Router Packages

CVE-2025-59057

Modified

Vulnerability type

Category:

Cross-Site Scripting

CWE:

CWE-79

Impact:

Client-Side Code Execution and Session Compromise

Severity:

HIGH RISK

(7.6)

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

React Router contains a cross-site scripting vulnerability affecting specified releases of @remix-run/react and react-router. Under conditions where attacker-controlled data is rendered without adequate contextual escaping, an attacker may execute script in a user's browser and act within that application's security context.

Affected context

The vulnerability occurs in React Router-based applications using affected package releases when untrusted or attacker-controlled values can reach a vulnerable rendering path. Risk depends on how application routes, loaders, navigation state, and rendered content handle external input, as well as the privileges available to users who view the affected content.

Exploit preconditions

  • Attack surface: A web application using an affected @remix-run/react or react-router release
  • Required access: Ability to cause attacker-controlled data or navigation state to be processed by the application; this may be indirect in publicly accessible applications
  • Trigger point: Rendering or handling of affected route-related content in a user's browser
  • Why exploitation is possible: Input reaches a browser-rendered context without sufficient contextual escaping or sanitization

Why this happens

The underlying bug is improper neutralization of untrusted input in a web page or browser-rendered response. This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting, where application data is interpreted as executable markup or script rather than inert content.

Potential impact

  • An attacker may execute JavaScript in a victim's browser session
  • Session data or sensitive page content could be exposed
  • Account actions could be performed with the victim's privileges
  • Application content or user-facing state could be modified
  • Phishing or redirection within the trusted application origin could occur

General mitigation guidance

Mitigation generally focuses on ensuring that untrusted values remain data throughout routing and rendering workflows.

Common defensive patterns include:

  • Applying context-appropriate output encoding at rendering boundaries
  • Using framework-safe rendering APIs instead of raw HTML insertion
  • Sanitizing intentionally supported HTML with a narrowly configured sanitizer
  • Reducing trust in route parameters, navigation state, loader data, and other external inputs
  • Enforcing Content Security Policy as a defense-in-depth control
  • Limiting session and application privileges available to rendered pages
  • Maintaining dependency governance that identifies affected package ranges and evaluates supported remediation

How teams detect issues like this

Organizations commonly detect related risks through:

  • Static analysis for raw HTML insertion, unsafe DOM sinks, and untrusted data reaching rendering APIs
  • Code review checks for route parameters, loader data, and navigation state used in markup
  • Dependency policy checks that flag affected React Router package ranges
  • Dynamic testing with benign, non-destructive XSS markers across route and rendering inputs
  • Content Security Policy reporting and browser telemetry for unexpected script activity

Automated code review and software composition analysis tools can help identify these patterns early.

Sources

SourceLink
github.comgithub.com/remix-run/react-router/security/advisories/GHSA-3cgp-3xvw-98x8
access.redhat.comaccess.redhat.com/errata/RHSA-2026:19712
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:3960
access.redhat.comaccess.redhat.com/security/cve/CVE-2025-59057
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2428426
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-59057.json

Frequently asked

questions

It may be exploitable through a web application's normal request or navigation flows when attacker-controlled data reaches the affected rendering behavior. The exact scope depends on application configuration and data flow.

Not necessarily. Public routes may be reachable without authentication, while other applications may require access to submit or influence the relevant input.

Use a supported remediation for the affected dependency range and ensure that untrusted values are contextually encoded or safely sanitized before rendering.

Combine dependency monitoring with secure rendering APIs, strict input trust boundaries, static analysis, security-focused code review, and a restrictive Content Security Policy.

Find out what's already
exploitable in your codebase.