Skip to content

bug(pip): Trivy doesn’t trim the end-of-range suffix when using the --detection-priority comprehensive flag. #9609

@DmitriyLewen

Description

@DmitriyLewen

Description

When the --detection-priority comprehensive flag is used, Trivy takes the minimum version for a package (see docs).

However, if the package version is specified as a range, Trivy doesn’t trim the end-of-range suffix.
e.g for requests>=2.31.0,<3:

  • now: requests + 2.31.0,<3
  • correct: requests + 2.31.0

Required changes:

Add logic to trim the end-of-range suffix.
We can rely on separators such as , , <, =.

Discussed in #9607

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions