Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrectly flagged vulnerabilities with 4-digit version numbers #328

Open
tilo opened this issue Feb 15, 2022 · 1 comment
Open

Incorrectly flagged vulnerabilities with 4-digit version numbers #328

tilo opened this issue Feb 15, 2022 · 1 comment
Labels

Comments

@tilo
Copy link

tilo commented Feb 15, 2022

Description

Codeclimate runs bundler-audit to check for vulnerabilities
and I noticed that it incorrectly flags vulnerabilities.

e.g. when upgrading Rails from 6.0.4 to 6.0.4.6

these two vulnerabilities get flagged, although they already have the fix from 6.0.3.5 applied:

https://discuss.rubyonrails.org/t/cve-2021-22880-possible-dos-vulnerability-in-active-record-postgresql-adapter/77129
https://discuss.rubyonrails.org/t/cve-2021-22881-possible-open-redirect-in-host-authorization-middleware/77130

Screen Shot 2022-02-15 at 12 34 28

Flagging this issue with Codeclimate as well, but wanted to give you guys a heads-up in case it is an issue in bundler-audit.

Perhaps the comparison of version numbers is not correctly done, and has trouble with 4-digit version numbers?

Steps To Reproduce

Steps to reproduce the bug:

  1. $ bundle-audit ...
  2. ???

Expected Behavior

should not flag these CVEs as an error

Actual Behavior

see image above

Environment

$ bundler-audit --version
...
$ bundle --version
...
$ ruby --version
...
@tilo tilo added the bug label Feb 15, 2022
@postmodern postmodern added the cannot-repro Cannot Reproduce label Feb 15, 2022
@postmodern
Copy link
Member

I cannot seem to reproduce this bug using the latest version of bundler-audit and ruby-advisory-db.

Vulnerable Gemfile

source 'https://rubygems.org/'

gem 'bundler-audit'
gem 'activerecord', '6.0.3.4'
$ bundle exec bundle-audit
Name: activerecord
Version: 6.0.3.4
CVE: CVE-2021-22880
Criticality: Medium
URL: https://groups.google.com/g/rubyonrails-security/c/ZzUqCh9vyhI
Title: Possible DoS Vulnerability in Active Record PostgreSQL adapter
Solution: upgrade to ~> 5.2.4, >= 5.2.4.5, ~> 6.0.3.5, >= 6.1.2.1

Vulnerabilities found!

Secure Gemfile

source 'https://rubygems.org/'

gem 'bundler-audit'
gem 'activerecord', '6.0.3.5'
$ bundle exec bundle-audit
No vulnerabilities found

Could you post the Gemfile.lock or Gemfile and which specific CVEs that bundler-audit is detecting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants