Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Aberta Para iniciantes
#2,474 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@Ashutosh-Panda2004 já está trabalhando nisso.

Desde 26/10/2026.

  • #2483 de @Ashutosh-Panda2004 — aberto

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
76/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
python
Domínio
backend, security

Direção de pesquisa

Comece por get_version_range_from_state em vulnerabilities/oval_parser.py e acompanhe como ele monta intervalos de versões a partir do texto do estado OVAL. Adicione cobertura de regressão para os casos de epoch listados, incluindo 10:, 20: e um 0: incorporado, e depois execute os testes relevantes do parser. O trabalho estará concluído quando apenas um 0: padrão no início for removido e o restante do conteúdo da versão permanecer inalterado.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Python
Estrelas
716
Forks
347
Merge médio
12h 15min
PRs com merge (30d)
9

Preparar o ambiente

  • Inclui um Dockerfile ou arquivo Docker Compose
  • Sem modelo de pull request
  • Sem guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de aboutcode-org/vulnerablecode

Todas as issues de aboutcode-org/vulnerablecode

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.