fix: Avoiding issues when no CWE id is provided

pull/326/head
chrisr3d 3 years ago
parent 0b603fc5d3
commit 415fa55fff
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
  1. 2
      misp_modules/modules/expansion/cve_advanced.py

@ -52,7 +52,7 @@ class VulnerabilityParser():
vulnerability_object.add_attribute(relation, **{'type': attribute_type, 'value': value})
vulnerability_object.add_reference(self.attribute['uuid'], 'related-to')
self.misp_event.add_object(**vulnerability_object)
if 'cwe' in self.vulnerability:
if 'cwe' in self.vulnerability and self.vulnerability['cwe'] != 'Unknown':
self.__parse_weakness(vulnerability_object.uuid)
if 'capec' in self.vulnerability:
self.__parse_capec(vulnerability_object.uuid)

Loading…
Cancel
Save