Skip to content

Include CVSS vectors and metadata in Finding model#5844

Open
AndreVirtimo wants to merge 1 commit intoDependencyTrack:masterfrom
Virtimo:feature/issue-5843
Open

Include CVSS vectors and metadata in Finding model#5844
AndreVirtimo wants to merge 1 commit intoDependencyTrack:masterfrom
Virtimo:feature/issue-5843

Conversation

@AndreVirtimo
Copy link
Contributor

Description

This PR enhances the Finding model to include critical vulnerability metadata previously missing from API responses and the Finding Packaging Format (FPF) export. It specifically adds CVSS v2/v3 vectors, external references, and the vulnerability publication date to the findings data structure. These additions are necessary to provide better context for downstream integrations, such as DefectDojo, which rely on vector strings for accurate risk assessment and publication dates for SLA tracking.

Addressed Issue

Closes #5843

Additional Details

To implement this enhancement, the following technical adjustments were made:

  • SQL Updates: The QUERY and QUERY_ALL_FINDINGS constants in Finding.java were expanded to select the new columns from the VULNERABILITY table.

  • Index Management: Because the result set from the SQL queries is handled as a flat Object[], indices in the Finding constructor and FindingsSearchQueryManager were shifted to accommodate the new columns.

  • Persistence Layer: FindingsSearchQueryManager was updated to correctly map the project UUID from the new index and include the new fields in the GROUP BY clause for grouped finding queries.

  • Test Maintenance: The test suite (FindingTest, FindingPackagingFormatTest, and FindingResourceTest) was updated to match the new constructor signatures and verify that the enriched data is correctly serialized in API responses.

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have added corresponding update logic
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

@owasp-dt-bot
Copy link

owasp-dt-bot commented Feb 26, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@AndreVirtimo
Copy link
Contributor Author

Is this a flaky test? On my local machine the test SnykAnalysisTaskTest is running without any issue.

@nscuro
Copy link
Member

nscuro commented Feb 27, 2026

Yeah the test seems flaky. I restarted the test workflow.

@AndreVirtimo
Copy link
Contributor Author

@nscuro do you have an idea why this test is failing?

@nscuro
Copy link
Member

nscuro commented Mar 3, 2026

@AndreVirtimo Yes, I fixed it via #5859. Please rebase with master.

@codacy-production
Copy link

codacy-production bot commented Mar 3, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.02% (target: -1.00%) 100.00% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (9b3d85c) 24751 20151 81.41%
Head commit (80b43d1) 24763 (+12) 20166 (+15) 81.44% (+0.02%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#5844) 32 32 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Expand the Finding and GroupedFinding objects to include all CVSS vectors
(v2, v3, and v4) as well as the OWASP RR vector. Additionally, external
references and vulnerability publication dates are included. These fields
are now available via the API and in the Finding Packaging Format (FPF)
export.

Currently, findings only include numerical scores, which prevents
downstream systems like DefectDojo from performing deep vector-based
risk assessments. Including advisory links and publication dates further
improves vulnerability context and SLA tracking in external management
platforms. The addition of all available vectors enhances this
capability significantly.

SQL queries, internal mappings (Finding, GroupedFinding), and the
persistence layer (FindingsSearchQueryManager) were adjusted to support
these new fields. The test suite was updated to ensure compatibility
with the modified data structure and shifted result set indices after
resolving merge conflicts from the integration of CVSSv4 support.

Signed-off-by: Andre Schlegel-Tylla <andre.schlegel-tylla@virtimo.de>
@AndreVirtimo
Copy link
Contributor Author

I've rebased the PR to include the CVSS v4 and OWASP RR vectors.

Once this is accepted, I'll submit another PR to update the DefectDojo parser.

@AndreVirtimo AndreVirtimo requested a review from nscuro March 4, 2026 14:45
@nscuro nscuro requested a review from Copilot March 5, 2026 17:40
@nscuro nscuro added the enhancement New feature or request label Mar 5, 2026
@nscuro nscuro added this to the 4.14.0 milestone Mar 5, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include CVSS vectors and additional vulnerability metadata in Finding API/FPF export

4 participants