Skip to content

GIT ecosystem: digit-free version strings fuzzy-match digit-free tags #5230

@andrew

Description

@andrew

normalize_tag returns "" for any input with no decimal digit, then _match_versions does "" in normalize_tags(vers) — true whenever vers contains a digit-free tag.

$ curl -s -X POST https://api.osv.dev/v1/querybatch \
    -d '{"queries":[{"package":{"name":"https://github.com/unicode-org/icu","ecosystem":"GIT"},"version":"deadbeef"}]}' \
  | jq '.results[0].vulns | length'
7

icu has a last-cvs-commit tag. normalize_tag("deadbeef") == normalize_tag("last-cvs-commit") == "", so "deadbeef" matches every CVE whose range encompasses that tag. "deadbeef0" returns 0.

Happy to send a PR — guard the check on normalize_tag(version) being non-empty?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions