Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Improve simplified vulnerable version ranges calculation #1

Open
AMDmi3 opened this issue May 6, 2020 · 0 comments
Open

Improve simplified vulnerable version ranges calculation #1

AMDmi3 opened this issue May 6, 2020 · 0 comments

Comments

@AMDmi3
Copy link
Member

AMDmi3 commented May 6, 2020

We can have thousands of vulnerable version ranges for a popular project, which are too slow too lookup against actual versions to determine their vulnerable status. To cope with that, we simplify vulnerable ranges using a simple algorithm:

  • take largest range which doesn't have left bound (e.g. (-∞, ver))
  • remove all ranges covered by it
    This reduces number of ranges by 20x, but it can be further improved by at least extending the range by closed ranges intersecting it (e.g. (-∞, 1.2] + [1.1, 1.3] = (-∞, 1.3]), or, better, fair merger of all available ranges.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant