Skip to content

GHSA-337j-9hxr-rhxg CVE-2026-53666

React Router: Arbitrary Constructor Injection via deserializeErrors() in React Router SSR Hydration

Medium npm
Severity
6.1 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.42%
Chance of exploitation in the next 30 days. Higher than 36.40% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-470 Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
Fix
7.18.0
Upgrade react-router to this version or later

Description

If application code allows attacker supplied input to overwrite certain aspects of errors caught by the SSR process, then it was possible for attacker to trigger unexpected constructor execution on the client which would trigger outbound network traffic. This is only possible with very specific (and unlikely) application layer code.

[!NOTE] This does not impact your application if you are using Declarative Mode. This only impacts Framework Mode and Data Mode applications doing manual SSR/hydration

Affected versions

npm

PackageVulnerableFixed in
react-router
>= 6.4.0, < 7.18.0
7.18.0
react-router
>= 6.4.0, < 7.18.0
7.18.0

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

react-router npm → 7.18.0

npm
npm install react-router@7.18.0
yarn
yarn add react-router@7.18.0
pnpm
pnpm add react-router@7.18.0

Severity breakdown

CVSS 3.1 6.1

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

Weakness

CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')

The product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code.

How to prevent it
  • Architecture and Design: Refactor your code to avoid using reflection.
  • Architecture and Design: Do not use user-controlled inputs to select and load classes or code.
  • Implementation: Apply strict input validation by using allowlists or indirect selection to ensure that the user is only selecting allowable classes or code.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-qwww-vcr4-c8h2
React Router: RSC Mode CSRF Bypass Allows Action Execution Before 400 Response
High Also affects react-router
GHSA-chx6-hx7r-mcp5
React Router: Unauthenticated Denial of Service via Inefficient Route Matching
High Also affects react-router
GHSA-wrjc-x8rr-h8h6
React Router: Open redirect via backslash in <Link> and useNavigate (CVE-2025-68470 bypass)
Medium Also affects react-router
GHSA-jjmj-jmhj-qwj2
React Router: Open redirect leading to XSS
Medium Also affects react-router
GHSA-h8fp-f39c-q6mh
React Router: RSCErrorHandler Missing Protocol Validation (XSS)
Medium Also affects react-router
GHSA-84g9-w2xq-vcv6
React Router: Potential CSRF via PUT/PATCH/DELETE document requests
Low Also affects react-router
GHSA-8x6r-g9mw-2r78
React Router vulnerable to DoS via unbounded path expansion in __manifest endpoint
High Also affects react-router
GHSA-49rj-9fvp-4h2h
React Router's vendored turbo-stream v2 allows arbitrary constructor invocation via TYPE_ERROR deserialization leading to Unauth RCE
High Also affects react-router

Credits: yoyomiski

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor