ApacheTomcatImporterPipeline truncates milestone fixed versions (e.g. 11.0.0-M6 -> 11.0.0)
維護者通常 5 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 85/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- python
研究方向
從 vulnerabilities/pipelines/v2_importers/apache_tomcat_importer.py 中的 parse_tomcat_security 開始,其中正規表示式 Tomcat\s+([\d\.]+) 會在 - 處截斷版本號。使用 PYTHONPATH=. DJANGO_SETTINGS_MODULE=vulnerablecode.settings 執行 issue 中的重現腳本,確認 fixed_in 為 11.0.0 而非 11.0.0-M6。完成標準是里程碑版本與一般版本標題都能正確解析,且測試涵蓋 11.0.0-M6 與一個既有的發布版本。
由索引模型根據 Issue 內容生成。
描述
parse_tomcat_security in vulnerabilities/pipelines/v2_importers/apache_tomcat_importer.py extracts the fixed version from headings like "Fixed in Apache Tomcat 11.0.0-M6" with:
re.search(r"Tomcat\s+([\d\.]+)", header.get_text())
[\d\.]+ only matches digits and dots, so it stops at the - and milestone/pre-release fixed versions are truncated: 11.0.0-M6 becomes 11.0.0.
Reproduction
import django
django.setup()
from vulnerabilities.pipelines.v2_importers.apache_tomcat_importer import parse_tomcat_security
HTML = """
<h3 id="Fixed_in_Apache_Tomcat_11.0.0-M6">Fixed in Apache Tomcat 11.0.0-M6</h3>
<div class="text">
<p><strong>Important: Information disclosure</strong>
<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-34981">CVE-2023-34981</a></p>
<p>Affects: 11.0.0-M5</p>
</div>
"""
for advisory in parse_tomcat_security(HTML):
print("fixed_in:", advisory.fixed_in)
Run with PYTHONPATH=. DJANGO_SETTINGS_MODULE=vulnerablecode.settings python repro.py on current main.
Actual: fixed_in: 11.0.0
Expected: fixed_in: 11.0.0-M6
Impact
On https://tomcat.apache.org/security-11.html, 7 "Fixed in" headings use milestone versions (11.0.0-M3, M5, M6, M11, M12, M17, M21). All of them collapse to 11.0.0, which is also a real release heading on the same page. So these advisories get the wrong fixed version, and the fixed-version constraint ends up as !=11.0.0 instead of !=11.0.0-M6.
I noticed this while working on #2528 (PR #2531). I'd like to work on a fix with tests if that's okay.
- 主要語言
- Python
- 星號
- 722
- 分支
- 364
- 平均合併
- 1 天 23 小時
- 30 天內合併 PR
- 3
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
aboutcode-org/vulnerablecode 的其他 Issue
-
`gitlab_importer_v2` pipeline failing due to malformed YAML file可能已有人在做 @Gowri213 於 1 天前認領。 未關閉bug Pipeline: Failure Priority: high
難度 2/5 1-3 小時 新手友好度 68/100
aboutcode-org/vulnerablecode#2523 · 1 則留言 ·
維護者通常 5 天內回覆
-
Pipeline run pages return 500 for a schedule whose pipeline is not registered可能已有人在做 @sanchit955 於 8 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 85/100
aboutcode-org/vulnerablecode#2505 ·
維護者通常 5 天內回覆
-
Affected-by-advisories v2 page returns 500 for a purl with no matching package可能已有人在做 @sanchit955 於 9 天前認領。 未關閉
難度 1/5 1 小時以內 新手友好度 88/100
aboutcode-org/vulnerablecode#2501 ·
維護者通常 5 天內回覆
-
OSV v3 parser shares introduced/fixed commit patches across affected packages可能已有人在做 @Celestial-0 於 22 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
aboutcode-org/vulnerablecode#2489 ·
維護者通常 5 天內回覆
-
OSV parser drops all crates.io affected entries because the ecosystem mapping uses cargo可能已有人在做 @Ashutosh-Panda2004 於 28 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
aboutcode-org/vulnerablecode#2485 · 1 則留言 ·
維護者通常 5 天內回覆
查看 aboutcode-org/vulnerablecode 的全部 Issue
相似的 Issue
-
app: scripts Bucket: KTLO status: backlog type: housekeeping
難度 2/5 1-3 小時 新手友好度 68/100
netbox-community/netbox-scripts#217 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 64/100
-
難度 2/5 1-3 小時 新手友好度 62/100
PermafrostDiscoveryGateway/water-timeseries-v2#312 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 72/100
ClickHouse/dbt-clickhouse#829 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆