ApacheTomcatImporterPipeline truncates milestone fixed versions (e.g. 11.0.0-M6 -> 11.0.0)
Maintainer thường phản hồi trong vòng 5 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 85/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- data-engineering
Hướng nghiên cứu
Bắt đầu từ vulnerabilities/pipelines/v2_importers/apache_tomcat_importer.py tại parse_tomcat_security, nơi biểu thức chính quy Tomcat\s+([\d\.]+) cắt ngắn các phiên bản tại -. Chạy script tái hiện từ issue với PYTHONPATH=. DJANGO_SETTINGS_MODULE=vulnerablecode.settings để xác nhận fixed_in là 11.0.0 thay vì 11.0.0-M6. Hoàn thành khi cả tiêu đề milestone lẫn tiêu đề phiên bản thông thường đều được phân tích đúng, kèm các kiểm thử bao phủ 11.0.0-M6 và một phiên bản phát hành hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 722
- Fork
- 364
- Merge trung bình
- 1 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aboutcode-org/vulnerablecode
-
`gitlab_importer_v2` pipeline failing due to malformed YAML fileCó thể đã có người làm @Gowri213 đã nhận 1 ngày trước. Đang mởbug Pipeline: Failure Priority: high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
aboutcode-org/vulnerablecode#2523 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Pipeline run pages return 500 for a schedule whose pipeline is not registeredCó thể đã có người làm @sanchit955 đã nhận 8 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
aboutcode-org/vulnerablecode#2505 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Affected-by-advisories v2 page returns 500 for a purl with no matching packageCó thể đã có người làm @sanchit955 đã nhận 9 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
aboutcode-org/vulnerablecode#2501 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
OSV v3 parser shares introduced/fixed commit patches across affected packagesCó thể đã có người làm @Celestial-0 đã nhận 22 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
aboutcode-org/vulnerablecode#2489 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
OSV parser drops all crates.io affected entries because the ecosystem mapping uses cargoCó thể đã có người làm @Ashutosh-Panda2004 đã nhận 28 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
aboutcode-org/vulnerablecode#2485 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
Tất cả issue của aboutcode-org/vulnerablecode
Issue tương tự
-
app: scripts Bucket: KTLO status: backlog type: housekeeping
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
netbox-community/netbox-scripts#217 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
PermafrostDiscoveryGateway/water-timeseries-v2#312 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ClickHouse/dbt-clickhouse#829 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày