osv.dev icon indicating copy to clipboard operation
osv.dev copied to clipboard

Improve the UX of failed vulnerability retrieval by the API

Open andrewpollock opened this issue 2 years ago • 4 comments

Describe the bug Users try to retrieve a vulnerability (typically a CVE) by the API that the web interface reports as an alias of another vulnerability and that retrieval fails because the CVE record does not exist in OSV.dev

To Reproduce Steps to reproduce the behaviour:

  1. View a vulnerability record on OSV.dev with an (unlinked) alias to a CVE
  2. Attempt to retrieve that CVE via the API
  3. Get a 404/Bug not found response from the API

Expected behaviour The user receives some pointers to documentation to assist with interpreting the search failure.

My initial thoughts:

  • include a link to https://osv.dev/faq in the message text
  • add a new FAQ entry about bugs not found/404s from the API
  • add to https://google.github.io/osv.dev/post-v1-query/ about querying by first class vulnerabilities versus aliases (also discussed in #1016)

Screenshots

Contrived example:

$ GET -s https://api.osv.dev/v1/vulns/CVE-2025-0001
404 Not Found
{"code":5,"message":"Bug not found."}

andrewpollock avatar May 23 '24 22:05 andrewpollock

This issue has not had any activity for 60 days and will be automatically closed in two weeks

github-actions[bot] avatar Jul 30 '24 08:07 github-actions[bot]

Can I pick this issue up?

Vedthakar avatar Apr 04 '26 18:04 Vedthakar

@Vedthakar yes! please feel free to work on this issue.

cuixq avatar Apr 07 '26 00:04 cuixq

Adding one related case I ran into while checking KEV-to-package coverage.

It is not exactly the 404 case from this issue, because the direct CVE lookup does return a record. The confusing part is that the returned record can look like it has no package-level coverage, while a package query does return an aliased advisory for the same CVE.

Small repro:

GET /v1/vulns/CVE-2025-32432 returns a record with GIT ranges for https://github.com/craftcms/cms, but no affected.package.ecosystem/name.

But this package query:

{
  "package": {
    "ecosystem": "Packagist",
    "name": "craftcms/cms"
  }
}

returns GHSA-f3gw-9ww9-jmc3, which aliases CVE-2025-32432.

I saw the same pattern in a few recent KEV entries:

  • CVE-2025-32432 -> Packagist:craftcms/cms -> GHSA-f3gw-9ww9-jmc3
  • CVE-2025-54068 -> Packagist:livewire/livewire -> GHSA-29cq-5w36-x7w3
  • CVE-2026-33634 -> Go:github.com/aquasecurity/trivy -> GHSA-69fq-xp46-6x23, GO-2026-4919
  • CVE-2025-34291 -> PyPI:langflow -> GHSA-577h-p2hh-v4mv, PYSEC-2025-78
  • CVE-2026-33017 -> PyPI:langflow -> GHSA-vwmf-pq79-vjvx
  • CVE-2025-68613 -> npm:n8n -> GHSA-v98v-ff95-f3cp

So the scanner-facing package query path looks fine here. The place where I tripped up was using GET /v1/vulns/{CVE} to estimate whether a KEV CVE has package-level OSV coverage. That can make it look like a package-coordinate gap even when the package query already covers the CVE through an alias.

If this is expected behavior, would it make sense to document the distinction somewhere near the API docs/FAQ for this issue?

I am not suggesting that these direct CVE records need package coordinates if package query is the intended source of truth. I mainly want to avoid filing false-positive data-quality reports when the right answer is "query the package / resolve aliases instead."

hunterx-code avatar Jun 27 '26 07:06 hunterx-code