Malicious Code Injection in @dransay/feature-flags Package
Summary
MAL-2026-17696: Malicious code in @dransay/feature-flags (npm). Affects @dransay/feature-flags 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 @dransay/feature-flags package is a scoped npm package designed for managing feature flags in applications. It allows developers to enable or disable features dynamically without deploying new code. However, the package version 99.0.0 has been identified to contain malicious code that compromises user privacy and security.
Vulnerability Detail
The vulnerability originates from the package's preinstall hook, which executes a script (beacon.js) that performs a DNS lookup and an HTTPS GET request to a hardcoded callback host. This action occurs every time the package is installed, leaking the installer's public IP address, a timestamp, and confirming the resolution of the scoped name from the public registry. The malicious behavior is disguised as a probe of the author's build infrastructure, but it poses a significant risk to users by exposing sensitive information.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall @dransay/feature-flags
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 prevent the execution of the preinstall hook by using the following command when installing the package:
npm install @dransay/feature-flags --ignore-scripts
This command will install the package without executing any scripts defined in the package.json.
Conclusion
The @dransay/feature-flags package version 99.0.0 contains malicious code that compromises user privacy. It is crucial for developers to update or remove this package to mitigate risks. Utilizing tools like Vulert can help in monitoring for such vulnerabilities effectively.
See every vulnerability recorded for @dransay/feature-flags →
FAQ
The malicious code leaks the user's public IP address and other sensitive information to a third-party server during installation.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
As of now, version 99.0.0 is known to be malicious. Check the npm registry for any updated versions that may have addressed this issue.
If you have installed the package, it is recommended to remove it immediately and monitor your system for any unusual activity.
Vulert monitors and alerts in real-time for open-source vulnerabilities using just the package-lock.json file, allowing developers to stay informed about potential risks.