Critical Malicious Code Vulnerability in use-unsaved-changes Package
Summary
MAL-2025-190941: Malicious code in use-unsaved-changes (npm). Affects use-unsaved-changes versions 1.0.9. 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 'use-unsaved-changes' package is a utility designed for managing unsaved changes in web applications, particularly within the npm ecosystem. It allows developers to prompt users about unsaved changes before navigating away from a page. However, this package has been compromised, leading to significant security concerns due to embedded malicious code.
Vulnerability Detail
The vulnerability originates from a malicious version of the 'use-unsaved-changes' package, specifically version 1.0.9. This version contains embedded malicious code that can compromise any computer running it. The ramifications include unauthorized access to sensitive data, such as secrets and keys stored on the affected machine. Users are advised to treat any system with this package installed as fully compromised, as the removal of the package may not eliminate all traces of the malicious software.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall use-unsaved-changes
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 effective workarounds to mitigate the risks associated with this vulnerability other than removing the package entirely.
Conclusion
The 'use-unsaved-changes' package has been compromised with malicious code, posing serious security risks. It is essential to uninstall the affected version and monitor your systems for any unauthorized access. Utilizing tools like Vulert can help in identifying and managing such vulnerabilities effectively.
See every vulnerability recorded for use-unsaved-changes →
FAQ
Immediately uninstall the package using 'npm uninstall use-unsaved-changes' and rotate any secrets or keys stored on the affected machine.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without requiring any signup.
Failing to address this vulnerability can lead to unauthorized access to sensitive data and potential full control of your system by malicious actors.
Regularly audit your dependencies and use tools like Vulert to monitor for vulnerabilities in real-time.
If immediate removal is not possible, ensure that sensitive data is secured and consider isolating the affected system from the network until the package can be removed.