Critical Malicious Code Vulnerability in @asyncapi/generator-components Package
Summary
MAL-2025-190656: Malicious code in @asyncapi/generator-components (npm). Affects @asyncapi/generator-components versions 0.3.2 – 0.3.3. 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 @asyncapi/generator-components package is a library used in the development of AsyncAPI specifications, enabling developers to generate documentation and code from AsyncAPI definitions. It is widely utilized in the Node.js ecosystem for creating APIs. However, recent findings have revealed that certain versions of this package contain malicious code that compromises the security of any system where it is installed.
Vulnerability Detail
The vulnerability originates from the package being compromised with embedded malicious code, which can lead to full control of the affected computer by an external entity. This poses significant risks, including unauthorized access to sensitive information, such as secrets and keys stored on the system. The malicious nature of the code is classified under CWE-506, indicating that it contains code that appears to be harmful.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall @asyncapi/generator-components
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 and rotating any sensitive information that may have been compromised.
Conclusion
The discovery of malicious code in the @asyncapi/generator-components package poses a serious threat to users. Immediate action is required to mitigate risks by uninstalling the affected versions and securing sensitive information. Utilizing tools like Vulert can help monitor for such vulnerabilities in the future.
See every vulnerability recorded for @asyncapi/generator-components →
FAQ
Versions 0.3.2 and 0.3.3 of the @asyncapi/generator-components package are known to contain malicious code.
You should immediately uninstall the package and rotate any sensitive information stored on your system.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check your application without needing to sign up.
The risks include unauthorized access to sensitive data, potential data breaches, and complete control of the affected system by malicious actors.
No patch is available for the affected versions. The only solution is to uninstall the package.