Skip to content

Commit a75884b

Browse files
committed
Fix regex in schema validator in alpine importer
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
1 parent 1d7b64e commit a75884b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

vulnerabilities/importers/alpine_linux.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# for any legal advice.
2121
# VulnerableCode is a free software code scanning tool from nexB Inc. and others.
2222
# Visit https://github.com/nexB/vulnerablecode/ for support and download.
23+
from re import IGNORECASE
2324
from typing import Any
2425
from typing import Iterable
2526
from typing import List
@@ -54,7 +55,7 @@ def validate_schema(advisory_dict):
5455
str: Or(
5556
[
5657
Or(
57-
Regex(r"CVE.\d+-\d+"),
58+
Regex(r"CVE.\d+-\d+", flags=IGNORECASE),
5859
Regex(r"XSA-\d{3}"),
5960
Regex(r"ZBX-\d{4}"),
6061
Regex(r"wnpa-sec-\d{4}-\d{2}"),
@@ -187,7 +188,7 @@ def _load_advisories(
187188
impacted_package_urls=[],
188189
resolved_package_urls=resolved_purls,
189190
vuln_references=references,
190-
cve_id=vuln_ids[0] if vuln_ids[0] != "CVE-????-?????" else None,
191+
cve_id=vuln_ids[0].upper() if vuln_ids[0] != "CVE-????-?????" else None,
191192
)
192193
)
193194

0 commit comments

Comments
 (0)