dependency-track icon indicating copy to clipboard operation
dependency-track copied to clipboard

Support vulnerability matching against project-level CPEs

Open SchlegNi opened this issue 2 months ago • 3 comments

Current Behavior

Dependency-Track allows assigning a CPE to a project. However, vulnerabilities defined against that CPE do not appear to be matched to the project itself.

The vulnerability analysis documentation describes matching of components using CPEs and PURLs, but it is unclear whether project-level CPEs participate in vulnerability analysis.

Steps to Reproduce

  1. Create a project.
  2. Assign a unique CPE to the project.
  3. Create an internal vulnerability affecting that CPE.
  4. Trigger vulnerability analysis.
  5. Observe that the vulnerability is not associated with the project.

Proposed Behavior

If a project has an assigned CPE, Dependency-Track should be able to match vulnerabilities against that CPE, in the same way component CPEs are used during vulnerability analysis.

This is especially useful for:

  • First-party products maintained within Dependency-Track
  • Internal vulnerability tracking
  • Products that are represented by a project rather than a dedicated component

Additional Context

As a user, the ability to assign a CPE to a project suggests that the CPE represents the identity of the project itself.

If project-level CPEs are intentionally excluded from vulnerability matching, this should be documented clearly. Otherwise, extending vulnerability matching to project CPEs would improve support for first-party products and internally managed vulnerabilities.

Dependency-Track Version

v5.1.0

Checklist

SchlegNi avatar Sep 29 '26 07:09 SchlegNi

Hi! I'd like to work on this issue, could you please assign it to me?

For context: I'm a university student taking a software maintenance course, where we contribute to real open source projects and our progress is tracked by the instructor, so being assigned helps show I'm actively working on it. Of course, the change should be judged purely on its merits.

I've looked into the v5 analysis pipeline and I think I understand why this happens: PrepareVulnAnalysisActivity only selects rows from COMPONENT, so the project's own CPE never reaches the analyzers. And on the way back, ReconcileVulnAnalysisResultsActivity parses affects.ref as a component ID, with findings stored in COMPONENTS_VULNERABILITIES / FINDINGATTRIBUTION, which are keyed by component.

So supporting project CPEs isn't just a matter of adding the project to the BOM. A few directions I can see:

  1. Include the project as an additional BOM entry (with a distinguishable bomRef), only for analyzers that should see it (e.g. the internal analyzer, so project data isn't sent to external services), and then decide how to persist the match, which is the tricky part given the component-keyed finding tables.
  2. Introduce project-level findings, which would require schema, API and UI changes.

Is this something you'd like to support, and if so, which direction would you prefer? I'm happy to start with a test reproducing the scenario and go from there. Thanks!

benbbj avatar Sep 30 '26 13:09 benbbj

/assign-me

benbbj avatar Oct 03 '26 12:10 benbbj

Hi! Could someone please assign this issue to me directly? I need an assigned issue for my university course, otherwise it won't count and I'd have to look for a different one.

benbbj avatar Oct 05 '26 07:10 benbbj