Malicious Code Vulnerability in @dransay/db: DNS Lookup and Data Leakage
Summary
MAL-2026-17695: Malicious code in @dransay/db (npm). Affects @dransay/db 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/db is an npm library that is intended for database interactions. However, it has been compromised to include malicious code that executes during the installation process. This vulnerability allows attackers to gather reconnaissance on internal package names, potentially leading to further exploitation.
Vulnerability Detail
The vulnerability originates from a malicious preinstall hook in the package that executes a script (beacon.js) upon installation. This script performs a DNS lookup and sends an HTTPS GET request to a hardcoded subdomain controlled by an attacker, embedding the package name in the request path. This action leaks the installer's IP address and confirms to the attacker that the target organization is using the vulnerable package, making it susceptible to future attacks. Although no sensitive data is directly accessed, the reconnaissance aspect poses a significant risk.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall @dransay/db
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 @dransay/db package until a secure version is released. Additionally, consider using alternative packages that provide similar functionality without the associated risks.
Conclusion
The @dransay/db package has been compromised with malicious code that executes during installation, leading to potential data leakage and reconnaissance by attackers. It is essential to remove the package and monitor for updates to ensure the security of your application.
See every vulnerability recorded for @dransay/db →
FAQ
The package contains malicious code that executes during installation, leaking information to an attacker.
You can use Vulert, which monitors open-source vulnerabilities in your software. Visit Vulert Scanner to check your application without needing to sign up.
Remove the @dransay/db package from your project immediately and monitor for any updates or patches.
While the vulnerability does not directly access sensitive data, it poses a risk of information leakage that could lead to further attacks.
Regularly audit your dependencies, use tools like Vulert for real-time monitoring, and stay updated on security patches for all packages.