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\.]+) がバージョンを - で切り捨てています。issue の再現スクリプトを PYTHONPATH=. DJANGO_SETTINGS_MODULE=vulnerablecode.settings を付けて実行し、fixed_in が 11.0.0-M6 ではなく 11.0.0 になることを確認してください。マイルストーン形式と通常のバージョン見出しの両方が正しく解析され、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時間
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信