Critical Malicious Code Vulnerability in web-types-htmx Package
Summary
MAL-2025-191153: Malicious code in web-types-htmx (npm). Affects web-types-htmx versions 0.1.1. 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 web-types-htmx package is an npm library designed to enhance web applications by providing type definitions for HTMX. It allows developers to leverage HTMX's capabilities more effectively within their projects. However, the package has been identified to contain malicious code, posing significant risks to any system where it is installed.
Vulnerability Detail
The vulnerability stems from the presence of embedded malicious code within the web-types-htmx package, specifically version 0.1.1. This code can compromise the entire system, allowing unauthorized access to sensitive information such as secrets and keys. The origin of this vulnerability is linked to the package being flagged by the ghsa-malware source, indicating that any system running this package should be considered fully compromised. The ramifications include potential data breaches and loss of control over the affected systems.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall web-types-htmx
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 posed by this vulnerability other than removing the package entirely.
Conclusion
The web-types-htmx package has been identified as containing malicious code, posing significant risks to any system where it is installed. Immediate action is required to uninstall the package and secure any sensitive information. Utilizing tools like Vulert can help monitor for such vulnerabilities in the future.
See every vulnerability recorded for web-types-htmx →
FAQ
web-types-htmx is an npm library that provides type definitions for HTMX, enhancing the development experience for web applications.
If you have the web-types-htmx package installed, your system is at risk. You can use Vulert to monitor and check for vulnerabilities in your application.
Immediately rotate all secrets and keys stored on the compromised system from a secure computer to prevent unauthorized access.
No, there is currently no patched version of the web-types-htmx package available. The only solution is to uninstall it.
Vulert monitors and alerts you in real-time for open-source vulnerabilities using just the package-lock.json file, ensuring your applications remain secure.