aboutsummaryrefslogtreecommitdiff
path: root/cvss/v2scores.go
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2022-02-07 10:43:06 -0500
committerPaul Duncan <pabs@pablotron.org>2022-02-07 10:43:06 -0500
commit5bc6072dd22038f8f0c3cf6cc8ed758293725a8f (patch)
treead6a030585d88ceb0b9b2d9f6fc7eb1a2a178846 /cvss/v2scores.go
parent54a781b9beacdd9ec9c27909c7b315adccdf1ab6 (diff)
downloadcvez-5bc6072dd22038f8f0c3cf6cc8ed758293725a8f.tar.bz2
cvez-5bc6072dd22038f8f0c3cf6cc8ed758293725a8f.zip
cvss/v2scores.go: remove unneeded rounding so env scores are consistent w/ nvd cvss v2 calculator
Diffstat (limited to 'cvss/v2scores.go')
-rw-r--r--cvss/v2scores.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cvss/v2scores.go b/cvss/v2scores.go
index 3dec4a3..03bbc24 100644
--- a/cvss/v2scores.go
+++ b/cvss/v2scores.go
@@ -57,6 +57,7 @@ func newV2Scores(v v2Vector) (v2Scores, error) {
auth := 0.0
// temporal score values
+ // (FIXME: should these be set to 1.0?)
exploitability := 0.0
remediationLevel := 0.0
reportConfidence := 0.0
@@ -250,7 +251,7 @@ func newV2Scores(v v2Vector) (v2Scores, error) {
// calculate environmental base score using adjusted impact
baseExpl := 20 * accessVector * accessComplexity * auth
envBaseScore := ((0.6 * adjImpact + 0.4 * baseExpl) - 1.5) * fImpact
- envBaseScore = math.Round(10.0 * envBaseScore) / 10.0
+ envBaseScore = (10.0 * envBaseScore) / 10.0
// calculate adjusted temporal score
adjTempScore := envBaseScore * exploitability * remediationLevel * reportConfidence