google / google/osv-scanner

SARIF output always reports level=warning, ignoring the vulnerability's severity

Open Beginner friendly
#2,981 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
11k
Forks
792
Avg merge
1d 20h
Merged PRs (30d)
48

Description

The SARIF output (`--format sarif`) always sets every result's `level` to `"warning"`, no matter how severe the vulnerability is:

https://github.com/google/osv-scanner/blob/main/internal/output/sarif.go#L356

This is a bit odd because a CVSS score/rating is already computed a few lines above (for the `security-severity` rule property), so the data needed to pick a better level is right there in scope, just not used for `level` itself.

The practical effect: in GitHub code scanning (and any other SARIF consumer that cares about `level`), a critical RCE and a low-severity denial-of-service look identical — everything shows up as a plain warning, so you can't sort/filter by severity or have it show up as a blocking check for high-severity findings only.

Happy to send a small PR mapping the existing CVSS rating (Critical/High -> `error`, Medium/Low/unknown -> `warning`, matching current behavior when there's no score) if that sounds reasonable — wanted to check first per the contributing guide before opening one.

Contributor guide

Open the contributing guide

Research direction

Start in internal/output/sarif.go around line 356, where the SARIF result level is assigned, and inspect the CVSS rating computed a few lines above. Verify how the existing rating and no-score case are represented, then ensure the SARIF level reflects the stated severity mapping while preserving warning behavior without a score.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.