Malicious Code Vulnerability in @dransay/logger: A Dependency-Confusion Attack
Summary
MAL-2026-17697: Malicious code in @dransay/logger (npm). Affects @dransay/logger versions 99.0.0. 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 package @dransay/logger is an npm package that is intended for logging purposes. However, the version 99.0.0 of this package has been identified as malicious. It includes a preinstall hook that executes a script during the installation process, which can compromise the security of the user's environment by sending sensitive information to an attacker-controlled server.
Vulnerability Detail
The vulnerability originates from the malicious code embedded in the preinstall hook of the @dransay/logger package version 99.0.0. This script performs a DNS lookup and sends an HTTPS GET request to an external server, disclosing the installer's source IP, DNS resolver, and timestamp. This behavior is indicative of a dependency-confusion attack, where an attacker attempts to trick users into installing a malicious package instead of a legitimate internal package. The implications of this vulnerability include potential data leakage and unauthorized access to sensitive information.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall @dransay/logger
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 installing the @dransay/logger package altogether or use a different logging package that does not have known vulnerabilities. Additionally, you can implement network security measures to block outgoing requests to suspicious domains.
Conclusion
The @dransay/logger package version 99.0.0 contains malicious code that poses a significant security risk. Users are advised to update to a secure version and utilize tools like Vulert to monitor for vulnerabilities in their applications.
See every vulnerability recorded for @dransay/logger →
FAQ
The vulnerability involves malicious code that sends sensitive information to an external server during the installation process.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application using the Vulert playground without any signup.
If you have installed version 99.0.0 of @dransay/logger, you should immediately uninstall it and update to a secure version.
The risks include data leakage, unauthorized access to sensitive information, and potential exploitation of your environment by attackers.
To prevent similar vulnerabilities, regularly audit your dependencies, use trusted sources for packages, and implement security measures in your development process.