mort666 / cvss_rating Goto Github PK
View Code? Open in Web Editor NEWCVSS Risk Rating gem
License: MIT License
CVSS Risk Rating gem
License: MIT License
Hello,
I'm using NVD latest feed and it includes CVSS 3.1 for some CVEs.
I get the following error:
/usr/local/rvm/gems/ruby@tools/gems/cvss_rating-0.6.0/lib/cvss_rating/cvss3_vectors.rb:76:in `cvss3=': Bad CVSS 3.0 Vector String (RuntimeError)
from /usr/local/rvm/gems/ruby@tools/gems/cvss_rating-0.6.0/lib/cvss_rating/cvss3_vectors.rb:40:in `block in parse'
from /usr/local/rvm/gems/ruby@tools/gems/cvss_rating-0.6.0/lib/cvss_rating/cvss3_vectors.rb:38:in `each'
from /usr/local/rvm/gems/ruby@tools/gems/cvss_rating-0.6.0/lib/cvss_rating/cvss3_vectors.rb:38:in `parse'
...
My CVSS v3 string is:
"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
I understand the problem is that it's 3.1 instead of 3.0
It would be nice to have support for 3.1 (only change required is to support 3.1 in the string)
Change must be done in https://github.com/mort666/cvss_rating/blob/master/lib/cvss_rating/cvss3_vectors.rb#L76
I'm seeing behaviour here that I don't understand and am not sure is right.
Where the scope is changed on a CVSS3 score, the gem takes the privilege score from PRIVILEGE_REQUIRED_CHANGED
rather than PRIVILEGE_REQUIRED
:
def pr
if @sc == 'changed'
pr = get_key('PRIVILEGE_REQUIRED_CHANGED', @pr) unless @pr.nil?
else
pr = get_key('PRIVILEGE_REQUIRED', @pr) unless @pr.nil?
end
end
This doesn't align with my understanding of how this should work - and I'm getting scores for a given vector that differ from those the First.org calculator gives me.
For example:
irb(main):003:0> p= Cvss3::Rating.new
=> #<Cvss3::Rating:0x00007fc58c0ac7c0 @ex=1.0, @rl=1.0, @rc=1.0, @cr=1.0, @ir=1.0, @ar=1.0, @mav=nil, @mac=nil, @mpr=nil, @mui=nil, @mc=nil, @mi=nil, @ma=nil>
irb(main):005:0> p.parse('AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H')
=> ["AV:N", "AC:L", "PR:H", "UI:N", "S:C", "C:H", "I:H", "A:H"]
irb(main):006:0> p.cvss_base_score
=> [7.9, "High"]
irb(main):007:0>
cvss3_rating gives 7.9, whereas first.org gives 9.1.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.