Skip to content

BUG: Vulnerabilities check crashes if a vulnerable dependency is found via OSVScanner #1092

Closed
ossf/scorecard
#2704

Description

@pnacht

See https://api.securityscorecards.dev/projects/github.com/nebraska-dev/cronk

{
  "name":"Vulnerabilities",
  "score":-1,
  "reason":"internal error: vulnerabilitiesClient.ListUnfixedVulnerabilities: osvscanner.DoScan: vulnerabilities found",
  "details":null,
  "documentation": {
    "short":"Determines if the project has open, known unfixed vulnerabilities.", 
    "url": "https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#vulnerabilities"
}

The project has two vulnerable dependencies (requirements.txt).

Running on the CLI works:

$ scorecard --repo=nebraska-dev/cronk
# ...
| 8 / 10  | Vulnerabilities        | 2 existing vulnerabilities     | https://github.com/ossf/scorecard/blob/main/docs/checks.md#vulnerabilities        |
|         |                        | detected                       |                                                                                   |

Activity

  1. laurentsimon commented on Feb 21, 2023

    @laurentsimon
    Contributor

    @another-rex can you help troubleshoot the problem?

  2. laurentsimon commented on Feb 21, 2023

    @laurentsimon
    Contributor

    mhh, sorry. The CLI seems to be working just fine, and the problem may be in the cron job. @spencerschrock any ideas?

  3. spencerschrock commented on Feb 22, 2023

    @spencerschrock
    Member

    Those API results are recent, and the cron is currently paused. So the problem is with the scorecard action:

    https://github.com/nebraska-dev/cronk/actions/runs/4207314787/jobs/7301950046

  4. pnacht commented on Feb 22, 2023

    @pnacht
    ContributorAuthor

    Ah yes, sorry, I didn't make that clear in the issue. These results are from publishing with the Action. This is a toy project I'm developing, it's certainly not even on the cronjob's list.

  5. spencerschrock commented on Feb 22, 2023

    @spencerschrock
    Member
  6. spencerschrock commented on Feb 22, 2023

    @spencerschrock
    Member

    The version we pin in Scorecard's go.mod doesn't have the error returned when vulns are found:
    https://github.com/google/osv-scanner/blob/8aef1778b823497786296aca5595485ddac74943/pkg/osvscanner/osvscanner.go

    The scorecard-action go.mod has osv-scanner pinned differently:
    https://github.com/ossf/scorecard-action/blob/e38b1902ae4f44df626f11ba0734b14fb91f8f86/go.mod

    github.com/google/osv-scanner v1.0.1 // indirect
    

    and osv-scanner v1.0.1 does have the new behavior:
    https://github.com/google/osv-scanner/blob/a6c6cd756e0cf4fd858398976208145cb23e707b/pkg/osvscanner/osvscanner.go

  7. another-rex commented on Mar 9, 2023

    @another-rex

    Might want to reopen this, as it is not quite fixed yet until the scorecard action is also updated.

  8. spencerschrock commented on Mar 29, 2023

    @spencerschrock
    Member

    v2.1.3 has been released which has this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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