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(detector/vuls2): fill title and summary #2097

Merged
merged 1 commit into from
Dec 23, 2024
Merged

Conversation

MaineK00n
Copy link
Collaborator

@MaineK00n MaineK00n commented Dec 23, 2024

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

What did you implement:

fill title and summary

Type of change

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

How Has This Been Tested?

$ cd ~
$ git clone https://github.com/vulsio/vuls-compare.git
$ cd vuls-compare/detection
$ go run main.go  ../testdata/9/2024-12-07T09-49-40+0900/vagrant.json vuls config.toml vuls.db
$ cat diff/cves.diff
======== [-before +after] =========
  models.VulnInfos{
  	"CVE-2007-4559": {
  		... // 2 identical fields
  		AffectedPackages: {{Name: "python-unversioned-command", FixedIn: "0:3.9.18-1.el9_3"}, {Name: "python3", FixedIn: "0:3.9.18-1.el9_3"}, {Name: "python3-libs", FixedIn: "0:3.9.18-1.el9_3"}, {Name: "python3-pip-wheel", FixedIn: "0:21.2.3-7.el9"}},
  		DistroAdvisories: {{AdvisoryID: "RHSA-2023:6324", Updated: s"1000-01-01 00:00:00 +0000 UTC"}},
  		CveContents: models.CveContents{
  			"redhat": {
  				{
  					Type:        "redhat",
  					CveID:       "CVE-2007-4559",
- 					Title:       "",
+ 					Title:       "python: tarfile module directory traversal",
- 					Summary:     "",
+ 					Summary:     "A flaw was found in the Python tarfile module. Extracting a crafted TAR archive with the tarfile.extract or tarfile.extractall functions could lead to a directory traversal vulnerability, resulting in overwrite of arbitrary files.",
  					Cvss2Score:  0,
  					Cvss2Vector: "",
  					... // 15 identical fields
  				},
  			},
  		},
  		Exploits:    nil,
  		Metasploits: nil,
  		... // 11 identical fields
  	},
  	"CVE-2015-20107": {
  		... // 2 identical fields
  		AffectedPackages: {{Name: "python-unversioned-command", FixedIn: "0:3.9.14-1.el9"}, {Name: "python3", FixedIn: "0:3.9.14-1.el9"}, {Name: "python3-libs", FixedIn: "0:3.9.14-1.el9"}},
  		DistroAdvisories: {{AdvisoryID: "RHSA-2022:8353", Updated: s"1000-01-01 00:00:00 +0000 UTC"}},
  		CveContents: models.CveContents{
  			"redhat": {
  				{
  					Type:        "redhat",
  					CveID:       "CVE-2015-20107",
- 					Title:       "",
+ 					Title:       "python: mailcap: findmatch() function does not sanitize the second argument",
- 					Summary:     "",
+ 					Summary:     "A command injection vulnerability was found in the Python mailcap module. The issue occurs due to not adding escape characters into the system mailcap file commands. This flaw allows attackers to inject shell commands into applications that call the mailca"...,
  					Cvss2Score:  0,
  					Cvss2Vector: "",
  					... // 15 identical fields
  				},
  			},
  		},
  		Exploits:    nil,
  		Metasploits: nil,
  		... // 11 identical fields
  	},
...

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 requested a review from shino December 23, 2024 09:58
@MaineK00n MaineK00n self-assigned this Dec 23, 2024
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.

Thanks!!!

@MaineK00n MaineK00n merged commit 382d4e9 into vuls2 Dec 23, 2024
5 checks passed
@MaineK00n MaineK00n deleted the MaineK00n/patch-2 branch December 23, 2024 18:45
shino added a commit that referenced this pull request Jan 20, 2025
* feat!(detector): use vuls2 for redhat/alma/rocky (#2075)

Co-authored-by: MaineK00n <[email protected]>

* chore(detector/vuls2): check downloaded time before updating db (#2077)

* chore(detector/vuls2): check downloaded time before updating db

Co-authored-by: MaineK00n <[email protected]>

* fix(detector/vuls2): fix post convert bugs (#2082)

* fix(detector/vuls2): use tag for selection logic (#2086)

* fix(models/cvecontents): use cve content type Alma, Rocky (#2087)

* fix(detector/vuls2): lower stauts string and compare (#2095)

* chore(deps): update vuls2 (#2096)

* feat(detector/vuls2): fill title and summary (#2097)

* chore(deps): update vuls2 (#2099)

* chore(deps): update vuls2

incorporate MaineK00n/vuls2#139

* Vuls2Conf instead of Vuls2DictConf

* Update detector/vuls2/db.go

Co-authored-by: MaineK00n <[email protected]>

* Update detector/vuls2/vendor.go

Co-authored-by: MaineK00n <[email protected]>

* Refactor

* more refactor

---------

Co-authored-by: MaineK00n <[email protected]>
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