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

Improper Input Validation in CVSS v2 parsing #2

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

Improper Input Validation in CVSS v2 parsing #2

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 does not validate inputs properly.
When providing the E:U metric in a vector, an error is raised. Nevertheless, the first.org specification Table 13 shows the E (Exploitability) metric can be U (Unproven).

In order to be compliant with the specification, you must review your validation process to validate E:U (probably mistyped with E:P after a quick code review).

The following Go code illustrates this issue.

package main

import (
	"fmt"

	cvss "github.com/attwad/gocvss"
)

func main() {
	raw := "AV:N/AC:L/Au:N/C:P/I:P/A:C/E:U/RL:OF/RC:C"
	vec, err := cvss.Parse(raw)

	fmt.Printf("vec: %v\n", vec)
	fmt.Printf("err: %v\n", err)
}

produces ->

vec: base score                     0.000000
  access vector                0.000000
  access complexity            0.000000
  authentication               0.000000
  confidentiality impact       0.000000
  integrity impact             0.000000
  availability impact          0.000000

temporal score                 0.000000
  exploitability               1.000000
  remediation level            1.000000
  report confidence            1.000000

environmental score            0.000000
  collateral damage potential  0.000000
  target distribution          0.000000
  confidentiality requirement  1.000000
  integrity requirement        1.000000
  availability requirement     1.000000

err: cvss: unrecognized metric "E:U"
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