CVE-2025-31137 Remix and React Router allow URL manipulation via Host / X-Forwarded-Host headers

High 7.5 Published Updated

Attackers can spoof request URLs via Host headers in Remix/React Router apps, potentially bypassing security controls or causing redirects.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-31137?

CVE-2025-31137 is a high-severity vulnerability in remix-run react-router, published on 1 Apr 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

React Router is a multi-strategy router for React bridging the gap from React 18 to React 19. There is a vulnerability in Remix/React Router that affects all Remix 2 and React Router 7 consumers using the Express adapter. Basically, this vulnerability allows anyone to spoof the URL used in an incoming Request by putting a URL pathname in the port section of a URL that is part of a Host or X-Forwarded-Host header sent to a Remix/React Router request handler. This issue has been patched and released in Remix 2.16.3 and React Router 7.4.1.

Weakness: CWE-444

Which versions are affected by CVE-2025-31137?

4 open source packages ship an affected version, including @react-router/express and @remix-run/express.

PackageAffectedFixed in
@react-router/express npmFrom 7.0.07.4.1
@react-router/express npmFrom 7.0.07.4.1
@remix-run/express npmFrom 2.11.12.16.3
@remix-run/express npmFrom 2.11.12.16.3

How do I fix CVE-2025-31137?

Upgrade @react-router/express to 7.4.1 or later.

Is CVE-2025-31137 being exploited?

There is no known exploitation of CVE-2025-31137 in the wild and no public exploit code.

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as GHSA-4q56-crqp-v477.

Is CVE-2025-31137 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free