Skip to main content
Post

Security Update: Multiple vulnerabilities in React Router

Netlify published a security advisory covering seven React Router vulnerabilities. If your site uses React Router 7 or 8, update it and deploy again. If it doesn't use React Router, you don't need to do anything.

To check, install your dependencies in the folder of the site you deploy. In a monorepo, that's the site's folder, not the repo root. Then list the installed React Router packages (npm ls, pnpm why, or yarn why). This also catches copies that a framework brings in, like Remix 2 (which uses React Router 6) or Shopify Hydrogen (which uses React Router 7). Netlify says the check only sees your project folder, not what's deployed. If an AI tool built your site, you can ask it whether the project uses React Router and which version.

The patched versions are:

  • react-router 7.18.5 or later for 7.x, and 8.5.1 or later for 8.x
  • @react-router/node and @react-router/serve 7.18.6 or later for 7.x
  • @react-router/node, @react-router/serve and @react-router/dev 8.5.1 or later for 8.x

Run your package manager's update command, list the versions again, and install a patched version directly if a copy is still affected. If the old copy is nested under another package, update that package instead. Commit package.json and your lockfile, then deploy.

React Router 6 and Remix 2 have no patched 6.x release for two of the issues, the route-matching DoS and the open redirect, so npm update can't fix them. You'll need to move to React Router 7 or 8.

Netlify says most of these have limited impact on its platform. The two denial-of-service issues mostly risk higher function costs if someone exploits them, since a crashed function doesn't affect other requests. The prototype pollution issue only matters on the server if the build-only IS_RR_BUILD_REQUEST variable is set in your environment, and it should never be. If you find it on your site or as a shared team variable, remove it and publish a new deploy.

Older deploys keep running the code they were built with. Public deploy previews and older production deploys can stay vulnerable until they're automatically deleted, and branch deploys can stay vulnerable indefinitely. Netlify never auto-deletes the latest successful deploy of each branch. If you've locked auto publishing, publish the patched deploy manually, and delete vulnerable deploys by hand.

Loading replies