OSV v3 parser shares introduced/fixed commit patches across affected packages
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 84/100
Direção de pesquisa
Comece em vulnerabilities/pipes/osv_v2.py, em parse_advisory_data_v3, onde a issue identifica as listas de commits que são inicializadas e passadas para cada pacote. Execute os testes de regressão do parser real para blocos Git distintos e um bloco somente com versões, em qualquer ordem; está concluído quando cada pacote recebe apenas seus próprios commits, em listas separadas, enquanto vários intervalos Git dentro de um bloco continuam sendo acumulados.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
When an OSV advisory contains multiple affected blocks, parse_advisory_data_v3 puts all collected Git commits into each parsed package. Packages with only version ranges inherit commits too.
Reproduced on current main, commit 8af2bd39510f909c852c5cc086e9b56addc8c50a, with Python 3.12.14, univers==32.0.1, and packageurl-python==0.17.6.
Reproduction
Run this in the project's configured Django shell. The package names, repositories and hashes below are synthetic. Parsing these GitHub URLs does not fetch any repositories.
python manage.py shell
from vulnerabilities.pipes.osv_v2 import parse_advisory_data_v3
raw = {
"id": "x_REPRO-OSV-COMMIT-SCOPE",
"modified": "2026-11-03T00:00:00Z",
"affected": [
{
"package": {"ecosystem": "PyPI", "name": f"demo-{suffix}"},
"ranges": [{
"type": "GIT",
"repo": f"https://github.com/example/repo-{suffix}",
"events": [{"introduced": intro * 40}, {"fixed": fixed * 40}],
}],
}
for suffix, intro, fixed in [("a", "a", "b"), ("b", "c", "d")]
],
}
advisory = parse_advisory_data_v3(
raw, ["pypi"], "https://example.org/advisory", ""
)
first, second = advisory.affected_packages
for package in advisory.affected_packages:
print(package.package, len(package.introduced_by_commit_patches),
len(package.fixed_by_commit_patches))
print(first.introduced_by_commit_patches is second.introduced_by_commit_patches)
print(first.fixed_by_commit_patches is second.fixed_by_commit_patches)
Actual output:
pkg:pypi/demo-a 2 2
pkg:pypi/demo-b 2 2
True
True
Each package contains both repositories' introduced and fixed commits. Expected output is 1 1 for each package and separate lists: demo-a should only have repo-a commits and demo-b only repo-b commits.
With a Git block and a version-only block in the same advisory, the version-only package receives the Git block's introduced and fixed patches in either order.
Cause
The parser initializes the two commit lists before the affected-package loop and passes them unchanged to every AffectedPackageV2. The constructor validates the lists without copying them, so the parsed advisory associates packages with other packages' commits.
The lists should be initialized for each affected block, alongside its version constraints. Multiple Git ranges within the same block should still accumulate into that block's lists.
I checked existing OSV issues and PRs, including #2080, #2066, #2116 and the current parser PRs, and found no report of this attribution bug. Tests using the real parser and classifier fail for two distinct Git blocks and for a version-only block in either order. The control with multiple Git ranges in one block passes.
I'd like to work on the fix. Would you welcome a PR that scopes the lists to each affected block and adds these regression tests?
- Linguagem predominante
- Python
- Estrelas
- 717
- Forks
- 352
- Merge médio
- 6h 19min
- PRs com merge (30d)
- 6
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Sem modelo de pull request
- Sem guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de aboutcode-org/vulnerablecode
-
OSV parser drops all crates.io affected entries because the ecosystem mapping uses cargoTalvez já em andamento @Ashutosh-Panda2004 assumiu há 7 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
aboutcode-org/vulnerablecode#2485 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Docker Compose setup fails on wait-for-it host web:8000 and missing runtime .envTalvez já em andamento @Anurag-S1ngh assumiu há 10 dias. Aberta
Dificuldade 2/5 Meio dia Facilidade para iniciantes 77/100
aboutcode-org/vulnerablecode#2477 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
OVAL parser corrupts version bounds when the epoch is 10, 20 or the version contains "0:"Talvez já em andamento @Ashutosh-Panda2004 assumiu há 8 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
aboutcode-org/vulnerablecode#2474 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Docker build fails on Apple Silicon (arm64) — only x86_64 wheels pinned for extractcode-7z, extractcode-libarchive, typecode-libmagicTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
aboutcode-org/vulnerablecode#2426 ·
Mantenedores costumam responder em até 1 dia
-
Get NuGet package versions from federated PURL version data in https://github.com/aboutcode-data/Talvez livre de novo @Anshi321 assumiu há 29 dias e não há nenhum pull request aberto. Abertabug data-quality
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
aboutcode-org/vulnerablecode#2418 · 4 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de aboutcode-org/vulnerablecode
Issues semelhantes
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 78/100
QuantConnect/Documentation#2838 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
awslabs/route53-dynamic-dns-with-lambda#67 · 1 comentário ·
-
`SubAgents` returns a child run's `DeferredToolRequests` to the parent as a successful tool resultAbertabug pkg:harness
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
pydantic/pydantic-ai#12405 ·
Mantenedores costumam responder em até 1 dia
-
good first issue help wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
good first issue help wanted
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100