Skip to content

Conversation

chadlwilson
Copy link
Collaborator

@chadlwilson chadlwilson commented Sep 24, 2025

Description of Change

NVD appear to have updated their search interface in a way that breaks our earlier generated deep links from reports etc.

The new interface is similar, but the URLs build CPE identifiers rather than individual components. The "applicability" mode appears to be correct (otherwise you get matches where a given vuln is running on/with a CPE but not affecting that CPE?)

Version-specific search
https://nvd.nist.gov/vuln/search#/nvd/home?sortOrder=3&sortDirection=2&cpeFilterMode=applicability&cpeName=cpe:2.3:a:vmware:spring_framework:5.0.0:*:*:*:*:*:*:*&resultType=records

Broad search
https://nvd.nist.gov/vuln/search#/nvd/home?sortOrder=3&sortDirection=2&cpeFilterMode=applicability&cpeName=cpe:2.3:a:vmware:spring_framework:*:*:*:*:*:*:*:*&resultType=records

Open questions

  • should I add a default sort order? Order seems random/database order otherwise.
    • Sort by identifier? descending? ascending?
    • Published Date? Descending ✅
  • Need to update URLs inside the HTML and Jenkins report templates?
    • These ones go to URLs like this - but they are totally broken/404ed so I am not sure if that recently happened or if they have been broken for a while.

Related issues

Have test cases been added to cover the new functionality?

yes

Example report generated via Gradle plugin locally:
dependency-check-report.html

@boring-cyborg boring-cyborg bot added core changes to core tests test cases labels Sep 24, 2025
@jeremylong
Copy link
Collaborator

  1. We should add a sort order - published date is probably good enough, descending if possible (i.e., newest first).
  2. If the links are broken in the HTML report, we likely need to fix them as well. The easiest approach would be to expose the nvdSearchUrlFor() methods in the ReportTool, as it is already added to the Velocity context.

@jeremylong jeremylong added this to the 12.1.7 milestone Sep 25, 2025
@chadlwilson
Copy link
Collaborator Author

chadlwilson commented Sep 25, 2025

Thanks @jeremylong - I didn’t look at the 2nd one at all, it turned out a bit messier than i thought and I ran out of time. I couldn’t work out what the urls are used for in the CpeIdentifier object if not used later to actually render the report, so it needed more digging as to the reason for the 404ing URLs and which section of the report those ones appear in.

@jeremylong
Copy link
Collaborator

Understood, the HTML reports contain code like:

  <p>Vulnerable Software &amp; Versions:<ul>
      <li class="vs$vsctr"><a target="_blank" href="https://web.nvd.nist.gov/view/vuln/search-results?adv_search=true&cves=on&cpe_version=$enc.url($vuln.matchedVulnerableSoftware.toCpe22Uri())">$enc.html($vuln.matchedVulnerableSoftware.toString())</a></li>
  </ul></p>

ReportTool.java

...
public String getNvdSearchURL(VulnerableSoftware vs) {
     return CpeIdentifier.nvdSearchUrlFor(vs.getVendor(), vs.getProduct(), vs.getVersion());
}
...

Then in the reports, something like:

  <p>Vulnerable Software &amp; Versions:<ul>
      <li class="vs$vsctr"><a target="_blank" href="$rpt.getNvdSearchURL($vuln.matchedVulnerableSoftware)">$enc.html($vuln.matchedVulnerableSoftware.toString())</a></li>
  </ul></p>

Some of the generated URLs look like the broad pattern and others the more specific one - so we may need two methods exposed.

@chadlwilson chadlwilson force-pushed the fix-nvd-search-links branch 2 times, most recently from 0a7712e to 4c71e20 Compare September 25, 2025 15:55
@chadlwilson
Copy link
Collaborator Author

OK I figured out that a different mechanism was being used for the "Identifiers" vs. the "Vulnerable Software & Versions" sections. Which also had a different URL syntax. Not sure, but suspect the "Vulnerable Software & Versions" links might have been broken for a while.

I've made this change now, however needs a bit more testing.

I think we don't need to specifically use the broad URLs, because the search syntax just takes a CPE 2.3 formatted string anyway. If from the NVD match we know details such as the version number from the matched software (sometimes it is included, if the affected version is not a range), it should be fine to include it in the search. In most other cases including * should be sufficient.

This new search also allows us to search specficially for all the other pieces of the CPE that have shown up in the NVD match, not just part/vendor/product/version - so behaviour should be better, I think.

@chadlwilson chadlwilson force-pushed the fix-nvd-search-links branch 2 times, most recently from ebead1b to acf0f85 Compare September 25, 2025 16:16
@chadlwilson chadlwilson marked this pull request as ready for review September 25, 2025 16:20
Since the search function accepts a full CPE 2.3 name, we should be able to use whatever CPE we have, with whatever specificity the CPE has. If it happens to have a
version number in it, that will be in the URL. If it does not (due to match being against version ranges, then it will do a broad search).

Signed-off-by: Chad Wilson <[email protected]>
@chadlwilson
Copy link
Collaborator Author

Added an example HTML report generated with this to the description.

@jeremylong jeremylong merged commit 3bff5af into dependency-check:main Sep 27, 2025
8 checks passed
@chadlwilson chadlwilson deleted the fix-nvd-search-links branch September 27, 2025 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core changes to core tests test cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] >300k CVEs
2 participants