fix: report unparseable CVSS vectors instead of a missing score - #325
Draft
vibgrate-team wants to merge 1 commit into
Draft
vibgrate-team wants to merge 1 commit into
vibgrate-team wants to merge 1 commit into
Conversation
A severity vector that fails to parse now leaves the numeric score unset and emits a stable warning naming the failure and what to supply instead. An absent vector stays absent, and a valid CVSS v3 base vector still scores as before. Fixes #240 Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vg scan --vulnstreated a CVSS or severity vector it could not parse the same as an advisory that never had a score: the numeric CVSS field was left null, and nothing said the vector had failed. A real zero (every impact metric None) was also easy to confuse with that silence.A vector that is present but does not parse now leaves the score unset and adds a warning,
vibgrate/cvss-vector, on the advisory, in findings, and in SARIF. The warning names the parse failure and what to supply instead (a CVSS v3.0 or v3.1 base vector, or a qualitative severity). It does not echo the raw value, so unrelated text in that field is not copied into the report.Related issues
Fixes #240
Checklist
pnpm testpassespnpm lintis cleanpnpm typecheckis cleangraph.json/ report output (content-hashed IDs, stable sorts; no time, randomness, or filesystem-order dependence)git commit -s, DCO)Notes for reviewers
The numeric helper
cvssV3BaseScorestill returnsnullwhen it cannot score a vector. Callers that need to tell a parse failure from an absent score useparseCvssV3, which is what the OSV and package-manifest advisory paths now do.