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/mitre): support go-cve-dictionary:mitre #1978

Merged
merged 3 commits into from
Jun 29, 2024
Merged

Conversation

MaineK00n
Copy link
Collaborator

@MaineK00n MaineK00n commented Jun 28, 2024

What did you implement:

A new mitre will be added to the go-cve-dictionary data source.
vulsio/go-cve-dictionary#392

mitre includes CVSSv4 and SSVC evaluations by CISA ADP, and this information is added to the detected vulnerabilities.

Type of change

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

How Has This Been Tested?

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

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

$ vuls scan
$ vuls report
$ cat results/2024-06-27T22-16-01+0900/pseudo.json | jq '.scannedCves[].cveContents.mitre'
[
  {
    "type": "mitre",
    "cveID": "CVE-2024-5732",
    "title": "Clash Proxy Port improper authentication",
    "summary": "A vulnerability was found in Clash up to 0.20.1 on Windows. It has been declared as critical. This vulnerability affects unknown code of the component Proxy Port. The manipulation leads to improper authentication. The attack can be initiated remotely. The exploit has been disclosed to the public and may be used. It is recommended to change the configuration settings. VDB-267406 is the identifier assigned to this vulnerability.",
    "cvss2Score": 7.5,
    "cvss2Vector": "AV:N/AC:L/Au:N/C:P/I:P/A:P",
    "cvss2Severity": "",
    "cvss3Score": 7.3,
    "cvss3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L",
    "cvss3Severity": "HIGH",
    "cvss40Score": 6.9,
    "cvss40Vector": "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",
    "cvss40Severity": "MEDIUM",
    "sourceLink": "https://www.cve.org/CVERecord?id=CVE-2024-5732",
    "references": [
      {
        "link": "https://github.com/GTA12138/vul/blob/main/clash%20for%20windows.md",
        "tags": [
          "exploit"
        ]
      },
      {
        "link": "https://vuldb.com/?ctiid.267406",
        "tags": [
          "permissions-required",
          "signature"
        ]
      },
      {
        "link": "https://vuldb.com/?id.267406",
        "tags": [
          "vdb-entry"
        ]
      },
      {
        "link": "https://vuldb.com/?submit.345469",
        "tags": [
          "third-party-advisory"
        ]
      }
    ],
    "cweIDs": [
      "CWE-287"
    ],
    "published": "2024-06-07T10:00:04.02Z",
    "lastModified": "2024-06-07T14:50:46.944Z",
    "optional": {
      "source": "CNA:VulDB"
    }
  },
  {
    "type": "mitre",
    "cveID": "CVE-2024-5732",
    "title": "CISA ADP Vulnrichment",
    "summary": "",
    "cvss2Score": 0,
    "cvss2Vector": "",
    "cvss2Severity": "",
    "cvss3Score": 0,
    "cvss3Vector": "",
    "cvss3Severity": "",
    "cvss40Score": 0,
    "cvss40Vector": "",
    "cvss40Severity": "",
    "ssvc": {
      "exploitation": "none",
      "automatable": "no",
      "technical_impact": "partial"
    },
    "sourceLink": "https://www.cve.org/CVERecord?id=CVE-2024-5732",
    "published": "2024-06-07T10:00:04.02Z",
    "lastModified": "2024-06-07T14:50:46.944Z",
    "optional": {
      "source": "ADP:CISA-ADP"
    }
  }
]
  • vuls tui
    image

  • vuls report --format-full-text
    image

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 28, 2024
@MaineK00n MaineK00n requested a review from shino June 28, 2024 07:28
@MaineK00n MaineK00n marked this pull request as ready for review June 28, 2024 07:28
@shino
Copy link
Collaborator

shino commented Jun 28, 2024

Just a function name thing:

// FillCvesWithNvdJvnFortinet fills CVE detail with NVD, JVN, Fortinet
func FillCvesWithNvdJvnFortinet(r *models.ScanResult, cnf config.GoCveDictConf, logOpts logging.LogOpts) (err error) {

"and MITRE" ?

models/cvecontents.go Outdated Show resolved Hide resolved
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.

Great feature!

@MaineK00n
Copy link
Collaborator Author

Just a function name thing:

// FillCvesWithNvdJvnFortinet fills CVE detail with NVD, JVN, Fortinet
func FillCvesWithNvdJvnFortinet(r *models.ScanResult, cnf config.GoCveDictConf, logOpts logging.LogOpts) (err error) {

"and MITRE" ?

FillCvesWithGoCVEDictionary

@MaineK00n
Copy link
Collaborator Author

@shino
please review this commit 🙏
3a69be5

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.

Beyond Perfect!

@MaineK00n MaineK00n merged commit d8173cd into master Jun 29, 2024
7 checks passed
@MaineK00n MaineK00n deleted the MaineK00n/mitre branch June 29, 2024 07:35
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