ApacheTomcatImporterPipeline truncates milestone fixed versions (e.g. 11.0.0-M6 -> 11.0.0)

オープン 初心者向け
#2,533 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 5 日以内に返信

@nikolya-ctrl がすでに取り組んでいます。

2026年11月25日 から。

  • #2534 @nikolya-ctrl による — オープン

評価

難易度
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 ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aboutcode-org/vulnerablecode のほかの issue

aboutcode-org/vulnerablecode の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。