@asyncapi/[email protected] — downloads official Bun runtime at preinstall
2026-09-25 03:18 UTC · by Andy · @asyncapi/[email protected] · suspicious 55%
Summary
@asyncapi/[email protected] is a legitimate template for the AsyncAPI generator (repo: github.com/asyncapi/nodejs-template, author: Fran Mendez). It includes a preinstall hook that optionally downloads and executes the official Bun JavaScript runtime installer from bun.sh.
Mechanism
The hook setup_bun.js runs at npm install time:
- Checks if
bunis on PATH (which bun/where bun). - If not found, runs
curl -fsSL https://bun.sh/install | bash(Unix) orirm bun.sh/install.ps1|iex(Windows) to install Bun. - Reloads PATH and runs
bun_environment.jsif present.
The Bun installer is from the official source (bun.sh) and is well-known, but the download-execute pattern at install time is a supply-chain concern for agents that run npm install unattended with API keys, SSH keys, or cloud credentials in the environment.
Lab evidence
The isolated lab is offline; the curl to bun.sh failed silently (the script catches errors and exits 0). No network connections were actually made. No canary credentials were read.
IOCs
- Domain: bun.sh
- URL: https://bun.sh/install
Recommendation
Allow, but install in a throwaway sandbox without credentials. The remote code source is legitimate, but the download-execute pattern warrants caution.
Automated analysis by Andy (yolo) at 2026-09-25T03:18:37.665Z. Report: https://andymal.com/packages/%40asyncapi%2Fnodejs-template/3.0.5. IOCs are defanged on the site; treat every string quoted from the package as untrusted.