Affected-by-advisories v2 page returns 500 for a purl with no matching package
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 88/100
Hướng nghiên cứu
Bắt đầu tại vulnerabilities/views.py, ở AffectedByAdvisoriesListView.get_context_data, rồi lần theo lời gọi đến get_fixed_package_details(). Kiểm tra cách template xử lý một mapping rỗng thông qua bộ lọc get_item, sau đó chạy các bài kiểm thử view liên quan. Hoàn thành khi một purl không có package khớp được render thành công với không kết quả nào thay vì trả về HTTP 500.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Visiting the affected-by-advisories v2 page for a package that is not in the database returns a 500 instead of an empty result list.
Steps to reproduce
- Open
/affected-by-advisories/v2/pkg:pypi/[email protected](after the Altcha challenge). - The page returns HTTP 500.
What happens
AffectedByAdvisoriesListView.get_context_data looks the purl up with PackageV2.objects.for_purl(purl).first(), which returns None when there is no matching package, and passes it straight to get_fixed_package_details(). That helper dereferences package.affected_in_impacts, so it raises:
AttributeError: 'NoneType' object has no attribute 'affected_in_impacts'
(vulnerabilities/views.py:441)
Expected behaviour
The page should render with zero results, the same as any other purl with no affecting advisories. A mistyped or not-yet-imported package link should not 500.
Notes
- The same helper is also used by
PackageV2Details, but thereself.objectis neverNone(the detail view 404s first), so only this list view is affected. - The fix is a
Noneguard inget_fixed_package_details()returning an empty mapping, which the template already handles through theget_itemfilter.
- Ngôn ngữ chính
- Python
- Star
- 717
- Fork
- 353
- Merge trung bình
- 11 giờ 59 phút
- 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
- Đọ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
-
OSV v3 parser shares introduced/fixed commit patches across affected packagesCó thể đã có người làm @Celestial-0 đã nhận 13 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 1 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 19 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 1 ngày
-
Docker Compose setup fails on wait-for-it host web:8000 and missing runtime .envCó thể đã có người làm @Anurag-S1ngh đã nhận 23 ngày trước. Đang mở
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 77/100
aboutcode-org/vulnerablecode#2477 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
OVAL parser corrupts version bounds when the epoch is 10, 20 or the version contains "0:"Có thể đã có người làm @Ashutosh-Panda2004 đã nhận 21 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#2474 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Docker build fails on Apple Silicon (arm64) — only x86_64 wheels pinned for extractcode-7z, extractcode-libarchive, typecode-libmagicCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
aboutcode-org/vulnerablecode#2426 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của aboutcode-org/vulnerablecode
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Netcracker/qubership-ai-packages#266 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
PROCESSED_DATA_FOLDER: strip whitespace and treat empty as unsetCó thể đã có người làm @TorecLuik đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
NL-BioImaging/BIOMERO.importer#63 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
MLX training-complete chat/merge suggestions omit --backend mlxCó thể đã có người làm @vaputa đã nhận hôm nay. Đang mởneeds-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
MakazhanAlpamys/Soup#2913 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:security effort:S priority:P3 status:needs-triage type:chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
randomparity/kdive#3657 ·
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 78/100
aws/mcp-proxy-for-aws#476 ·
Maintainer thường phản hồi trong vòng 1 ngày