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

feat(cve/nvd): support CVSS v4.0 #1979

Merged
merged 2 commits into from
Jul 4, 2024
Merged

feat(cve/nvd): support CVSS v4.0 #1979

merged 2 commits into from
Jul 4, 2024

Conversation

MaineK00n
Copy link
Collaborator

@MaineK00n MaineK00n commented Jun 29, 2024

If this Pull Request is work in progress, Add a prefix of “[WIP]” in the title.

What did you implement:

CVSS V4.0 Schema has been added to the NVD of go-cve-dictionary by the following PR.
vulsio/go-cve-dictionary#393

Vuls supports NVD CVSS v4.0.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • config.toml
[servers]
[servers.pseudo]
type = "pseudo"
cpeNames = [
"cpe:2.3:a:clashforwindows:clash:0.1.0:*:*:*:*:windows:*:*"
]

before

$ go-cve-dictionary fetch mitre 2024
$ go-cve-dictionary fetch nvd 2024

$ vuls scan
$ vuls report
$ cat results/2024-06-27T22-16-01+0900/pseudo.json | jq '.scannedCves[].cveContents[][] | {type: .type, cveID: .cveID, cvssv40Vector: .cvss40Vector, optional: .optional}'
{
  "type": "mitre",
  "cveID": "CVE-2024-5732",
  "cvssv40Vector": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
  "optional": {
    "source": "CNA:VulDB"
  }
}
{
  "type": "mitre",
  "cveID": "CVE-2024-5732",
  "cvssv40Vector": "",
  "optional": {
    "source": "ADP:CISA-ADP"
  }
}
{
  "type": "nvd",
  "cveID": "CVE-2024-5732",
  "cvssv40Vector": "",
  "optional": {
    "source": "cna@vuldb.com"
  }
}
{
  "type": "nvd",
  "cveID": "CVE-2024-5732",
  "cvssv40Vector": "",
  "optional": {
    "source": "nvd@nist.gov"
  }
}

after

$ go-cve-dictionary fetch mitre 2024
$ go-cve-dictionary fetch nvd 2024

$ vuls scan
$ vuls report
$ cat results/2024-06-27T22-16-01+0900/pseudo.json | jq '.scannedCves[].cveContents[][] | {type: .type, cveID: .cveID, cvssv40Vector: .cvss40Vector, optional: .optional}'
cat results/2024-07-03T14-58-36+0900/pseudo.json | jq '.scannedCves[].cveContents[][] | {type: .type, cveID: .cveID, cvssv40Vector: .cvss40Vector, optional: .optional}'
{
  "type": "mitre",
  "cveID": "CVE-2024-5732",
  "cvssv40Vector": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
  "optional": {
    "source": "CNA:VulDB"
  }
}
{
  "type": "mitre",
  "cveID": "CVE-2024-5732",
  "cvssv40Vector": "",
  "optional": {
    "source": "ADP:CISA-ADP"
  }
}
{
  "type": "nvd",
  "cveID": "CVE-2024-5732",
  "cvssv40Vector": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
  "optional": {
    "source": "cna@vuldb.com"
  }
}
{
  "type": "nvd",
  "cveID": "CVE-2024-5732",
  "cvssv40Vector": "",
  "optional": {
    "source": "nvd@nist.gov"
  }
}

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 self-assigned this Jun 29, 2024
@MaineK00n MaineK00n force-pushed the MaineK00n/nvd-cvssv40 branch from 684a44a to 0de1ef4 Compare June 29, 2024 18:00
@MaineK00n MaineK00n force-pushed the MaineK00n/nvd-cvssv40 branch from 0de1ef4 to 3f65f52 Compare July 3, 2024 05:53
@MaineK00n MaineK00n marked this pull request as ready for review July 3, 2024 05:59
@MaineK00n MaineK00n requested a review from shino July 3, 2024 05:59
Copy link
Collaborator

@shino shino left a comment

Choose a reason for hiding this comment

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

🍻

@MaineK00n MaineK00n merged commit a76302c into master Jul 4, 2024
7 checks passed
@MaineK00n MaineK00n deleted the MaineK00n/nvd-cvssv40 branch July 4, 2024 04:39
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