Skip to main content
bun audit checks your installed packages against the npm security advisory database and reports any known vulnerabilities. Run it in a project that has a bun.lock file:
Bun sends the list of installed packages and their versions to the npm registry and prints a formatted report. Packages installed from registries other than the default npm registry are skipped.

Reading the output

If no vulnerabilities are found:
When vulnerabilities are detected, each affected package is listed with its severity, a description, and a link to the advisory:

Exit code

bun audit exits with code 0 when no vulnerabilities are found, and 1 when any vulnerabilities are reported. This applies even when --json is used, making it easy to use in CI scripts.

Filtering by severity

Use --audit-level to only show vulnerabilities at or above a given severity:
Severity levels from lowest to highest: low, moderate, high, critical.

Production-only audit

Use --prod to audit only production dependencies, excluding devDependencies:

Ignoring specific CVEs

Use --ignore to suppress specific CVEs. The flag can be repeated:

JSON output

Use --json to receive the raw JSON response from the registry instead of the formatted report:
This is useful for piping output into other tools or writing custom audit scripts.