MCPcopy Create free account
hub / github.com/aboutcode-org/vulnerablecode / references

Method references

vulnerabilities/pipelines/nvd_importer.py:246–275  ·  view source on GitHub ↗

Return a list of AdvisoryReference.

(self)

Source from the content-addressed store, hash-verified

244
245 @property
246 def references(self):
247 """
248 Return a list of AdvisoryReference.
249 """
250 # FIXME: we should also collect additional data from the references such as tags and ids
251 references = []
252
253 # we track each CPE as a reference for now
254 for cpe in self.cpes:
255 cpe_url = f"https://nvd.nist.gov/vuln/search/results?adv_search=true&isCpeNameSearch=true&query={cpe}"
256 references.append(Reference(reference_id=cpe, url=cpe_url))
257
258 # FIXME: we also add the CVE proper as a reference, but is this correct?
259 references.append(
260 Reference(
261 url=f"https://nvd.nist.gov/vuln/detail/{self.cve_id}",
262 reference_id=self.cve_id,
263 severities=self.severities,
264 )
265 )
266
267 # clean to remove dupes for the CVE id proper
268 ref_urls = [
269 ru
270 for ru in self.reference_urls
271 if ru != f"https://nvd.nist.gov/vuln/detail/{self.cve_id}"
272 ]
273 references.extend([Reference(url=url) for url in ref_urls])
274
275 return references
276
277 @property
278 def is_related_to_hardware(self):

Callers

nothing calls this directly

Calls 1

ReferenceClass · 0.90

Tested by

no test coverage detected