Use when a Ruby project has a Gemfile.lock and needs CVE/GHSA scanning or a CI SCA gate. Installs and runs bundler-audit against a Ruby Gemfile.lock, updating the ruby-advisory-db corpus, scanning for vulnerable gem versions and insecure sources, suppressing false positives via .bundler-audit.yml, and gating CI on non-zero exit. Ruby-only SCA scanner: for other ecosystems use npm-pip-maven-audit (multi-ecosystem dispatcher), snyk-test, or osv-scanner; cargo-audit-rust is the Rust analog; once findings exist, reachability-analyzer downranks unreachable gems - not this.
75
94%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
bundler-audit (github.com/rubysec/bundler-audit) is a
standalone Ruby gem that scans Gemfile.lock against the
ruby-advisory-db: a community-maintained YAML corpus
of CVE, GHSA, and OSVDB advisories for RubyGems and Ruby runtimes.
Differentiation vs. npm-pip-maven-audit:
that skill treats bundle audit (the Bundler subcommand) as one line in a
multi-ecosystem dispatcher; this skill covers the full bundler-audit workflow:
advisory-db lifecycle, per-project suppression with justification, Rake task
integration, and JSON output for downstream tooling.
Gemfile.lock and needs CVE/GHSA scanning.osv-scanner for OSV.dev cross-DB consensus.Per github.com/rubysec/bundler-audit:
gem install bundler-auditNo system-level dependencies beyond a Ruby environment. After install, run a one-time database fetch:
bundle-audit updatePer ruby-advisory-db, the corpus is a git repository
of YAML files under gems/ (per-RubyGem advisories) and rubies/ (Ruby
runtime advisories). bundle-audit update syncs the local clone of this
repo. Subsequent bundle-audit check --no-update runs are fully offline.
Per github.com/rubysec/bundler-audit:
bundle-audit check --updateThe --update flag refreshes the local ruby-advisory-db before scanning,
ensuring the check sees the latest advisories. Where outbound git is
restricted, pre-update in a build step and scan offline with
bundle-audit check --no-update.
bundler-audit scans Gemfile.lock in the current directory and checks
two classes of issues (github.com/rubysec/bundler-audit):
http:// and git:// source URIs that transmit
without TLS.Output flags (github.com/rubysec/bundler-audit):
| Flag | Output |
|---|---|
| (none) | Default human-readable text |
--format json | JSON; suitable for multi-tool SCA triage |
--output FILE | Write output to file instead of stdout |
--gemfile-lock PATH | Scan a lockfile at a non-default path |
JSON + file example, useful as a CI artifact:
bundle-audit check --update --format json --output bundle-audit.jsonPer github.com/rubysec/bundler-audit, create
.bundler-audit.yml at the project root and list advisory IDs to ignore:
---
ignore:
- CVE-2024-1234
- GHSA-xxxx-yyyy-zzzzThe ignore array takes CVE, GHSA, or OSVDB identifiers, committed to
source control so suppressions are auditable in git history. Every ignore
needs an inline justification comment (reachability finding, approver,
re-review date); undocumented ignores are a code-smell reviewers should
treat as unapproved. The mandatory justification template, per-run
--ignore flags, and the quarterly re-review cadence are in
references/bundle-audit-ci.md.
A Rails service locks nokogiri 1.13.0 and rack 2.2.3. The scan
(bundle-audit check --update, per Scan above) flags two advisories and exits
non-zero:
Name: nokogiri
Version: 1.13.0
CVE: CVE-2022-24836
Criticality: High
Title: Nokogiri ReDoS on crafted input
Solution: upgrade to >= 1.13.4
Name: rack
Version: 2.2.3
CVE: CVE-2022-30122
Criticality: Medium
Title: Denial of Service in Rack multipart parsing
Solution: upgrade to >= 2.2.3.1
Vulnerabilities found!Because the exit code is non-zero, a CI job running this step fails. Triage the two findings:
nokogiri is reachable (it parses user-supplied XML). Patch it -
bundle update nokogiri to 1.13.4 - and the advisory clears.rack multipart parsing is confirmed unreachable (the app rejects
multipart requests at the edge). Suppress CVE-2022-30122 in
.bundler-audit.yml using the justification template from Suppress false
positives above.Re-run offline (bundle-audit check --no-update): both findings resolved,
exit 0, CI passes. Wire the gate into the pipeline per
references/bundle-audit-ci.md.
| Anti-pattern | Why it fails | Fix |
|---|---|---|
Skip --update in CI | Local db may lag by weeks; misses recent advisories | Always --update in CI or pre-update in a dedicated step |
--ignore flags hardcoded in CI YAML | Not auditable in git; no justification attached | Move to .bundler-audit.yml with inline comments |
Scan with no Gemfile.lock committed | bundler-audit reads only the lockfile; no lockfile means no scan | Commit Gemfile.lock; failing to do so is an anti-pattern per ba-readme |
| Suppress an advisory indefinitely | No expiry signal; suppressions rot silently | Add re-review date in comment; enforce via quarterly review |
| Run bundler-audit only; skip cross-DB scanner | ruby-advisory-db covers Ruby ecosystem; OSV.dev may surface additional findings | Pair with osv-scanner for cross-DB coverage |
Gemfile.lock only; gems loaded outside Bundler (standalone
require) are not visible to bundler-audit.--ignore has no built-in expiry mechanism; teams must enforce review
cadence in process, not in tooling..bundler-audit.yml waiver template:
references/bundle-audit-ci.mdnpm-pip-maven-audit - multi-ecosystem
native audit dispatcher; covers bundle audit as one ecosystem among manyosv-scanner - OSV.dev cross-DB scanner;
pairs for cross-ecosystem consensussnyk-test - commercial SCA with Snyk DB