Skip to content

GHSA-f46r-rw29-r322 CVE-2025-43864

React Router allows a DoS via cache poisoning by forcing SPA mode

High npm
Severity
7.5 / 10
High · CVSS 3.1
Exploit chance (EPSS)
20.47%
Chance of exploitation in the next 30 days. Higher than 97.51% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-755 Improper Handling of Exceptional Conditions
Fix
7.5.2
Upgrade react-router to this version or later

Description

Summary

After some research, it turns out that it is possible to force an application to switch to SPA mode by adding a header to the request. If the application uses SSR and is forced to switch to SPA, this causes an error that completely corrupts the page. If a cache system is in place, this allows the response containing the error to be cached, resulting in a cache poisoning that strongly impacts the availability of the application.

Details

The vulnerable header is X-React-Router-SPA-Mode; adding it to a request sent to a page/endpoint using a loader throws an error. Here is the vulnerable code :

<img width="672" alt="Capture d’écran 2025-04-07 à 08 28 20" src="https://github.com/user-attachments/assets/0a0e9c41-70fd-4dba-9061-892dd6797291" />

To use the header, React-router must be used in Framework mode, and for the attack to be possible the target page must use a loader.

Steps to reproduce

Versions used for our PoC:

  • "@react-router/node": "^7.5.0",
  • "@react-router/serve": "^7.5.0",
  • "react": "^19.0.0"
  • "react-dom": "^19.0.0"
  • "react-router": "^7.5.0"
  1. Install React-Router with its default configuration in Framework mode (https://reactrouter.com/start/framework/installation)
  2. Add a simple page using a loader (example: routes/ssr)

image

  1. Send a request to the endpoint using the loader (/ssr in our case) adding the following header:
X-React-Router-SPA-Mode: yes

Notice the difference between a request with and without the header;

Normal request Capture d’écran 2025-04-07 à 08 36 27

With the header Capture d’écran 2025-04-07 à 08 37 01 image

Impact

If a system cache is in place, it is possible to poison the response by completely altering its content (by an error message), strongly impacting its availability, making the latter impractical via a cache-poisoning attack.

Credits

  • Rachid Allam (zhero;)
  • Yasser Allam (inzo_)

Affected versions

npm

PackageVulnerableFixed in
react-router
>= 7.2.0, < 7.5.2
7.5.2

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.5.2

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

Severity breakdown

CVSS 3.1 7.5

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

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Weakness

CWE-755: Improper Handling of Exceptional Conditions

The product does not handle or incorrectly handles an exceptional condition.

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-337j-9hxr-rhxg
React Router: Arbitrary Constructor Injection via deserializeErrors() in React Router SSR Hydration
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
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