Critical Malicious Code Vulnerability in @browserbasehq/stagehand Package
Summary
MAL-2025-191198: Malicious code in @browserbasehq/stagehand (npm). Affects @browserbasehq/stagehand versions 3.0.4. 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 @browserbasehq/stagehand package is an npm module designed to assist developers in managing and automating various tasks within their web applications. It provides a range of functionalities that streamline the development process. However, this package has been compromised, making it susceptible to a severe security threat that can lead to unauthorized access and data breaches.
Vulnerability Detail
The vulnerability stems from a malicious code injection by the Sha1-Hulud: The Second Coming NPM worm. This worm is designed to steal sensitive tokens and credentials from users, subsequently publishing this information to GitHub. Additionally, it can propagate itself to other npm packages owned by the user and establish persistence through a GitHub action. The malicious payload poses a significant risk, as it may also lead to the destruction of the user's home directory, resulting in potential data loss.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall @browserbasehq/stagehand
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, users can remove the compromised package from their project until a secure version is available. This can be done by executing the following command: npm uninstall @browserbasehq/stagehand. Additionally, consider using alternative packages that provide similar functionalities without the associated risks.
Conclusion
The @browserbasehq/stagehand package has been compromised by a malicious worm that poses significant security risks. Users are urged to update their packages immediately and consider alternative solutions until a secure version is confirmed. Vigilance and prompt action are essential to safeguard sensitive information.
See every vulnerability recorded for @browserbasehq/stagehand →
FAQ
The vulnerability involves malicious code that can steal sensitive information and propagate itself to other packages.
You can use Vulert's playground at Vulert Scanner to check if your application is affected without needing to sign up.
If you suspect that your credentials have been compromised, immediately revoke any affected tokens and change your passwords.
Yes, users should update to the latest version of the @browserbasehq/stagehand package to mitigate the risk.
Failure to address this vulnerability can lead to unauthorized access to sensitive data, potential data loss, and further propagation of the malicious code.