Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to hydrate an OSV response due to an unexpected severity type format #2335

Closed
LeSuisse opened this issue Jun 21, 2024 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@LeSuisse
Copy link

Full error: API query failed: failed to hydrate OSV response: json: cannot unmarshal number into Go struct field Severity.severity.type of type models.SeverityType

One of the dependency in the project I was scanning was vulnerable to GHSA-25hc-qcg6-38wj.

The API response exposes the severity in the CVSS 4 format:

$ curl https://api.osv.dev/v1/vulns/GHSA-25hc-qcg6-38wj | jq .severity
[
  {
    "type": "CVSS_V3",
    "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
  },
  {
    "type": 3,
    "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"
  }
]

The code seems to expects the string CVSS_V4 instead of the number 3 in this situation.

@another-rex
Copy link
Contributor

This seems to be an issue with our API endpoint, I'll transfer the issue to our osv.dev repo.

@another-rex another-rex transferred this issue from google/osv-scanner Jun 24, 2024
@another-rex another-rex added the bug Something isn't working label Jun 24, 2024
@hogo6002
Copy link
Contributor

same as #2331

@michaelkedar
Copy link
Member

The API should now be fixed to return "type": "CVSS_V4"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants