Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid CVSS v3 environmental score computation #18

Closed
pandatix opened this issue Jan 28, 2023 · 1 comment
Closed

Invalid CVSS v3 environmental score computation #18

pandatix opened this issue Jan 28, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@pandatix
Copy link

pandatix commented Jan 28, 2023

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.

@spiegel-im-spiegel spiegel-im-spiegel added the bug Something isn't working label Jan 28, 2023
@pandatix pandatix changed the title Invalid environmental score computation Invalid CVSS v3 environmental score computation Jan 28, 2023
spiegel-im-spiegel added a commit that referenced this issue Jan 29, 2023
Fix calcuration of Environmental Metrics score (issue #18)
@spiegel-im-spiegel
Copy link
Member

Relese v1.4.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants