CVE-2025-31137: Remix and React Router allow URL manipulation via Host / X-Forwarded-Host headers
Impact
We received a report about 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.
Patches
This issue has been patched and released in Remix 2.16.3 React Router 7.4.1.
Credits
- Rachid Allam (zhero;) - Yasser Allam (inzo)
Other sources
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.
— MITRE
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-31137?
CVE-2025-31137 is classified as a moderate severity vulnerability.
How do I fix CVE-2025-31137?
To fix CVE-2025-31137, update to the latest version of Remix or React Router that addresses this vulnerability.
What impact does CVE-2025-31137 have on affected applications?
CVE-2025-31137 allows attackers to spoof URLs, potentially leading to phishing or other forms of attack on users.
Which versions of Remix and React Router are affected by CVE-2025-31137?
CVE-2025-31137 affects all versions of Remix 2 and React Router 7 that use the Express adapter.
Are there any workarounds for CVE-2025-31137?
Implementing strict validation and sanitization of URLs could serve as a workaround, but updating is the recommended action.