Critical Malicious Code Vulnerability in restrict-imports Package
Summary
MAL-2026-1353: Malicious code in restrict-imports (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 restrict-imports package is an npm module designed to help developers manage and restrict import statements in their JavaScript projects. It aims to enforce coding standards and improve code maintainability by limiting the use of certain imports. However, this package has been found to contain malicious code that compromises the security of any system it is installed on.
Vulnerability Detail
The vulnerability originates from the inclusion of malicious code within the restrict-imports package. This code can fully compromise any computer that has the package installed, allowing unauthorized access to sensitive information such as secrets and keys. The ramifications of this vulnerability are severe, as it can lead to data breaches and unauthorized control over the affected systems. The malicious code is embedded in the package, making it difficult to detect and remove completely.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall restrict-imports
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
There are no effective workarounds for this vulnerability other than removing the package entirely. It is essential to ensure that your project does not rely on restrict-imports for its functionality.
Conclusion
The restrict-imports package has been identified as containing malicious code that poses a significant security risk. Immediate action is required to remove the package and secure any compromised systems. Regular monitoring and auditing of dependencies are essential to prevent future vulnerabilities.
See every vulnerability recorded for restrict-imports →
FAQ
Immediately uninstall the restrict-imports package using 'npm uninstall restrict-imports' and rotate any secrets or keys stored on the affected machine.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without needing to sign up.
Regularly audit your dependencies and use tools like Vulert to monitor for vulnerabilities in real-time. Keeping your packages updated and using trusted sources can also help mitigate risks.
Failure to address this vulnerability can lead to unauthorized access to sensitive data, potential data breaches, and loss of control over your systems.
It is advisable to find an alternative package that provides similar functionality without the associated risks. Avoid using restrict-imports until a secure version is released.