|
| 1 | +# Audit Your Ruby Project For Any CVEs |
| 2 | + |
| 3 | +The [`bundler-audit` gem](https://github.com/rubysec/bundler-audit) is a handy |
| 4 | +tool that you can run manually or integrate into your CI workflow to warn you |
| 5 | +about any CVEs in your dependencies. |
| 6 | + |
| 7 | +Running this tool without any arguments will perform a check of your |
| 8 | +`Gemfile.lock` file. It will check against the |
| 9 | +[`ruby-advisory-db`](https://github.com/rubysec/ruby-advisory-db) for any CVEs |
| 10 | +linked to your dependencies, down to the patch-level. |
| 11 | + |
| 12 | +```bash |
| 13 | +$ bundle exec bundler-audit |
| 14 | + |
| 15 | +Name: puma |
| 16 | +Version: 4.3.12 |
| 17 | +CVE: CVE-2024-21647 |
| 18 | +GHSA: GHSA-c2f4-cvqm-65w2 |
| 19 | +Criticality: Medium |
| 20 | +URL: https://github.com/puma/puma/security/advisories/GHSA-c2f4-cvqm-65w2 |
| 21 | +Title: Puma HTTP Request/Response Smuggling vulnerability |
| 22 | +Solution: upgrade to '~> 5.6.8', '>= 6.4.2' |
| 23 | + |
| 24 | +Vulnerabilities found! |
| 25 | +``` |
| 26 | + |
| 27 | +In this example run, a vulnerability was found in the currently installed |
| 28 | +version of the `puma` gem. |
| 29 | + |
| 30 | +I believe a standard `bundler-audit` command will make sure the advisory DB is |
| 31 | +up-to-date, but to be sure, you can run the `update` command. |
| 32 | + |
| 33 | +```bash |
| 34 | +$ bundle exec bundler-audit update |
| 35 | + |
| 36 | +Updating ruby-advisory-db ... |
| 37 | +From https://github.com/rubysec/ruby-advisory-db |
| 38 | + * branch master -> FETCH_HEAD |
| 39 | +Already up to date. |
| 40 | +Updated ruby-advisory-db |
| 41 | +ruby-advisory-db: |
| 42 | + advisories: 884 advisories |
| 43 | + last updated: 2024-03-26 16:27:16 -0700 |
| 44 | + commit: 840f21aeeb8a06a93a3c3bf1e2a92d7167029992 |
| 45 | +``` |
0 commit comments