-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Currently, when we are doing the CPE mapping, we are only mapping products to CPEs from the CPE dataset. However, when NIST issues CVEs, they sometimes specify the vulnerable configurations using criteria which specify configurations that do not match any actual CPEs in the CPE database, yet they contain basically almost all of the information that CPE contains.
Example
Take CVE-2024-45678 as an example. Here on the NIST page you can see the specified affected configurations. When you click on the "Show Matching CPEs" dropdown you will see that only 2 of the configurations actually have CPEs issued under them. However, for our purposes, the configurations specified themselves have a lot of information we could use to bind the CVE to an affected product: They have the vendor, the product, and some version range.
I do not have any numbers on the actual prevalence of this. We could run some numbers.
Implementation
Few things would need to be done to implement this:
- Do not filter the CPEMatch dataset:
sec-certs/src/sec_certs/utils/nvd_dataset_builder.py
Lines 344 to 353 in d640ad1
if "matches" in m["matchString"]: dataset_to_fill["match_strings"][m["matchString"]["matchCriteriaId"]] = { "criteria": m["matchString"]["criteria"], "matches": m["matchString"]["matches"], } for version_key in self._VERSION_KEYS: if version_key in m["matchString"]: dataset_to_fill["match_strings"][m["matchString"]["matchCriteriaId"]][version_key] = m[ "matchString" ][version_key] - ✅ Make some sort of "CPECriteria" dataclass that holds the information that we have. Note that the criteria may not have all of the metadata that a CPE must have, so some will be useless.
- Generalize the CPE classifier to also support this criteria thing.
- Hold the criteria in the CPE dataset or a separate dataset.
Wdyt, @adamjanovsky?