Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

OSV parser drops all crates.io affected entries because the ecosystem mapping uses cargo

未關閉 適合新手
#2,485 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@Ashutosh-Panda2004 已經在處理了。

開始於 2026年10月27日。

  • #2486 來自 @Ashutosh-Panda2004 —— 未關閉

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
76/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
python
領域
security

研究方向

從 vulnerabilities/importers/osv.py 開始,檢查 PURL_TYPE_BY_OSV_ECOSYSTEM 以及 issue 中描述的 OSV 生態系統查找邏輯。參考 serde 範例,為一則 crates.io 安全公告新增測試涵蓋。完成標準是 crates.io 項目會產生包含修復版本的 cargo 套件 URL,且現有的 cargo 鍵仍可正常運作。

由索引模型根據 Issue 內容生成。

描述

I found that every crates.io advisory is silently dropped by the OSV parser.

In vulnerabilities/importers/osv.py, the PURL_TYPE_BY_OSV_ECOSYSTEM mapping is keyed by "cargo", but the ecosystem name in OSV data is "crates.io". The lookup lowercases the ecosystem string and finds no match for crates.io, so no package URL is built for the entry and the affected entry is skipped entirely.

I ran the parser on OSV advisories for serde and got:

F) ecosystem "crates.io", fixed version 1.0.0
   -> []                                   (dropped)
G) ecosystem "Cargo" (not the real OSV ecosystem name), fixed version 1.0.0
   -> pkg:cargo/serde with fixed 1.0.0     (works)

So the downstream path works end to end; only the ecosystem name in the mapping is wrong. This also means the cargo support that GithubOSVImporter.supported_ecosystems advertises never actually happens for real OSV data.

The fix I have in mind is to add a "crates.io": "cargo" entry to PURL_TYPE_BY_OSV_ECOSYSTEM, keeping the existing "cargo" key. Happy to raise a PR if this approach sounds right.

主要語言
Python
星號
716
分支
347
平均合併
13 小時 47 分鐘
30 天內合併 PR
8

環境準備

  • 提供 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 沒有貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

aboutcode-org/vulnerablecode 的其他 Issue

查看 aboutcode-org/vulnerablecode 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。