Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

Invalid CVSS v2 vector output #1

Open
pandatix opened this issue Jan 30, 2023 · 0 comments
Open

Invalid CVSS v2 vector output #1

pandatix opened this issue Jan 30, 2023 · 0 comments

Comments

@pandatix
Copy link

During differential fuzzing with github.com/pandatix/go-cvss, I discovered that your implementation emits CVSS v2 vectors that are invalid.

Indeed, you are outputing the CVSS v2 vector in ascendent order of metrics.
Nevertheless, the first.org specification states at Section 2.4 that a vector has a "predetermined order", documented in Table 13.

In order to be compliant, you must output metrics in the specified order.

The following Go code illustrates this issue.

package main

import (
	"fmt"
	"log"

	cvss "github.com/attwad/gocvss"
)

func main() {
	raw := "AV:N/AC:L/Au:N/C:N/I:N/A:C/E:F/RL:OF/RC:C"
	vec, err := cvss.Parse(raw)
	if err != nil {
		log.Fatal(err)
	}

	out := vec.ToStringVector()
	fmt.Printf("out: %v\n", out)
}

produces ->

out: A:C/AC:L/AV:N/Au:N/C:N/E:F/I:N/RC:C/RL:OF
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant