2222# Visit https://github.com/nexB/vulnerablecode/ for support and download.
2323
2424import dataclasses
25+ import json
2526from dateutil import parser as dateparser
2627from typing import Any
2728from typing import List
@@ -107,25 +108,31 @@ def _fetch(self) -> Mapping[str, Any]:
107108
108109 def _parse (self , pkg_name : str , records : Mapping [str , Any ]) -> List [Advisory ]:
109110 advisories = []
111+ ignored_versions = {"3.8.20-4." }
110112
111113 for cve_id , record in records .items ():
112114 impacted_purls , resolved_purls = [], []
113115 if not cve_id .startswith ("CVE" ):
114116 continue
115117
116118 # vulnerabilities starting with something else may not be public yet
117- # see for instance https://web.archive.org/web/20201215213725/https://security-tracker.debian.org/tracker/TEMP-0000000-A2EB44 # nopep8
118- # TODO: this would need to be revisited though to ensure we are not missing out on anything # nopep8
119+ # see for instance https://web.archive.org/web/20201215213725/https://security-tracker.debian.org/tracker/TEMP-0000000-A2EB44
120+ # TODO: this would need to be revisited though to ensure we are not missing out on anything
119121
120122 for release_name , release_record in record ["releases" ].items ():
121123 if not release_record .get ("repositories" , {}).get (release_name ):
122124 continue
123125
126+ version = release_record ["repositories" ][release_name ]
127+
128+ if version in ignored_versions :
129+ continue
130+
124131 purl = PackageURL (
125132 name = pkg_name ,
126133 type = "deb" ,
127134 namespace = "debian" ,
128- version = release_record [ "repositories" ][ release_name ] ,
135+ version = version ,
129136 qualifiers = {"distro" : release_name },
130137 )
131138
@@ -134,7 +141,10 @@ def _parse(self, pkg_name: str, records: Mapping[str, Any]) -> List[Advisory]:
134141 else :
135142 impacted_purls .append (purl )
136143
137- if "fixed_version" in release_record :
144+ if (
145+ "fixed_version" in release_record
146+ and release_record ["fixed_version" ] not in ignored_versions
147+ ):
138148 resolved_purls .append (
139149 PackageURL (
140150 name = pkg_name ,
@@ -150,7 +160,6 @@ def _parse(self, pkg_name: str, records: Mapping[str, Any]) -> List[Advisory]:
150160 if debianbug :
151161 bug_url = f"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug={ debianbug } "
152162 references .append (Reference (url = bug_url , reference_id = debianbug ))
153- # print(nearest_patched_package(impacted_purls, resolved_purls))
154163 advisories .append (
155164 Advisory (
156165 vulnerability_id = cve_id ,
0 commit comments