Affected-by-advisories v2 page returns 500 for a purl with no matching package
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 88/100
調査の方向性
vulnerabilities/views.py の AffectedByAdvisoriesListView.get_context_data から始め、get_fixed_package_details() の呼び出しをたどってください。テンプレートが get_item フィルターを使って空のマッピングをどのように処理するか確認し、該当する view のテストを実行してください。一致する package がない purl が HTTP 500 を返さず、結果ゼロで正常に表示されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 717
- フォーク
- 353
- 平均マージ
- 11時間 59分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aboutcode-org/vulnerablecode のほかの issue
-
OSV v3 parser shares introduced/fixed commit patches across affected packages対応中かも @Celestial-0 が 13 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
aboutcode-org/vulnerablecode#2489 ·
メンテナーはふだん 1 日以内に返信
-
OSV parser drops all crates.io affected entries because the ecosystem mapping uses cargo対応中かも @Ashutosh-Panda2004 が 19 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
aboutcode-org/vulnerablecode#2485 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Docker Compose setup fails on wait-for-it host web:8000 and missing runtime .env対応中かも @Anurag-S1ngh が 23 日前に担当しました。 オープン
難易度 2/5 半日 初心者へのやさしさ 77/100
aboutcode-org/vulnerablecode#2477 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
OVAL parser corrupts version bounds when the epoch is 10, 20 or the version contains "0:"対応中かも @Ashutosh-Panda2004 が 21 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
aboutcode-org/vulnerablecode#2474 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Docker build fails on Apple Silicon (arm64) — only x86_64 wheels pinned for extractcode-7z, extractcode-libarchive, typecode-libmagic再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
aboutcode-org/vulnerablecode#2426 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
aboutcode-org/vulnerablecode の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
Netcracker/qubership-ai-packages#266 ·
メンテナーはふだん 1 日以内に返信
-
PROCESSED_DATA_FOLDER: strip whitespace and treat empty as unset対応中かも @TorecLuik が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
NL-BioImaging/BIOMERO.importer#63 ·
メンテナーはふだん 1 日以内に返信
-
MLX training-complete chat/merge suggestions omit --backend mlx対応中かも @vaputa が今日担当しました。 オープンneeds-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
MakazhanAlpamys/Soup#2913 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:security effort:S priority:P3 status:needs-triage type:chore
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
randomparity/kdive#3657 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
aws/mcp-proxy-for-aws#476 ·
メンテナーはふだん 1 日以内に返信