Malicious Code Vulnerability in ts-imports Package
Summary
MAL-2025-47355: Malicious code in ts-imports (npm). Affects ts-imports versions >= 1.0.1, <= 1.0.2. 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 ts-imports package is an npm library designed to facilitate TypeScript imports in JavaScript projects. It aims to streamline the import process, making it easier for developers to manage dependencies. However, this package has been compromised, leading to the introduction of malicious code that poses significant security risks to users.
Vulnerability Detail
The vulnerability stems from the compromise of the ts-imports package, where malicious code was embedded within versions 1.0.1 and 1.0.2. This malicious payload is known to steal tokens and credentials, publishing them to GitHub and potentially propagating itself to other npm packages owned by the user. The implications of this vulnerability are severe, as any system running this package could be fully compromised, leading to unauthorized access to sensitive information.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall ts-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
As a temporary measure, you can avoid using the ts-imports package altogether until a secure version is confirmed. Additionally, ensure that all secrets and keys stored on affected systems are rotated immediately, as the compromise may have exposed them.
Conclusion
The ts-imports package has been compromised, leading to a significant security vulnerability that affects versions 1.0.1 and 1.0.2. Users are advised to uninstall these versions and update to a secure version immediately. Utilizing tools like Vulert can help in monitoring and preventing future vulnerabilities.
See every vulnerability recorded for ts-imports →
FAQ
Versions 1.0.1 and 1.0.2 of the ts-imports package are affected by the malicious code vulnerability.
You should uninstall the affected versions of the ts-imports package and install a secure version immediately.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application by visiting the Vulert playground at Vulert Scanner without any signup.
The risks include unauthorized access to sensitive information, such as tokens and credentials, which can lead to further exploitation of your systems.
Regularly monitor your dependencies for vulnerabilities using tools like Vulert, and ensure to keep your packages updated to the latest secure versions.