You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cvssv3_regex=RegexValidator(regex=r"^AV:[NALP]|AC:[LH]|PR:[UNLH]|UI:[NR]|S:[UC]|[CIA]:[NLH]", message="CVSS must be entered in format: 'AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H'")
# cvssv3_regex = RegexValidator(regex=r"^AV:[NALP]|AC:[LH]|PR:[UNLH]|UI:[NR]|S:[UC]|[CIA]:[NLH]", message="CVSS must be entered in format: 'AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H'")
@@ -3521,8 +3524,10 @@ class Finding_Template(models.Model):
3521
3524
blank=False,
3522
3525
verbose_name="Vulnerability Id",
3523
3526
help_text="An id of a vulnerability in a security advisory associated with this finding. Can be a Common Vulnerabilities and Exposures (CVE) or from other sources.")
3524
-
cvssv3_regex=RegexValidator(regex=r"^AV:[NALP]|AC:[LH]|PR:[UNLH]|UI:[NR]|S:[UC]|[CIA]:[NLH]", message="CVSS must be entered in format: 'AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H'")
# cvssv3_regex = RegexValidator(regex=r"^AV:[NALP]|AC:[LH]|PR:[UNLH]|UI:[NR]|S:[UC]|[CIA]:[NLH]", message="CVSS must be entered in format: 'AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H'")
# CVSS4 is not supported yet by the parse_cvss_from_text function, but let's prepare for it anyway: https://github.com/RedHatProductSecurity/cvss/issues/53
23
+
msg="Unsupported CVSS(4) version detected."
24
+
raiseexception_class(msg)
25
+
ifisinstance(vector_obj, CVSS2):
26
+
# CVSS2 is not supported yet by the parse_cvss_from_text function, but let's prepare for it anyway: https://github.com/RedHatProductSecurity/cvss/issues/53
27
+
msg="Unsupported CVSS(2) version detected."
28
+
raiseexception_class(msg)
29
+
30
+
msg="Unsupported CVSS version detected."
31
+
raiseexception_class(msg)
32
+
33
+
# Explicitly raise an error if no CVSS vectors are found,
34
+
# to avoid 'NoneType' errors during severity processing later.
35
+
msg="No CVSS vectors found by cvss.parse_cvss_from_text()"
0 commit comments