Critical Malicious Code Vulnerability in react-router-scroll-navar Package
Summary
MAL-2025-5723: Malicious code in react-router-scroll-navar (npm). Affected versions are not published. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The react-router-scroll-navar package is an npm library designed to manage scroll behavior in React applications when navigating between routes. It provides developers with a way to maintain scroll position, enhancing user experience. However, this package has been identified to contain embedded malicious code, posing significant security risks to any application that utilizes it.
Vulnerability Detail
The vulnerability stems from the presence of embedded malicious code within the react-router-scroll-navar package. This code can compromise any computer that has the package installed, allowing unauthorized access to sensitive information such as secrets and keys. The malicious nature of this code is classified under CWE-506, indicating that it appears to be intentionally harmful. The ramifications of this vulnerability are severe, as it can lead to complete system compromise, making it imperative for users to take immediate action.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall react-router-scroll-navar
If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
Currently, there are no specific workarounds to mitigate the risks posed by this vulnerability other than removing the package entirely. Ensure that all secrets and keys stored on the compromised computer are rotated immediately from a secure device.
Conclusion
The react-router-scroll-navar package has been identified as containing malicious code that poses a significant security threat. Users are urged to remove the package immediately and take necessary precautions to secure their systems. Regular monitoring for vulnerabilities using tools like Vulert can help prevent future risks.
See every vulnerability recorded for react-router-scroll-navar →
FAQ
It is an npm library that helps manage scroll behavior in React applications during route navigation.
The vulnerability involves embedded malicious code that can compromise the security of systems using the package.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check your application without needing to sign up.
You should immediately remove the react-router-scroll-navar package and rotate any sensitive information stored on the affected system.
As of now, there is no patched version available. The only solution is to remove the package.