Skip to content

Commit af3ce7f

Browse files
committed
Update FireEye importer to avoid using the identifier as an alias
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
1 parent 8964b4d commit af3ce7f

File tree

4 files changed

+10
-24
lines changed

4 files changed

+10
-24
lines changed

vulnerabilities/pipelines/v2_importers/fireeye_importer_v2.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,12 @@ def parse_advisory_data(raw_data, file_path, base_path) -> AdvisoryData:
9999
summary = md_dict.get(database_id[1::]) or []
100100
description = md_dict.get("## Description") or []
101101
impact = md_dict.get("## Impact")
102-
cve_ref = md_dict.get("## CVE Reference") or []
102+
cve_ids = md_dict.get("## CVE Reference") or []
103103
references = md_dict.get("## References") or []
104104
cwe_data = md_dict.get("## Common Weakness Enumeration") or []
105105

106-
advisory_id = file_path.stem
106+
advisory_id = database_id.strip()
107+
aliases = dedupe([cve_id.strip() for cve_id in cve_ids])
107108
advisory_url = get_advisory_url(
108109
file=file_path,
109110
base_path=base_path,
@@ -112,7 +113,7 @@ def parse_advisory_data(raw_data, file_path, base_path) -> AdvisoryData:
112113

113114
return AdvisoryData(
114115
advisory_id=advisory_id,
115-
aliases=get_aliases(database_id, cve_ref),
116+
aliases=aliases,
116117
summary=build_description(" ".join(summary), " ".join(description)),
117118
references_v2=get_references(references),
118119
severities=get_severities(impact),
@@ -152,17 +153,6 @@ def matcher_url(ref) -> str:
152153
return ref
153154

154155

155-
def get_aliases(database_id, cve_ref) -> List:
156-
"""
157-
Returns a List of Aliases from a database_id and a list of CVEs
158-
>>> get_aliases("MNDT-2021-0012", ["CVE-2021-44207"])
159-
['CVE-2021-44207', 'MNDT-2021-0012']
160-
"""
161-
cleaned_db_id = database_id.strip()
162-
cve_ref.append(cleaned_db_id)
163-
return dedupe(cve_ref)
164-
165-
166156
def md_list_to_dict(md_list):
167157
"""
168158
Returns a dictionary of md_list from a list of a md file splited by \n

vulnerabilities/tests/test_data/fireeye_v2/fireeye_test1-expected.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
[
22
{
3-
"advisory_id": "fireeye_test1",
3+
"advisory_id": "FEYE-2019-0002",
44
"aliases": [
5-
"CVE-2019-7245 ",
6-
"FEYE-2019-0002"
5+
"CVE-2019-7245"
76
],
87
"summary": "GPU-Z.sys, part of the GPU-Z package from TechPowerUp, exposes the wrmsr instruction to user-mode callers without properly validating the target Model Specific Register (MSR). This can result in arbitrary unsigned code being executed in Ring 0.",
98
"affected_packages": [],

vulnerabilities/tests/test_data/fireeye_v2/fireeye_test2-expected.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
[
22
{
3-
"advisory_id": "fireeye_test2",
3+
"advisory_id": "FEYE-2020-0020",
44
"aliases": [
5-
"CVE-2020-12878",
6-
"FEYE-2020-0020"
5+
"CVE-2020-12878"
76
],
87
"summary": "Digi International's ConnectPort X2e is susceptible to a local privilege escalation vulnerable to the privileged user `root`.",
98
"affected_packages": [],

vulnerabilities/tests/test_data/fireeye_v2/fireeye_test3-expected.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
[
22
{
3-
"advisory_id": "fireeye_test3",
4-
"aliases": [
5-
"MNDT-2025-0009"
6-
],
3+
"advisory_id": "MNDT-2025-0009",
4+
"aliases": [],
75
"summary": "Improper verification of cryptographic signature in the installer for Zoom Workplace VDI Client for Windows may allow an authenticated user to conduct an escalation of privilege via local access.",
86
"affected_packages": [],
97
"references_v2": [

0 commit comments

Comments
 (0)