Skip to content

Support querying by both repo URL and commit hash #3463

@oliverchang

Description

@oliverchang

We've seen a few edge cases where we have incorrect git commit matching because of forking:

If there's an advisory in a forked repository with introduced: 0, fixed: SHA, then it will mark the original history of the forked-from project as vulnerable also, which is likely incorrect.

To fix this, we should support queries of the form:

curl -d '{"commit": "sha", "repo": "https://github.com/foo/bar"}' "https://api.osv.dev/v1/query"

Where we reject records where the repo doesn't match.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiAPI-related infrastructurebacklogImportant but currently unprioritizedbugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions