Skip to content

bun.lock: git dependencies with short commit hashes cause "Invalid hash" API error #2683

@epipav

Description

@epipav

Bug

Scanning a project with a bun.lock that contains git dependencies with short commit refs causes the scan to fail:

error when retrieving vulns: client error: status="400 Bad Request"
body={"code":3,"message":"Invalid hash."}

Reproduction

  1. Clone https://github.com/activepieces/activepieces
  2. Run:
    osv-scanner scan ./ --format json -L bun.lock .
  3. Observe the error:
    error when retrieving vulns: client error: status="400 Bad Request" body={"code":3,"message":"Invalid hash."}
    

The repo's bun.lock contains the following git dependency with a short hash:

"@dust-tt/client/@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@github:dust-tt/typescript-sdk#bca26e4", ...]

Version

osv-scanner --version
osv-scanner version: 2.3.3
osv-scalibr version: 0.4.2
commit: n/a
built at: n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions