Git Product home page Git Product logo

cvss_rating's People

Contributors

mort666 avatar

Watchers

 avatar  avatar

Forkers

jsnv-dev

cvss_rating's Issues

Problem with CVSS 3.1

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

Calculation of base metric on changed scope

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.