CVSS V3.1 calculator
npm install cvss-v3.1-reactThe CVSS (Common Vulnerability Scoring System) is an open framework that calculates the severity of software vulnerabilities in the form of a numerical value (called Base Score), ranging from 0 to 10.
The score value reflects whether the vulnerabilities present in the software are low, medium, high or critical in nature.
What we are providing here is the npm package of the CVSS calculator which was not available before.
There were no plugin available for this calculator in react js so we have created this plugin for reactjs users.
CVSS V3.1 Standalone Calculator Demo
This calculator directly calculates the severity level of the vulnerabilities by determining the base score. Let’s check out the procedure below-
The very first step is to install the npm package with the following command on the Command Prompt-
``sh`
npm install cvss-v3.1-react
1 . After installation, you need to import cvss-v3.1-react-
`js`
import CvssV3 from 'cvss-v3.1-react'
2 . Include cvss-v3.1-react component
`js`
const severityVector = "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:L";
//severityVector is optional variable. It can be used initialize the calculator.
console.log('data-----------', data);
}}/>
3 . By default, styles are listed below. You can customize the styles based on your requirements. You can pass styles prop to override these styles. You need to pass on onChange prop to get the selected severity string.
const defaultProps = {
styles: {
matricesTitle: {
minWidth: 200,
font: '400 16px Arial',
marginRight: 15
},
matricesItem: {
display: 'flex',
alignItems: 'center',
font: '400 13.3333px Arial'
},
severityBtn: {
background: 'none',
border: 'solid 1px #ccc',
borderRadius: 3,
padding: '0 20px',
height: 36,
marginRight: 15,
cursor: 'pointer'
},
selected: {
background: 'blue',
color: 'white'
},
scoreTextColor: {
color: 'blue'
},
scoreBar: {
background: '#f7f8f9',
padding: '1px 10px 15px'
},
None: {
background: 'rgb(162, 213, 114)'
},
Low: {
background: 'rgb(208, 212, 134)'
},
Medium: {
background: 'rgb(250, 230, 120)'
},
High: {
background: 'rgb(240, 170, 83)'
},
Critical: {
background: 'rgb(240, 130, 120)'
}
}
}
4 . To make it read only you can pass on optional prop readOnly=true. If you pass this then user will not be able to update the CVSS calculator.
`js``
const severityVector = "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:L";
const readOnly = true;
//severityVector is optional variable. It can be used initialize the calculator.
console.log('data-----------', data);
}}/>
####How to Calculate the Base Score??
The ISS (Impact Sub Score) is defined as-
Where, C= Confidentiality, I= Integrity and A= Availability.
Impact can be determined as-
If Scope is Changed, Impact= [7.52 (ISS-0.029)- 3.25 *[(ISS-0.02) ^15]]
If Scope is Unchanged, Impact= [6.45 ISS]
The Base Score is defined as-
* If ISS <=0, the Base Score will be 0.
Else,
* Score Unchanged=
Score Unchanged=
Copyright (c) 2015-2019, Shankar Morwal.
Copyright (c) 2019,
Habilelabs Private limited