OVAL parser corrupts version bounds when the epoch is 10, 20 or the version contains "0:"
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
Direzione di ricerca
Inizia da get_version_range_from_state in vulnerabilities/oval_parser.py e segui il modo in cui costruisce intervalli di versioni dal testo dello stato OVAL. Aggiungi test di regressione per i casi di epoch indicati, inclusi 10:, 20: e uno 0: incorporato, quindi esegui i test pertinenti del parser. Il lavoro è completato quando viene rimosso solo uno 0: predefinito iniziale e il resto del contenuto della versione rimane invariato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
I found a data corruption bug in the OVAL parser while investigating how version ranges are built from OVAL states.
In vulnerabilities/oval_parser.py, get_version_range_from_state strips the default epoch using a plain string replacement:
version_range = version_range.replace("0:", "")This removes every occurrence of 0: from the entire range string, rather than removing it only when it appears at the beginning of a version.
Steps to Reproduce
Feed version state texts through OvalParser using the Debian translations.
The following transformations occur:
| Input version | Result | Status |
|---|---|---|
0:4.14-1.1 |
<4.14-1.1 |
Correct |
1:4.14-1.1 |
<1:4.14-1.1 |
Correct |
10:4.14-1.1 |
<14.14-1.1 |
Incorrect |
20:4.14-1.1 |
<24.14-1.1 |
Incorrect |
0:10:2.0-1 |
<12.0-1 |
Incorrect |
Expected Behavior
The parser should remove an explicit leading 0: only when it represents the default version epoch. All other parts of the version string, including nonzero epochs and version components containing 0:, should remain unchanged.
Actual Behavior
The unrestricted string replacement corrupts version ranges by removing 0: wherever it occurs, potentially changing version ordering and causing affected packages to be incorrectly reported as not vulnerable.
For example, with univers:
10:3.0-1 < 10:4.14-1.1 # True10:3.0-1 < 14.14-1.1 # FalseThe corrupted upper bound therefore causes an affected build to be reported as not affected.
Additional Context
This issue affects the Debian, Ubuntu, and SUSE OVAL importers because they all parse through OvalParser.
A potential fix is to strip the epoch only at the beginning of the version range. Since epoch 0 is the default, removing an explicit leading 0: preserves the version's meaning while leaving the rest of the version string untouched.
- Lingua principale
- Python
- Stelle
- 716
- Fork
- 347
- Merge medio
- 12h 15m
- PR unite (30g)
- 9
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aboutcode-org/vulnerablecode
-
OSV parser drops all crates.io affected entries because the ecosystem mapping uses cargoForse già presa @Ashutosh-Panda2004 l’ha presa 2 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
aboutcode-org/vulnerablecode#2485 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Docker Compose setup fails on wait-for-it host web:8000 and missing runtime .envForse già presa @Anurag-S1ngh l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 Mezza giornata Idoneità per principianti 77/100
aboutcode-org/vulnerablecode#2477 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
aboutcode-org/vulnerablecode#2426 ·
I maintainer di solito rispondono entro 1 giorno
-
Get NuGet package versions from federated PURL version data in https://github.com/aboutcode-data/Forse di nuovo libera @Anshi321 l’ha presa 24 giorni fa e non c’è nessuna pull request aperta. Apertabug data-quality
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
aboutcode-org/vulnerablecode#2418 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
We do not collect the affected range for Gitlab advisoriesForse già presa @akashrajeev l’ha presa 11 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
aboutcode-org/vulnerablecode#2412 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di aboutcode-org/vulnerablecode
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ClockGU/clockwork-backend#169 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
aws-samples/sample-per-model-bedrock#616 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
chnm/teachinghistory-hugo#47 ·
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
pandas-dev/pandas-stubs#2047 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno