Skip to content

Version-range check fails open: errors hide vulnerabilities #44

@andrew

Description

@andrew

When Vers.satisfies? raises during a range check, version_in_range? rescues and returns false:

rescue StandardError => e
  warn "Warning: Failed to check version '#{version}' against constraints: #{e.message}"
  false

lib/brew/vulns/vulnerability.rb:178-181

Returning false means the vulnerability is treated as not affecting the installed version, so it gets filtered out at cli.rb:128. The warning goes to stderr, which is invisible when running with --json, --sarif, or --cyclonedx in CI.

Compare affects_version? at line 61, which returns true when affected is empty. That's the safer default for a scanner: when in doubt, include the finding.

Suggested change: return true from the rescue so a parse failure surfaces the vuln rather than hiding it. The user can then triage the false positive instead of missing a real one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions