OVAL parser corrupts version bounds when the epoch is 10, 20 or the version contains "0:"
维护者通常 1 天内回复
评估
调研方向
从 vulnerabilities/oval_parser.py 中的 get_version_range_from_state 入手,追踪它如何根据 OVAL 状态文本构建版本范围。为列出的 epoch 情况添加回归测试,包括 10:、20: 和嵌入其中的 0:,然后运行相关的解析器测试。完成标准是只移除开头默认的 0:,其余版本内容保持不变。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 716
- 派生
- 347
- 平均合并
- 12 小时 15 分钟
- 30 天内合并 PR
- 9
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aboutcode-org/vulnerablecode 的其他 Issue
-
OSV parser drops all crates.io affected entries because the ecosystem mapping uses cargo可能已有人在做 @Ashutosh-Panda2004 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
aboutcode-org/vulnerablecode#2485 · 1 条评论 ·
维护者通常 1 天内回复
-
Docker Compose setup fails on wait-for-it host web:8000 and missing runtime .env可能已有人在做 @Anurag-S1ngh 于 5 天前认领。 未关闭
难度 2/5 半天 新手友好度 77/100
aboutcode-org/vulnerablecode#2477 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
aboutcode-org/vulnerablecode#2426 ·
维护者通常 1 天内回复
-
Get NuGet package versions from federated PURL version data in https://github.com/aboutcode-data/可能重新可做 @Anshi321 于 24 天前认领,目前没有进行中的 PR。 未关闭bug data-quality
难度 2/5 1-3 小时 新手友好度 72/100
aboutcode-org/vulnerablecode#2418 · 4 条评论 ·
维护者通常 1 天内回复
-
We do not collect the affected range for Gitlab advisories可能已有人在做 @akashrajeev 于 11 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
aboutcode-org/vulnerablecode#2412 · 1 条评论 ·
维护者通常 1 天内回复
查看 aboutcode-org/vulnerablecode 的全部 Issue
相似的 Issue
-
changelog investigate
难度 2/5 1-3 小时 新手友好度 67/100
ramnes/notion-sdk-py#433 ·
-
docs pkg:core
难度 1/5 1 小时以内 新手友好度 84/100
pydantic/pydantic-ai#11929 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
intake/intake-esm#789 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
MemMachine/MemMachine#1877 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
openedx/openedx-authz#579 ·
维护者通常 1 天内回复