Critical Malicious Code Vulnerability in @hrmony/cdk-constructs Package
Summary
MAL-2026-17258: Malicious code in @hrmony/cdk-constructs (npm). Affects @hrmony/cdk-constructs versions 5.3.5. 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 @hrmony/cdk-constructs package is an npm library designed for AWS Cloud Development Kit (CDK) constructs. It aims to provide developers with reusable components to streamline the development of cloud applications. However, this package has been found to contain malicious code that compromises the security of systems using it.
Vulnerability Detail
The vulnerability originates from the package's index.js file, which executes top-level asynchronous code upon import. This code harvests sensitive AWS EC2 instance metadata, including IAM role security credentials, and serializes the entire process environment. It also recursively reads files from the /var/run/secrets/ directory, which may contain Kubernetes service account tokens and other secrets. The harvested data is then sent to a hardcoded external endpoint, effectively compromising the security of any system using this package.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall @hrmony/cdk-constructs
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, you can restrict access to sensitive metadata and secrets on your system. However, the best course of action is to remove the package entirely and replace it with a trusted alternative.
Conclusion
The @hrmony/cdk-constructs package contains a critical vulnerability that exposes sensitive data and compromises system security. Immediate action is required to remove the package and secure any affected systems. Utilizing tools like Vulert can help monitor for such vulnerabilities in the future.
See every vulnerability recorded for @hrmony/cdk-constructs →
FAQ
You should immediately remove the package from your project and rotate any secrets or keys that may have been compromised.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check your application without requiring any signup.
Failing to address this vulnerability could lead to unauthorized access to your AWS resources and sensitive data, potentially resulting in data breaches and significant security incidents.
Regularly audit your dependencies, use tools like Vulert for real-time monitoring, and only install packages from trusted sources to minimize the risk of similar vulnerabilities.
Caution is advised with any packages under the @hrmony scope, as they may be associated with malicious activity. Always verify the integrity and source of packages before use.