Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

OVAL parser corrupts version bounds when the epoch is 10, 20 or the version contains "0:"

Aperta Adatta ai principianti
#2,474 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Ashutosh-Panda2004 ci sta già lavorando.

Dal 26/10/2026.

  • #2483 di @Ashutosh-Panda2004 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend, security

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   # False

The 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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aboutcode-org/vulnerablecode

Tutte le issue di aboutcode-org/vulnerablecode

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.