Skip to content

Invalid CVSS v3 environmental score computation #18

@pandatix

Description

@pandatix

Still while fuzzing the implementation, I discovered that environmental scores were not computed properly, leading to invalid scores.
For instance, the following Go code computes the three scores and prints them.

package main

import (
	"fmt"
	"log"

	"github.com/goark/go-cvss/v3/metric"
)

func main() {
	vec, err := metric.NewEnvironmental().Decode("CVSS:3.1/AV:A/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N/MS:C")
	if err != nil {
		log.Fatal(err)
	}

	b, t, e := vec.Base.Score(), vec.Temporal.Score(), vec.Score()
	fmt.Printf("Scores: %.1f;%.1f;%.1f\n", b, t, e)
}

produces ->

Scores: 5.4;5.4;6.4

You can check this input is valid, using the official first.org calculator but then computes an environmental score of 6.5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions