Malicious Code Vulnerability in defihas Package
Summary
MAL-2025-171101: Malicious code in defihas (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 defihas package is part of the npm ecosystem, primarily used for decentralized finance applications. It is designed to facilitate interactions with various DeFi protocols. However, it has been identified as part of a malicious campaign that floods the npm registry with derivative packages, potentially compromising the integrity of applications that rely on it.
Vulnerability Detail
The vulnerability in the defihas package stems from its association with a malicious campaign that modifies the package.json file to remove private flags, alters version numbers, and generates random package names. This behavior is intended to inflate developer reputation scores for token rewards, leading to pollution of the npm registry. The malicious payload can introduce security risks, including the potential for unauthorized access or manipulation of dependent applications.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall defihas
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 remove the defihas package from your project until a secure version is released. You can do this by executing: npm uninstall defihas. Additionally, consider using alternative packages that do not have known vulnerabilities.
Conclusion
The defihas package has been identified as having a serious vulnerability due to its involvement in a malicious campaign. It is crucial for developers to take immediate action by updating or removing the package to protect their applications from potential threats.
See every vulnerability recorded for defihas →
FAQ
The defihas package is an npm package used for interacting with decentralized finance protocols.
The vulnerability can lead to unauthorized modifications in your application's dependencies, potentially compromising security.
Yes, you can use tools like Vulert, which monitors your package-lock.json file to alert you of open-source vulnerabilities in real-time.
Absolutely! You can use the Vulert playground at Vulert Scanner to check for vulnerabilities in your application without any signup.
If an immediate update is not possible, consider removing the package or using an alternative until a secure version is available.