A software vulnerability with a unique identifier and alternate ``aliases``.
| 247 | |
| 248 | # FIXME: Remove when migration from Vulnerability to Advisory is completed |
| 249 | class Vulnerability(models.Model): |
| 250 | """ |
| 251 | A software vulnerability with a unique identifier and alternate ``aliases``. |
| 252 | """ |
| 253 | |
| 254 | vulnerability_id = models.CharField( |
| 255 | unique=True, |
| 256 | blank=True, |
| 257 | max_length=20, |
| 258 | default=utils.build_vcid, |
| 259 | help_text="Unique identifier for a vulnerability in the external representation. " |
| 260 | "It is prefixed with VCID-", |
| 261 | db_index=True, |
| 262 | ) |
| 263 | |
| 264 | summary = models.TextField( |
| 265 | help_text="Summary of the vulnerability", |
| 266 | blank=True, |
| 267 | ) |
| 268 | |
| 269 | references = models.ManyToManyField( |
| 270 | to="VulnerabilityReference", through="VulnerabilityRelatedReference" |
| 271 | ) |
| 272 | |
| 273 | affecting_packages = models.ManyToManyField( |
| 274 | to="Package", |
| 275 | through="AffectedByPackageRelatedVulnerability", |
| 276 | ) |
| 277 | |
| 278 | fixed_by_packages = models.ManyToManyField( |
| 279 | to="Package", |
| 280 | through="FixingPackageRelatedVulnerability", |
| 281 | related_name="fixing_vulnerabilities", # Unique related_name |
| 282 | ) |
| 283 | |
| 284 | status = models.IntegerField( |
| 285 | choices=VulnerabilityStatusType.choices, default=VulnerabilityStatusType.PUBLISHED |
| 286 | ) |
| 287 | |
| 288 | severities = models.ManyToManyField( |
| 289 | VulnerabilitySeverity, |
| 290 | related_name="vulnerabilities", |
| 291 | ) |
| 292 | |
| 293 | exploitability = models.DecimalField( |
| 294 | null=True, |
| 295 | max_digits=2, |
| 296 | decimal_places=1, |
| 297 | help_text="Exploitability indicates the likelihood that a vulnerability in a software package could be used by malicious actors to compromise systems, " |
| 298 | "applications, or networks. This metric is determined automatically based on the discovery of known exploits.", |
| 299 | ) |
| 300 | |
| 301 | weighted_severity = models.DecimalField( |
| 302 | null=True, |
| 303 | max_digits=3, |
| 304 | decimal_places=1, |
| 305 | help_text="Weighted severity is the highest value calculated by multiplying each severity by its corresponding weight, divided by 10.", |
| 306 | ) |
no outgoing calls