Critical Malicious Code Vulnerability in @silgi/better-auth Package
Summary
MAL-2025-191311: Malicious code in @silgi/better-auth (npm). Affects @silgi/better-auth versions 0.8.1. 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 @silgi/better-auth package is an npm library designed to facilitate authentication processes in web applications. It offers features such as token management and user session handling. However, this package has been compromised, making it a significant risk for developers who rely on it for secure authentication.
Vulnerability Detail
This vulnerability originates from a malicious payload embedded within the @silgi/better-auth package, specifically version 0.8.1. The package was compromised by the Sha1-Hulud: The Second Coming NPM worm, which is designed to steal tokens and credentials, publishing them to GitHub. It can propagate itself to other npm packages owned by the user and establish persistence through GitHub actions. Additionally, it poses a risk of destroying the user's home directory, leading to severe data loss and security breaches.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall @silgi/better-auth
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, ensure that no sensitive tokens or credentials are stored on the affected machine. Rotate any secrets or keys that may have been compromised. Additionally, monitor your GitHub repositories for any unauthorized changes or actions.
Conclusion
The @silgi/better-auth package has been compromised, posing serious security risks to users. Immediate action is required to remove the package and secure any exposed credentials. Regular monitoring and updates are essential to prevent future vulnerabilities.
See every vulnerability recorded for @silgi/better-auth →
FAQ
Immediately uninstall the package using npm uninstall @silgi/better-auth and rotate any credentials that may have been exposed.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without requiring any signup.
The risks include unauthorized access to sensitive information, potential data loss, and the propagation of malicious code to other packages.
Regularly audit your dependencies, use tools like Vulert for monitoring, and keep your packages updated to the latest secure versions.
Investigate the activity immediately, revert any unauthorized changes, and consider enhancing your security measures, such as enabling two-factor authentication.