CERT-W / certitude

The Seeker of IOC
GNU General Public License v2.0
129 stars 23 forks source link

Better handle bad IOC inputs #21

Open maaaaz opened 7 years ago

maaaaz commented 7 years ago

Hello,

I tried to scan with a badly formatted IOC file (a plain file with test inside) and I got non-blocking errors on the import. I could launch the scan but obviously get it crashed with the following error:

File "/opt/certitude/components/interface/web.py", line 812, in resultscsv
    infos = getInfosFromXML(ioc.xml_content)
  File "/opt/certitude/components/interface/web.py", line 764, in getInfosFromXML
    xml = ET.fromstring(c)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1311, in XML
    parser.feed(text)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1653, in feed
    self._raiseerror(v)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1517, in _raiseerror
    raise err
ParseError: syntax error: line 1, column 0

Cheers.