Giter Site home page Giter Site logo

neuralegion / cvss Goto Github PK

View Code? Open in Web Editor NEW
13.0 14.0 3.0 600 KB

The Common Vulnerability Scoring System (CVSS) base score calculator and validator library written in TypeScript.

License: MIT License

JavaScript 1.40% TypeScript 98.60%
cvss cvss3 cvssv3 typescript security score

cvss's People

Contributors

dependabot[bot] avatar derevnjuk avatar lutie avatar pmstss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cvss's Issues

Environmental score error with CVSS 3.0

Hi !

There is a score error when computing the environmental score of a CVSS 3.0 vector string :

Take this example code :

const cvss = require('@neuralegion/cvss');

console.log("Base : " + cvss.calculateBaseScore('CVSS:3.0/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H'));
console.log("Environmental : ", cvss.calculateEnvironmentalResult('CVSS:3.0/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H'));

The base score that is printed is 9.6 as expected but the environmental score is printed as 9.9 :

Base : 9.6
Environmental :  {
  score: 9.9,
  metricsMap: Map(22) {
    'AV' => 'A',
    'AC' => 'L',
    'PR' => 'N',
    'UI' => 'N',
    'S' => 'C',
    'C' => 'H',
    'I' => 'H',
    'A' => 'H',
    'E' => 'X',
    'RL' => 'X',
    'RC' => 'X',
    'AR' => 'X',
    'CR' => 'X',
    'IR' => 'X',
    'MAV' => 'A',
    'MAC' => 'L',
    'MPR' => 'N',
    'MUI' => 'N',
    'MS' => 'C',
    'MC' => 'H',
    'MI' => 'H',
    'MA' => 'H'
  },
  impact: 6.3,
  exploitability: 2.9
}

If we take the calculator from first.org (https://www.first.org/cvss/calculator/3.0#CVSS:3.0/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H), the environmental score should have been 9.6 as well.

Thank you

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.