Skip to content

Commit ce343c5

Browse files
authored
Added cvss_v4 field (#654)
1 parent de31578 commit ce343c5

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ patched_versions:
129129
* `description` \[String\] (required): One or more paragraphs describing the vulnerability. It may contain multiple paragraphs.
130130
* `cvss_v2` \[Float\] (optional): The [CVSSv2] score for the vulnerability.
131131
* `cvss_v3` \[Float\] (optional): The [CVSSv3] score for the vulnerability.
132+
* `cvss_v4` \[Float\] (optional): The [CVSSv4] score for the vulnerability.
132133
* `unaffected_versions` \[Array\<String\>\] (optional): The version requirements for the
133134
unaffected versions of the Ruby library.
134135
* `patched_versions` \[Array\<String\>\] (optional): The version requirements for the
@@ -149,6 +150,7 @@ patched_versions:
149150
* `description` \[String\] (required): One or more paragraphs describing the vulnerability. It may contain multiple paragraphs.
150151
* `cvss_v2` \[Float\] (optional): The [CVSSv2] score for the vulnerability.
151152
* `cvss_v3` \[Float\] (optional): The [CVSSv3] score for the vulnerability.
153+
* `cvss_v4` \[Float\] (optional): The [CVSSv4] score for the vulnerability.
152154
* `unaffected_versions` \[Array\<String\>\] (optional): The version requirements for the
153155
unaffected versions of the Ruby implementation.
154156
* `patched_versions` \[Array\<String\>\] (optional): The version requirements for the
@@ -157,7 +159,8 @@ patched_versions:
157159
* `notes` \[String\] (optional): Internal notes regarding the vulnerability's inclusion in this database.
158160

159161
[CVSSv2]: https://www.first.org/cvss/v2/guide
160-
[CVSSv3]: https://www.first.org/cvss/user-guide
162+
[CVSSv3]: https://www.first.org/cvss/v3.1/user-guide
163+
[CVSSv4]: https://www.first.org/cvss/v4.0/user-guide
161164

162165
### Tests
163166

@@ -194,6 +197,7 @@ GH_API_TOKEN=<your GitHub API Token> bundle exec rake sync_github_advisories[gem
194197
- The rake task will write yaml files for any missing advisories.
195198
- Those files must be further edited.
196199
- Fill in `cvss_v3` field by following the CVE link and getting it from page
200+
- Fill in `cvss_v4` field by following the CVE link and getting it from page
197201
- Fill in `patched_versions` field, using the comments at the bottom of the file
198202
- Fill in `unaffected_versions`, optional, if there are unaffected_versions
199203
- delete the GitHub data at the bottom of the yaml file
@@ -216,6 +220,7 @@ developed by the Open Security Foundation (OSF) and its contributors.
216220
[OSVDB]: https://en.wikipedia.org/wiki/Open_Source_Vulnerability_Database
217221
[GHSA]: https://help.github.com/en/articles/about-maintainer-security-advisories
218222
[CVSSv2]: https://www.first.org/cvss/v2/guide
219-
[CVSSv3]: https://www.first.org/cvss/user-guide
223+
[CVSSv3]: https://www.first.org/cvss/v3.1/user-guide
224+
[CVSSv4]: https://www.first.org/cvss/v4.0/user-guide
220225
[YAML]: http://www.yaml.org/
221226
[CONTRIBUTORS.md]: https://github.com/rubysec/ruby-advisory-db/blob/master/CONTRIBUTORS.md

lib/github_advisory_sync.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def merge_data(saved_data)
230230

231231
KEYS = %w[
232232
gem library framework platform cve osvdb ghsa url title date description
233-
cvss_v2 cvss_v3 unaffected_versions patched_versions related notes
233+
cvss_v2 cvss_v3 cvss_v4 unaffected_versions patched_versions related notes
234234
].freeze
235235
end
236236

@@ -367,6 +367,7 @@ def create(package)
367367

368368
new_data = package.merge_data(
369369
"cvss_v3" => ("<FILL IN IF AVAILABLE>" unless cvss),
370+
"cvss_v4" => "<FILL IN IF AVAILABLE>",
370371
"unaffected_versions" => ["<OPTIONAL: FILL IN SEE BELOW>"]
371372
)
372373

spec/advisory_example.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,21 @@
168168
end
169169
end
170170

171+
describe "cvss_v4" do
172+
subject { advisory['cvss_v4'] }
173+
174+
it "may be nil or a Float" do
175+
expect(subject).to be_kind_of(Float).or(be_nil)
176+
end
177+
178+
case advisory['cvss_v4']
179+
when Float
180+
context "when a Float" do
181+
it { expect(subject).to be_between(0.0, 10.0) }
182+
end
183+
end
184+
end
185+
171186
describe "patched_versions" do
172187
subject { advisory['patched_versions'] }
173188

spec/schemas/gem.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ mapping:
3535
type: float
3636
"cvss_v3":
3737
type: float
38+
"cvss_v4":
39+
type: float
3840
"unaffected_versions":
3941
type: seq
4042
sequence:

spec/schemas/ruby.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ mapping:
3232
type: float
3333
"cvss_v3":
3434
type: float
35+
"cvss_v4":
36+
type: float
3537
"unaffected_versions":
3638
type: seq
3739
sequence:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy