DependencyTrack / DependencyTrack/dependency-track

Package version matching fails for pre-release versions (e.g. rc1)

Open
#4,087 0 comments 0 reactions 0 assignees View on GitHub
defect in triage
Dominant language
Java
Stars
4.2k
Forks
811
Avg merge
8h 39m
Merged PRs (30d)
237

Description

### Current Behavior

We noticed the vulnerabilities GHSA-cf56-g6w6-pqq2 and GHSA-c8m8-j448-xjx7 being reported for pkg:pypi/twisted@24.7.0 in our dtrack instance.
This seems to be because dependencytrack thinks 24.7.0 is smaller than 24.7.0rc1, the fixed pre-release version reported by github (see screenshot of 'Affected Versions' view in dtrack GUI).

The vulnerabilities disappear if manually changing the BOM to include version 24.7.0rc1, implying the version matching logic does not account for the release-candidate syntax (see for example https://peps.python.org/pep-0440/#pre-releases).

We understand it might be hard to implement everyone's different version syntax, please let me know if this just won't be fixed!

test-BOM with only the mentioned component: [test-bom.json](https://github.com/user-attachments/files/16707750/test-bom.json)

screenshot of 'Affected Components':
![GHSA-c8m8-j448-xjx7](https://github.com/user-attachments/assets/9bb78d01-b229-437d-9f8e-3723a31d2130)

### Steps to Reproduce

1.create a project with component pkg:pypi/twisted@24.7.0 (i.e. upload attached BOM)
2. vuln GHSA-c8m8-j448-xjx7 gets erroneously reported

### Expected Behavior

no known vulnerabilities for that version of twisted

### Dependency-Track Version

4.11.7

### Dependency-Track Distribution

Executable WAR

### Database Server

PostgreSQL

### Database Server Version

N/A

### Browser

Google Chrome

### Checklist

- [X] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/master/CONTRIBUTING.md#filing-issues)
- [X] I have checked the [existing issues](https://github.com/DependencyTrack/dependency-track/issues) for whether this defect was already reported

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.