Skip to content

Commit b6481ba

Browse files
Fix Tenable CSV import fails with 'Version of CPE not implemented' (#13967)
- Add exception handling around CPE parsing in TenableCSVParser - Log unsupported CPE versions at DEBUG level instead of crashing - Allows import to continue when encountering unsupported CPE formats - Fixes issue #11243
1 parent 031c94c commit b6481ba

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

dojo/tools/tenable/csv_format.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -228,17 +228,23 @@ def get_findings(self, filename: str, test: Test):
228228
LOGGER.debug(
229229
"more than one CPE for a finding. NOT supported by Nessus CSV parser",
230230
)
231-
cpe_decoded = CPE(detected_cpe[0])
232-
find.component_name = (
233-
cpe_decoded.get_product()[0]
234-
if len(cpe_decoded.get_product()) > 0
235-
else None
236-
)
237-
find.component_version = (
238-
cpe_decoded.get_version()[0]
239-
if len(cpe_decoded.get_version()) > 0
240-
else None
241-
)
231+
try:
232+
cpe_decoded = CPE(detected_cpe[0])
233+
find.component_name = (
234+
cpe_decoded.get_product()[0]
235+
if len(cpe_decoded.get_product()) > 0
236+
else None
237+
)
238+
find.component_version = (
239+
cpe_decoded.get_version()[0]
240+
if len(cpe_decoded.get_version()) > 0
241+
else None
242+
)
243+
except Exception as e:
244+
LOGGER.debug(
245+
f"Failed to parse CPE '{detected_cpe[0]}': {e}. "
246+
"Skipping component_name and component_version.",
247+
)
242248

243249
find.unsaved_endpoints = []
244250
find.unsaved_vulnerability_ids = []

0 commit comments

Comments
 (0)