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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

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": "[email protected]"
  }
}
{
  "type": "nvd",
  "cveID": "CVE-2024-5732",
  "cvssv40Vector": "",
  "optional": {
    "source": "[email protected]"
  }
}

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}'

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
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.

None yet

1 participant