Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fetch): fix first CVE year #380

Merged
merged 1 commit into from
Apr 24, 2024
Merged

fix(fetch): fix first CVE year #380

merged 1 commit into from
Apr 24, 2024

Conversation

jdorel
Copy link
Contributor

@jdorel jdorel commented Apr 24, 2024

What did you implement:

The first CVE was created in 1999, the previous feed fetch only contained CVE from 2002 onward. But with the API we get the CVE from 1999, 2000 and 2001

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

before

$ go-cve-dictionary fetch nvd
INFO[04-24|19:46:22] Inserting NVD into DB (sqlite3). 
INFO[04-24|19:46:22] Deleting NVD tables... 
INFO[04-24|19:46:22] Fetching CVE information from NVD. 
INFO[04-24|19:46:22] Fetching... https://github.com/vulsio/vuls-data-raw-nvd-api-cve/archive/refs/heads/main.tar.gz 
INFO[04-24|19:46:41] Fetching CVE information from NVD(2002). 
INFO[04-24|19:46:42] Inserting fetched CVEs(2002)... 
2392 / 2392 [------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 1270 p/s
INFO[04-24|19:46:44] Refreshed 2392 CVEs. 
INFO[04-24|19:46:44] Fetching CVE information from NVD(2003). 
INFO[04-24|19:46:44] Inserting fetched CVEs(2003)... 
1553 / 1553 [------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 1314 p/s
INFO[04-24|19:46:46] Refreshed 1553 CVEs. 
INFO[04-24|19:46:46] Fetching CVE information from NVD(2004). 
INFO[04-24|19:46:46] Inserting fetched CVEs(2004)... 
2707 / 2707 [-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 824 p/s
...

after

$ go-cve-dictionary fetch nvd
INFO[04-24|19:47:26] Inserting NVD into DB (sqlite3). 
INFO[04-24|19:47:26] Deleting NVD tables... 
INFO[04-24|19:47:26] Fetching CVE information from NVD. 
INFO[04-24|19:47:28] Fetching... https://github.com/vulsio/vuls-data-raw-nvd-api-cve/archive/refs/heads/main.tar.gz 
INFO[04-24|19:47:56] Fetching CVE information from NVD(1999). 
INFO[04-24|19:47:57] Inserting fetched CVEs(1999)... 
1579 / 1579 [------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 2385 p/s
INFO[04-24|19:47:57] Refreshed 1579 CVEs. 
INFO[04-24|19:47:57] Fetching CVE information from NVD(2000). 
INFO[04-24|19:47:58] Inserting fetched CVEs(2000)... 
1242 / 1242 [------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 2487 p/s
INFO[04-24|19:47:59] Refreshed 1242 CVEs. 
INFO[04-24|19:47:59] Fetching CVE information from NVD(2001). 
INFO[04-24|19:47:59] Inserting fetched CVEs(2001)... 
1556 / 1556 [------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 1571 p/s
INFO[04-24|19:48:00] Refreshed 1556 CVEs. 
INFO[04-24|19:48:00] Fetching CVE information from NVD(2002). 
INFO[04-24|19:48:01] Inserting fetched CVEs(2002)... 
2392 / 2392 [------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 1609 p/s
INFO[04-24|19:48:02] Refreshed 2392 CVEs. 
INFO[04-24|19:48:02] Fetching CVE information from NVD(2003). 
INFO[04-24|19:48:03] Inserting fetched CVEs(2003)... 
1553 / 1553 [------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 1656 p/s
INFO[04-24|19:48:04] Refreshed 1553 CVEs. 
INFO[04-24|19:48:04] Fetching CVE information from NVD(2004). 
INFO[04-24|19:48:04] Inserting fetched CVEs(2004)... 
2707 / 2707 [------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 1375 p/s
...

Checklist:

You don't have to satisfy all of the following.

  • Write tests
  • Write documentation
  • Check that there aren't other open pull requests for the same issue/feature
  • Format your source code by make fmt
  • Pass the test by make test
  • Provide verification config / commands
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES

Reference

@MaineK00n MaineK00n changed the title Fix first CVE year fix(fetch): fix first CVE year Apr 24, 2024
@MaineK00n
Copy link
Collaborator

This is probably because go-cve-dictionary used to use JSON Feed(https://nvd.nist.gov/vuln/data-feeds#JSON_FEED), starting in 2002, but since vulsio/vuls-data-raw-nvd-api-cve(https://github.com/vulsio/vuls-data-raw-nvd-api-cve), they forgot to change it, even though the CVE year is from 1999.

Copy link
Collaborator

@MaineK00n MaineK00n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx!

@MaineK00n MaineK00n merged commit a687194 into vulsio:master Apr 24, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants