Remix and React Router Vulnerability CVE-2025–31137 -$$ BOUNTY
A vulnerability in Remix and React Router with the Express adapter allows an attacker to spoof the URL by inserting a pathname into the port section of the Host or X-Forwarded-Host header. This could lead to unauthorised redirections or access to restricted resources.
infosecwriteups.com
Published on infosecwriteups.com
CVE-2025–31137 is a vulnerability identified in the Remix and React Router frameworks, specifically affecting applications utilizing the Express adapter. This flaw allows attackers to spoof the URL used in incoming requests by inserting a URL pathname into the port section of the Host or X-Forwarded-Host headers.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the Express adapter in Remix and React Router fails to properly validate the Host or X-Forwarded-Host header, allowing a pathname to be injected into the port section.
Impact
This could lead to unauthorised redirections or access to restricted resources.
What the attacker needed
Remix 2.11.1–2.16.2 or React Router 7.0.0–7.4.0; Express adapter in use; Ability to send crafted HTTP requests
The fix
The vulnerability was fixed in Remix version 2.16.3 and React Router version 7.4.1; additionally, strict validation and sanitisation of incoming headers should be implemented.
How it was found
- Craft an HTTP request with a manipulated Host or X-Forwarded-Host header.
- Insert a URL pathname into the port section of the header.
- Send the request to the server.
- Observe if the server processes the request using the spoofed URL.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When a web server receives a request, it uses the Host header to know which site the user wants. This bug lets an attacker put extra text in the port part of that header, so the server thinks the request is for a different path. That can trick the server into redirecting users to malicious sites or exposing restricted pages.