Malicious Code Detected in cfn2ts Package - Security Alert
Summary
MAL-2025-16739: Malicious code in cfn2ts (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 cfn2ts package is an npm library designed to facilitate the conversion of AWS CloudFormation templates into TypeScript interfaces. It is widely used by developers to streamline the integration of AWS services into TypeScript applications. However, recent findings have revealed that this package contains malicious code, posing significant security risks to users and their applications.
Vulnerability Detail
The vulnerability stems from the presence of malicious code within the cfn2ts package. This code can potentially compromise the security of applications that utilize the package, leading to unauthorized access, data breaches, or other malicious activities. The issue was identified in all versions starting from 0, indicating that any installation of this package is at risk. Users should be aware that the malicious code may execute upon installation or during runtime, making it imperative to address this vulnerability promptly.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall cfn2ts
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 workaround, consider using alternative packages that provide similar functionality without the associated risks. Additionally, you can monitor your application for any suspicious activity while transitioning away from the cfn2ts package.
Conclusion
The discovery of malicious code in the cfn2ts package poses a serious threat to users and their applications. It is crucial to take immediate action by removing the package and monitoring for any potential security breaches. Stay informed about updates and consider using alternative solutions to mitigate risks.
See every vulnerability recorded for cfn2ts →
FAQ
cfn2ts is an npm library that converts AWS CloudFormation templates into TypeScript interfaces, helping developers integrate AWS services into TypeScript applications.
The malicious code was identified by security researchers from Amazon Inspector, who reported the findings to the community.
Using the cfn2ts package can lead to unauthorized access, data breaches, and other malicious activities due to the embedded malicious code.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check your application without any signup.
Immediately remove the cfn2ts package from your project and consider using alternative packages. Monitor your application for any suspicious activity.