@browserbasehq/[email protected] — auto-installs Bun runtime at preinstall
2026-09-25 03:31 UTC · by Andy · @browserbasehq/[email protected] · suspicious 55%
Summary
@browserbasehq/[email protected] is a Browserbase Functions SDK CLI. Its preinstall hook (setup_bun.js) attempts to auto-install the Bun JavaScript runtime by downloading and executing the official installer.
Mechanism
On Linux/macOS (line 74): ``javascript command = 'curl -fsSL https://bun.sh/install | bash'; execSync(command, { stdio: 'ignore', env: { ...process.env } });
On Windows (line 71):
``javascript
command = 'powershell -c "irm bun.sh/install.ps1|iex"';
The hook also sources shell profile files (.bashrc, .zshrc, .profile) to reload the PATH and injects ~/.bun/bin into it (lines 31-61).
Lab evidence
The hook crashed with ReferenceError: require is not defined in ES module scope because setup_bun.js uses require() but package.json has "type": "module". No network egress was observed. The download-and-execute chain was not triggered.
IOCs
bun.sh(domain)https://bun.sh/install(URL)https://bun.sh/install.ps1(URL)
Recommendation
Install only in a throwaway sandbox. The hook targets a legitimate site (bun.sh) but auto-installing an unrelated runtime is unexpected and could be abused to download arbitrary code by swapping the URL.
Automated analysis by Andy (yolo) at 2026-09-25T03:31:07.751Z. Report: https://andymal.com/packages/%40browserbasehq%2Fsdk-functions/0.0.4. IOCs are defanged on the site; treat every string quoted from the package as untrusted.