Skip to content

Comments

feat(vex): add support for OWASP Risk Ratings in VEX documents#10193

Open
fahedouch wants to merge 2 commits intoaquasecurity:mainfrom
fahedouch:feature/vex-ratings-support
Open

feat(vex): add support for OWASP Risk Ratings in VEX documents#10193
fahedouch wants to merge 2 commits intoaquasecurity:mainfrom
fahedouch:feature/vex-ratings-support

Conversation

@fahedouch
Copy link

Why this change?

The CycloneDX spec now recommends that tools consider ratings when prioritizing vulnerabilities (spec PR #722):

"Consumers SHOULD consider ratings in prioritization decisions"

This PR lets Trivy use context-aware OWASP Risk Ratings from CycloneDX VEX documents. These ratings are generated by tools like vens (available in the Trivy plugin index) and provide context-specific risk scores based on factors like network exposure, data sensitivity, etc.

What's changed

  • Added an OWASPRating field to DetectedVulnerability (optional with omitempty)
  • VEX processing now enriches vulnerabilities with OWASP ratings from CycloneDX VEX ratings blocks

Example output

{
  "VulnerabilityID": "CVE-2011-3374",
  "Severity": "LOW",
  "OWASPRating": {
    "score": 27.5,
    "severity": "medium",
    "vector": "SL:7/M:7/O:7/S:7/ED:4/EE:4/A:4/ID:5/LC:5/LI:5/LAV:5/LAC:5/FD:5/RD:5/NC:5/PV:5"
  }
}

Why this matters

This brings context-aware vulnerability prioritization to Trivy. The same CVE can have different risk scores depending on how and where it's deployed. For example, a vulnerability in an internet-facing service is way more critical than the same one buried in an isolated internal component.

This complements the generic CVSS approach with environment-specific assessment, which aligns with what the CycloneDX spec now recommends. And it's fully backward compatible, so existing workflows won't be affected.

Remove this section if you don't have related PRs.

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • 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).

Signed-off-by: Fahed Dorgaa <fahed.dorgaa@gmail.com>
@fahedouch fahedouch requested a review from knqyf263 as a code owner February 13, 2026 18:27
…re specified

Signed-off-by: Fahed Dorgaa <fahed.dorgaa@gmail.com>
@github-actions github-actions bot added the apidiff Indicates Go API changes relevant to library consumers (CLI compatibility may be unaffected) label Feb 13, 2026
@github-actions
Copy link

github-actions bot commented Feb 13, 2026

📊 API Changes Detected

Semver impact: major

github.com/aquasecurity/trivy/pkg/types
  Compatible changes:
  - DetectedVulnerability.OWASPRating: added
  - OWASPRating: added

github.com/aquasecurity/trivy/pkg/vex
  Incompatible changes:
  - VEX.EnrichWithRatings: added
  Compatible changes:
  - (*CSAF).EnrichWithRatings: added
  - (*CycloneDX).EnrichWithRatings: added
  - (*OpenVEX).EnrichWithRatings: added
  - (*RepositorySet).EnrichWithRatings: added
  - (*SBOMReferenceSet).EnrichWithRatings: added
  - Statement.OWASPRating: added

@aqua-bot aqua-bot requested a review from a team February 13, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apidiff Indicates Go API changes relevant to library consumers (CLI compatibility may be unaffected)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant