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
平均合并
12 小时 15 分钟
30 天内合并 PR
9

环境准备

  • 提供 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 摘要。