Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

OVAL parser corrupts version bounds when the epoch is 10, 20 or the version contains "0:"

Đang mở Phù hợp với người mới
#2,474 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Ashutosh-Panda2004 đang làm issue này rồi.

Từ ngày 26/10/2026.

  • #2483 của @Ashutosh-Panda2004 — đang mở

Đá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
76/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
backend, security

Hướng nghiên cứu

Bắt đầu với get_version_range_from_state trong vulnerabilities/oval_parser.py và theo dõi cách hàm này tạo các khoảng phiên bản từ văn bản trạng thái OVAL. Bổ sung kiểm thử hồi quy cho các trường hợp epoch được liệt kê, bao gồm 10:, 20: và một 0: nằm bên trong, sau đó chạy các kiểm thử parser liên quan. Công việc được xem là hoàn tất khi chỉ 0: mặc định ở đầu bị loại bỏ và phần nội dung phiên bản còn lại không thay đổi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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   # False

The 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.

Ngôn ngữ chính
Python
Star
716
Fork
347
Merge trung bình
12 giờ 15 phút
Pull request đã merge (30 ngày)
9

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aboutcode-org/vulnerablecode

Tất cả issue của aboutcode-org/vulnerablecode

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.