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

Review CVSS score handling & reporting #118

Merged
merged 2 commits into from
Aug 25, 2024

Conversation

lread
Copy link
Contributor

@lread lread commented Aug 24, 2024

For dependency-check:

Clj-watson now recognizes that multiple CVSS versions can be populated for a single CVE. We now:

  • to be cautious, choose the highest base score across all CVSS versions
  • include the CVSS version with the score

For github-advisory:

The github-advisory only contains a single CVSS entry. Clj-watson now extracts the CVSS revision from the CVSS "vectorString", when available.

For reports:

  • json & edn - now include the CVSS :version under :cvss
  • stdout - now includes version after score: CVSS: <score> (version <cvss version>)
  • sarif
    • added cvss with its score, version and severity under properties, this duplicates the existing (unfortunately named) security-severity which also holds the score
  • reworded slightly awkward summary message, ex:
    • old: Vulnerability identified as CVE-2022-4244 of score 7.5 and severity HIGH found.
    • new: Vulnerability CVE-2022-4244 with a score of 7.5 and severity of HIGH found.

Out of scope:

This change does not include support for deriving a CVSS score when it missing. This will be handled when we need it for decision making, like in #114.

Closes #112

lread added 2 commits August 24, 2024 11:26
For dependency-check:

Clj-watson now recognizes that multiple CVSS versions can be populated
for a single CVE. We now:
- to be cautious, choose the highest base score across all CVSS versions
- include the CVSS version with the score

For github-advisory:

The github-advisory only contains a single CVSS entry.
Clj-watson now extracts the CVSS revision from the CVSS "vectorString",
when available.

For reports:

- `json` & `edn` - now include the CVSS `:version` under `:cvss`
- `stdout` - now includes version after score: `CVSS: <score> (version <cvss version>)`
- `sarif`
  - added `cvss` with its `score`, `version` and `severity` under `properties`,
this duplicates existing the (unfortunately named) `security-severity`
which also holds the `score`
- reworded slightly awkward summary message, ex:
  - old: Vulnerability identified as CVE-2022-4244 of score 7.5 and severity HIGH found.
  - new: Vulnerability CVE-2022-4244 with a score of 7.5 and severity of HIGH found.

Out of scope:

This change does not include support for deriving a CVSS score when it
missing. This will be handled when we need it for decision making, like
in clj-holmes#114.

Closes clj-holmes#112
(some-> vulnerability .getCvssV3 .getCvssData .getBaseSeverity str)
(catch Exception _
nil)))
(defn ^:private base-score [cvss]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the old code, each of these chains of calls is wrapped in try / catch -- is there any danger that the call chains can actually throw or was the old code overly defensive?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My feeling was the old code was hiding potential issues.
I don't see why we should normally encounter an exception here (and didn't see a rationale in the git history).
If we learn otherwise, we can adapt and address.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I wasn't sure whether those methods were declared to throw exceptions.

@seancorfield seancorfield merged commit 98b040a into clj-holmes:main Aug 25, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Consider CVSS2 and CVSS4 scores
2 participants