Malicious Code Detected in gethostinfo Package - Security Alert
Summary
MAL-2025-21369: Malicious code in gethostinfo (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 gethostinfo package is an npm library designed to provide information about hostnames and IP addresses. It is commonly used in web applications to facilitate network-related functionalities. However, this package has been found to contain malicious code, posing significant security risks to applications that utilize it.
Vulnerability Detail
The vulnerability in the gethostinfo package stems from the inclusion of malicious code that can compromise the security of applications using this library. This code can potentially lead 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 gethostinfo
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 avoid using the gethostinfo package altogether and implement alternative methods to retrieve host information. For example, consider using built-in Node.js modules like 'dns' for DNS lookups.
Conclusion
The discovery of malicious code in the gethostinfo package highlights the importance of maintaining secure dependencies in software development. Developers are urged to take immediate action to remove the affected package and monitor their applications for vulnerabilities.
See every vulnerability recorded for gethostinfo →
FAQ
The gethostinfo package is an npm library used to retrieve information about hostnames and IP addresses.
The malicious code can lead to unauthorized access and potential data breaches in applications that utilize the package.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without requiring any signup.
You should remove the gethostinfo package from your project and consider using a secure alternative or a patched version if available.
Regularly monitor your dependencies for vulnerabilities using tools like Vulert, and keep your packages updated to the latest secure versions.