Skip to content

fix: prefer vendor score if both nvd and vendor cvss v3 scores exist#2774

Merged
simar7 merged 2 commits intoaquasecurity:mainfrom
afdesk:fix/prefer-vendor-severity
Dec 4, 2025
Merged

fix: prefer vendor score if both nvd and vendor cvss v3 scores exist#2774
simar7 merged 2 commits intoaquasecurity:mainfrom
afdesk:fix/prefer-vendor-severity

Conversation

@afdesk
Copy link
Copy Markdown
Contributor

@afdesk afdesk commented Oct 7, 2025

Description

This PR updates the logic for determining the score of a vulnerability when both vendor and NVD CVSS v3 scores are available. From now on, Trivy-operator will prefer the vendor score if both scores are present.

Effectively, this change reverts the behavior introduced in PR #1080, but since PR #1639 introduced a significant refactor, it’s clearer and safer to implement this as a new PR rather than a direct revert.

PR #1080 was originally merged to handle a specific edge case where the vendor CVSS score differed significantly from the NVD score, and preference was given to NVD. However, this approach turned out to be suboptimal, as vendor-provided severities are generally more accurate and authoritative. Read more about Severity Selection here.

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@simar7
Copy link
Copy Markdown
Member

simar7 commented Oct 7, 2025

PR #1080 was originally merged to handle a specific edge case where the vendor CVSS score differed significantly from the NVD score, and preference was given to NVD. However, this approach turned out to be suboptimal, as vendor-provided severities are generally more accurate and authoritative. Read more about Severity Selection here.

@afdesk what do you mean it was written to handle a case where the scores differed significantly? Do you have an example of such a case? If so, after this PR won't the same happen again?

@afdesk
Copy link
Copy Markdown
Contributor Author

afdesk commented Oct 7, 2025

PR #1080 was originally merged to handle a specific edge case where the vendor CVSS score differed significantly from the NVD score, and preference was given to NVD. However, this approach turned out to be suboptimal, as vendor-provided severities are generally more accurate and authoritative. Read more about Severity Selection here.

@afdesk what do you mean it was written to handle a case where the scores differed significantly? Do you have an example of such a case? If so, after this PR won't the same happen again?

yes, there is a sample from #1079 - CVE-2023-23914.
it has CRITICAL severity in NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-23914
but MODERATE from RedHat: https://access.redhat.com/security/cve/cve-2023-23914

based on Severity selection:

NVD doesn't know how the vendor distributes the software. Red Hat evaluates the severity more accurately.

@pacoguzman
Copy link
Copy Markdown

Hi there, I've been checking some pages on https://avd.aquasec.com/ for example https://avd.aquasec.com/nvd/2023/cve-2023-45853 to trying to understand this.

If I'm not wrong if trivy-operator considers in those cases redhat score, all the pages like that one must be changed isn't it?

@afdesk
Copy link
Copy Markdown
Contributor Author

afdesk commented Oct 9, 2025

Hi @pacoguzman! sorry for misunderstanding, what do you mean here " all the pages like that one must be changed"?

as for me, it means NVD severity is CRITICAL (source: NVD), but RedHat thinks this cve is MODERATE for its distros
CVE-2023-45853

do i miss something? thanks!

@pacoguzman
Copy link
Copy Markdown

pacoguzman commented Oct 9, 2025 via email

@afdesk afdesk marked this pull request as ready for review October 9, 2025 08:00
@afdesk afdesk requested a review from simar7 as a code owner October 9, 2025 08:00
@afdesk
Copy link
Copy Markdown
Contributor Author

afdesk commented Oct 9, 2025

@pacoguzman no problem! feel glad to help )

@afdesk afdesk added this to the v0.30.0 milestone Oct 17, 2025
@simar7
Copy link
Copy Markdown
Member

simar7 commented Dec 4, 2025

The change LGTM, I'm just surprised we missed it so far. I'm sure after we release this, people will see results differently and might have some questions related to it as severities will change for cases where vendor rates it differently.

@simar7 simar7 merged commit 3e530e1 into aquasecurity:main Dec 4, 2025
8 checks passed
@afdesk afdesk deleted the fix/prefer-vendor-severity branch February 16, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants