Malicious Code Detected in babel-plugin-transform-html-template: A Security Alert
Summary
MAL-2025-15296: Malicious code in babel-plugin-transform-html-template (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 babel-plugin-transform-html-template is an npm package designed to transform HTML template literals into JavaScript functions. This package is commonly used in web development to streamline the integration of HTML within JavaScript code. However, recent findings have revealed that this package contains malicious code, posing a significant security risk to applications that utilize it.
Vulnerability Detail
The vulnerability stems from the inclusion of malicious code within the babel-plugin-transform-html-template package. This code can potentially compromise the security of applications using the package, leading to unauthorized access, data breaches, or other malicious activities. The issue was introduced in version 0 and affects all subsequent versions, making it critical for developers to address this vulnerability promptly.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall babel-plugin-transform-html-template
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. Always ensure to review the security status of any package before integrating it into your project.
Conclusion
The discovery of malicious code in the babel-plugin-transform-html-template package highlights the importance of regularly auditing dependencies in software projects. Developers should take immediate action to remove the affected package and consider alternatives to maintain the security of their applications.
See every vulnerability recorded for babel-plugin-transform-html-template →
FAQ
It is an npm package that transforms HTML template literals into JavaScript functions, commonly used in web development.
The malicious code was identified through security audits and reports from security researchers, including Amazon Inspector.
Using this 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 real-time. Visit Vulert Scanner to check your application without any signup.
If immediate removal is not possible, consider using alternative packages and monitor your application closely for any suspicious activity.