CVE-2025-31137
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedReact 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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceA URL spoofing vulnerability in the Express adapter of React Router (affecting Remix 2 and React Router 7) allows attackers to manipulate the apparent request URL by placing a URL pathname in the port section of Host or X-Forwarded-Host headers, potentially enabling path-based access control bypass.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify the React Router or Remix package in useInspect your project's package.json dependencies to confirm whether react-router, react-router-dom, or @remix-run/* packages are installedAffected if Either react-router version 7.x or @remix-run/* packages version 2.x are present in dependencies
-
Confirm Express adapter is being usedCheck your server configuration for the Express adapter - typically in server.js, server.ts, or similar Express server setup files that import from @remix-run/express or use express() as the server handlerAffected if The application uses @remix-run/express adapter or configures React Router with an Express server backend
-
Check installed version against vulnerable rangesRun 'npm list react-router' or 'npm list @remix-run/react' to retrieve the exact installed version, then compare to the fixed versions: React Router 7.4.1 and Remix 2.16.3Affected if Installed version is lower than 7.4.1 for React Router or lower than 2.16.3 for Remix 2
-
Verify Express host header handlingReview your Express server configuration to confirm that Host and X-Forwarded-Host headers are processed without sanitization - the vulnerability exists when these headers are used directly without stripping pathname components from the port fieldAffected if The Express server uses Host or X-Forwarded-Host headers directly for routing or path validation without validation that prevents pathname injection in the port section
You are affected if your application uses the Express adapter with React Router 7 versions before 7.4.1 or Remix 2 versions before 2.16.3, where Host header values can be manipulated to include pathname-like content in the port section.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scopedUpgrade to Remix 2.16.3 or React Router 7.4.1 or later to apply the patch that properly sanitizes Host header parsing in the Express adapter.
Remix 2.16.3 or React Router 7.4.1 (depending on which framework you use)
- 1. Identify if your project uses Remix 2 or React Router 7 with the Express adapter
- 2. For Remix 2 users: Run `npm install @remix-run/[email protected]` or `npm install [email protected]` to update to the patched version
- 3. For React Router 7 users: Run `npm install [email protected]` or update your React Router 7 package to version 7.4.1
- 4. After updating, restart your Express server to apply the changes
- 5. Verify the fix by testing that malformed Host headers with paths in the port section are properly rejected
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation1.0 h
- Implementation1.0 h
- Testing2.0 h
- Review / QA1.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,376.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2025-31137 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2025-31137 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data