CVE-2025-31137: Remix and React Router URL manipulation via Host headers

CVE-2025-31137 · Severity: low · CVSS 3 · Published 2025-04-01

Remix and React Router are JavaScript frameworks used to build web applications. A vulnerability in their Express adapters allows attackers to spoof the request URL by manipulating Host or X-Forwarded-Host headers, potentially causing application malfunctions or enabling attackers to bypass security checks that rely on correct URL detection. This affects all Remix 2 and React Router 7 applications using the Express adapter.

Vendors: npm.

Quick answers

Is CVE-2025-31137 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2025-31137 being exploited in the wild.
How severe is CVE-2025-31137?
Low severity, with a CVSS score of 3, published 1 April 2025.
Which products and versions are affected?
@react-router/express (npm) SEMVER:introduced=7.0.0,fixed=7.4.1; @remix-run/express (npm) SEMVER:introduced=2.11.1,fixed=2.16.3.
Is there a fix for CVE-2025-31137?
Yes. @react-router/express (npm): upgrade to 7.4.1 or later; @remix-run/express (npm): upgrade to 2.16.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2025-31137 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2025-31137?
Check whether you run @react-router/express (npm) or @remix-run/express (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • @react-router/express (npm): upgrade to 7.4.1 or later
    npm install @react-router/express@7.4.1
  • @remix-run/express (npm): upgrade to 2.16.3 or later
    npm install @remix-run/express@2.16.3

Technical details

This vulnerability is a request header injection / URL manipulation flaw (CWE-444) affecting the Express adapter in both Remix and React Router. The root cause lies in improper parsing of the Host and X-Forwarded-Host headers, which allows an attacker to inject a URL pathname into the port field of these headers. The vulnerability can be exploited remotely over the network without authentication or user interaction. An attacker can spoof the canonical request URL, which may lead to bypass of security controls that depend on URL validation, incorrect routing decisions, or service disruption. The issue has been patched in Remix 2.16.3 and React Router 7.4.1.

Affected products

  • Remix Remix 2.11.1 to 2.16.2
  • React Router React Router 7.0.0 to 7.4.0

Identifiers

  • CVE-2025-31137
  • GHSA-4q56-crqp-v477

Timeline

  • 2025-04-01: disclosed: Vulnerability published via GHSA-4q56-crqp-v477
  • 2025-04-01: patched: Remix 2.16.3 and React Router 7.4.1 released

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.