Elixir Security importer drops affected packages when an advisory lists no patched or unaffected versions

Đang mở Phù hợp với người mới
#2,540 0 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 5 ngày

@sanchit955 đang làm issue này rồi.

Từ ngày 27/11/2026.

  • #2541 của @sanchit955 — đ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
82/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, security

Hướng nghiên cứu

Bắt đầu với luồng process_file của trình nhập Elixir Security và quá trình round-trip của advisory qua AdvisoryDataV2.from_dict. Tái hiện bằng một advisory tối giản có CVE hợp lệ và một gói nhưng không có danh sách phiên bản, rồi so sánh cách xử lý với các bản sửa lỗi #2392 và #2521. Hoàn tất khi advisory vẫn được ghi nhận, mục gói không sử dụng được bị bỏ qua và không có dải không hợp lệ nào được tuần tự hóa.

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

Mô tả

An Elixir Security advisory that lists no unaffected_versions and no patched_versions — a normal data shape, a disclosed vulnerability with no patched version yet — produces an AffectedPackageV2 whose version range serializes as 'vers:hex/'.

VersionRange.from_string('vers:hex/') raises ValueError: 'vers:hex/' specifies no version range constraints., so the importer logs Cannot create AffectedPackage with invalid or unknown range and the package is dropped when the advisory round-trips through AdvisoryDataV2.from_dict.

Reproduction: a minimal advisory YAML with a valid CVE and package but no version lists. process_file yields the advisory with affected_version_range == 'vers:hex/', and the package disappears on round-trip.

This is the same defect family as #2387 (Gentoo / apache_httpd), fixed for apache_httpd in #2392 and for Gentoo in #2521.

Fix: build the range only when constraints are non-empty; when there is no usable range, log and skip the package entry. The advisory itself is still recorded (with an empty affected_packages list).

Note: the package is not recorded as affected for that advisory. A deeper fix in AffectedPackageV2.from_dict (tolerate a None range instead of dropping the package) is a behaviour change beyond the importer — flagging for maintainer decision, not bundling it here.

Ngôn ngữ chính
Python
Star
722
Fork
364
Merge trung bình
2 ngày 22 giờ
Pull request đã merge (30 ngày)
2

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.