CVSS Calculator is a Java library for calculating CVSSv2, CVSSv3, and CVSSv3.1 scores and vectors, including support for base scores, impact scores, and exploitability scores.
$ mvn clean package
// Performs a new calculation using CVSSv3
CvssV3 cvssV3 = new CvssV3()
.attackVector(AttackVector.NETWORK)
.attackComplexity(AttackComplexity.LOW)
.privilegesRequired(PrivilegesRequired.HIGH)
.userInteraction(UserInteraction.NONE)
.scope(Scope.UNCHANGED)
.confidentiality(CIA.HIGH)
.integrity(CIA.HIGH)
.availability(CIA.HIGH);
Score score = cvssV3.calculateScore();
// Parses an existing CVSS v2 or v3 vector
Cvss cvss = Cvss.fromVector(vector);
Score score = cvss.calculateScore();
CVSS Calculator is available in the Maven Central Repository.
<dependency>
<groupId>us.springett</groupId>
<artifactId>cvss-calculator</artifactId>
<version>1.4.3</version>
</dependency>
CVSS Calculator is Copyright (c) Steve Springett. All Rights Reserved.
All other trademarks are property of their respective owners.
Permission to modify and redistribute is granted under the terms of the Apache 2.0 license.