Security & Licensing

Is React Router Safe? License, Safety and Download Sources

Is React Router safe: a shield over a package with a verified checksum

Before adding any package to a work project, it is fair to ask: is React Router safe, is it really free, and can I trust where I got it from? The short answer is yes on all three, as long as you install it from a trustworthy source and verify what you download. This article explains the license in plain English, the safe ways to get the package, how to check a file yourself, and the security habits that matter when you write routing code.

Who makes React Router?

React Router has been developed in the open since 2014. It was created by Michael Jackson and Ryan Florence, who later founded Remix Software. Shopify acquired Remix in 2022, and the Remix team at Shopify maintains React Router today. The source code, issue tracker and every change are public, and releases are published to the npm registry under the react-router package name.

That history matters for safety: a long-lived project with a large user base and public code review is far less likely to hide surprises than an unknown package with a similar name.

What the MIT license means for you

React Router is released under the MIT license, one of the most permissive open source licenses. In practice it means:

  • Free to use in personal, open source and commercial projects, including paid products and client work.
  • Free to modify, for example to patch a bug locally while waiting for an official fix.
  • Free to redistribute, which is why a verified copy of the package can be offered for download.
  • One condition: keep the copyright and license notice with copies of the software. Bundlers usually handle this, and the notice is in LICENSE.md inside the package.
  • No warranty: the software is provided "as is". That is standard for open source and is why your own testing matters.

If your company keeps a list of approved licenses, MIT is almost always on it. React Router's own runtime dependencies are also permissively licensed, so it does not pull copyleft code into your bundle.

Safe places to get React Router

  1. Your package manager's registry. npm i react-router (or the pnpm, Yarn and Bun equivalents) downloads from the public npm registry and checks the file's integrity hash automatically. This is the default and the best choice for most people.
  2. Your company's internal mirror. Many organisations proxy npm through a private registry that scans packages before developers can install them.
  3. A verified tarball. For offline machines, a .tgz download is fine as long as you verify it against a published checksum. Our download page lists both the SHA-256 checksum and npm's SHA-512 integrity value for the file.

Watch out for look-alike package names. Typosquatting, publishing a malicious package with a name close to a popular one, is a real attack on npm. Type the name carefully: the package is exactly react-router. Be suspicious of unfamiliar packages that promise to be "react-router but better" or a renamed fork you have never heard of.

How to verify a downloaded package

If you downloaded react-router-8.5.3.tgz, check it before installing:

# macOS / Linux
shasum -a 256 react-router-8.5.3.tgz

# Windows PowerShell
Get-FileHash react-router-8.5.3.tgz -Algorithm SHA256

Compare the output with the SHA-256 on the download page. You can go one step further and compare against npm itself: the registry publishes a SHA-512 "integrity" value for every version. Run npm view react-router@8.5.3 dist.integrity and compare it with:

openssl dgst -sha512 -binary react-router-8.5.3.tgz | base64

The output, prefixed with sha512-, should match exactly. If it does, the file is byte-for-byte the same as the one on npm. You can also list the contents without installing anything with tar -tzf react-router-8.5.3.tgz.

Download React Router 8.5.3

Keeping your dependency tree healthy

  • Commit your lockfile (package-lock.json, pnpm-lock.yaml, yarn.lock or bun.lock). It pins exact versions and their integrity hashes, so every install gets identical files.
  • Use npm ci in CI. It installs exactly what the lockfile says and fails if anything differs.
  • Run npm audit regularly, or turn on automated dependency alerts in your Git host, to hear about known vulnerabilities.
  • Take patch releases promptly. They are bug and security fixes with no breaking changes. See React Router versions and updates for a safe update routine.

Supply chain checks for teams

Larger teams usually add a few guardrails on top of the basics:

  • Review dependency changes in pull requests. A new package or a jump of several major versions in the lockfile diff deserves a second look.
  • Check provenance where available. Recent npm versions can show whether a package was built and published from a public CI workflow. Run npm audit signatures to verify registry signatures for everything installed.
  • Keep the dependency count low. React Router 8 has only two runtime dependencies, which keeps its attack surface small. Apply the same thinking to the rest of your stack.

Security habits for routing code

A safe package can still be used unsafely. These are the mistakes that matter most with any router:

Client-side guards are not security

Redirecting guests away from /admin in the browser hides the page, but anyone can still call your API directly. Always check permissions on the server: in your API, or in Framework Mode loaders, actions and middleware, which run on the server.

Treat URL params as user input

Anything from useParams or useSearchParams comes from the address bar, which the user controls. Validate it before using it in database queries or API calls, and never build HTML from it with dangerouslySetInnerHTML.

Be careful with redirect targets

A login page that redirects to ?next=... from the URL can be abused to send users to a malicious site (an "open redirect"). Only allow relative paths that start with a single /.

Server functions are public endpoints

If you use React Server Components in Framework Mode, treat every server function as a public endpoint that performs its own access checks, as the React Router docs themselves recommend.

Verdict

React Router is safe to use and free for commercial work under the MIT license. Get it from your package manager or a checksum-verified download, keep your lockfile committed, update regularly, and enforce permissions on the server. Ready to install? Follow How to Download and Install React Router (Step by Step). Hit a snag? See common errors and fixes.

Get React Router 8.5.3: one npm command, or the verified package download.

Download

Tivari

Professional content writer

Tivari is a professional content writer who covers web development tools, with a focus on turning technical documentation into clear, step-by-step articles. Every command and code sample in Tivari's articles is run against the current React Router release before publishing. About the writer and how we test.

Related articles