cve-search / vulnerability-lookup

Vulnerability-Lookup facilitates quick correlation of vulnerabilities from various sources, independent of vulnerability IDs, and streamlines the management of Coordinated Vulnerability Disclosure (CVD).
https://vulnerability.circl.lu
GNU Affero General Public License v3.0
136 stars 16 forks source link

Add exception for GSD import #10

Closed FafnerKeyZee closed 1 year ago

FafnerKeyZee commented 1 year ago

Hello,

Some date are a little weird with GSD and we got the following error:

2023-09-30 13:54:22,649 GSDImporter ERROR:Something went terribly wrong in GSDImporter.
Traceback (most recent call last):
  File "/home/fafner/vulnerability-lookup/vulnerabilitylookup/default/abstractmanager.py", line 144, in run
    self._to_run_forever()
  File "/home/fafner/vulnerability-lookup/bin/gsd.py", line 22, in _to_run_forever
    self.gsd.gsd_update()
  File "/home/fafner/vulnerability-lookup/vulnerabilitylookup/feeders/gsd.py", line 91, in gsd_update
    last_modified = fromisoformat_wrapper(vuln['gsd']['modified'])
  File "/home/fafner/vulnerability-lookup/vulnerabilitylookup/helpers.py", line 16, in fromisoformat_wrapper
    return datetime.fromisoformat(date_iso)
ValueError: Invalid isoformat string: '2022-09-30Y14:31:09.936138101+00:00'

Not sure that adding date_iso = date_iso.replace('Y','T').split('.')[0] in vulnerabilitylookup/helpers.py is the best solution but it's working \o/

FafnerKeyZee commented 1 year ago

Better solution: Run with python3.11 \o/ Did some test with python 3.11.0rc1 on Ubuntu 22.04 Distributor ID: Ubuntu Description: Ubuntu 22.04.3 LTS Release: 22.04 Codename: jammy

And all seems working fine

Rafiot commented 1 year ago

Fixed for python < 3.11. Turns out the Y/T doesn't matters, only the nanoseconds.