Return a list of VulnerabilitySeverity for this CVE.
(self)
| 196 | |
| 197 | @property |
| 198 | def severities(self): |
| 199 | """ |
| 200 | Return a list of VulnerabilitySeverity for this CVE. |
| 201 | """ |
| 202 | severities = [] |
| 203 | metrics = get_item(self.cve_item, "cve", "metrics") or {} |
| 204 | url = f"https://nvd.nist.gov/vuln/detail/{self.cve_id}" |
| 205 | metric_configs = [ |
| 206 | ("cvssMetricV40", severity_systems.CVSSV4), |
| 207 | ("cvssMetricV31", severity_systems.CVSSV31), |
| 208 | ("cvssMetricV30", severity_systems.CVSSV3), |
| 209 | ("cvssMetricV2", severity_systems.CVSSV2), |
| 210 | ] |
| 211 | |
| 212 | for key, default_system in metric_configs: |
| 213 | items = metrics.get(key) or [] |
| 214 | |
| 215 | for item in items: |
| 216 | cvss_data = item.get("cvssData") or {} |
| 217 | system = default_system |
| 218 | if key == "cvssMetricV31" and cvss_data.get("version") != "3.1": |
| 219 | system = severity_systems.CVSSV3 |
| 220 | |
| 221 | severities.append( |
| 222 | VulnerabilitySeverity( |
| 223 | system=system, |
| 224 | value=str(cvss_data.get("baseScore") or ""), |
| 225 | scoring_elements=str(cvss_data.get("vectorString") or ""), |
| 226 | url=url, |
| 227 | ) |
| 228 | ) |
| 229 | return severities |
| 230 | |
| 231 | @property |
| 232 | def reference_urls(self): |
nothing calls this directly
no test coverage detected