Skip to content

Check ruby version from lockfile for advisories - #451

Open
eliotsykes wants to merge 7 commits into
rubysec:masterfrom
eliotsykes:audit-gemfile-ruby-version
Open

Check ruby version from lockfile for advisories#451
eliotsykes wants to merge 7 commits into
rubysec:masterfrom
eliotsykes:audit-gemfile-ruby-version

Conversation

@eliotsykes

Copy link
Copy Markdown
Contributor

Scans the ruby version in the lockfile and reports any corresponding advisories.

This should help projects already running bundler-audit become aware of new ruby security vulnerabilities and patches sooner.

@postmodern mentioned being open to checking the ruby version in Gemfile.lock sometime ago in #118

I'm open to checking the ruby version specified in the Gemfile.lock ... link.

If a scanned lockfile does not contain the RUBY VERSION metadata, then this ruby check is silently skipped.

Thanks in advance for any feedback.

@eliotsykes
eliotsykes force-pushed the audit-gemfile-ruby-version branch 2 times, most recently from 45a8fec to 4f79bf6 Compare July 16, 2026 16:36
@simi

simi commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

What about the other formatters (junit, json)?

@eliotsykes

Copy link
Copy Markdown
Contributor Author

@simi Thanks for the feedback, I'll add support for the junit and json formatters.

@eliotsykes

Copy link
Copy Markdown
Contributor Author

Hi @simi, json and junit formatting support has now been added

Comment on lines +86 to +87
advisory.delete(:gem)
advisory.delete(:engine)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was needed to exclude these two new Advisory attributes from the JSON output.

I am avoiding adding new data to the output JSON without good reason, to reduce the risk of breaking anything that depends on this JSON having the same keys it always has.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants