Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Improper Input Validation in CVSS v2 parsing #203

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

Improper Input Validation in CVSS v2 parsing #203

pandatix opened this issue Jan 28, 2023 · 0 comments

Comments

@pandatix
Copy link

While fuzzing this implementation, I discovered that some invalid inputs did not raise errors.
This could be categorized as CWE-20.

For instance, the following Go code does not produce any error.

package main

import (
	"fmt"

	"github.com/facebookincubator/nvdtools/cvss2"
)

func main() {
	vec, err := cvss2.VectorFromString("AV:A/AC:L/Au:N/C:C/I:C/A:C/CDP:H/TD:H/CR:H")

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

produces ->

vec: (AV:A/AC:L/Au:N/C:C/I:C/A:C/CDP:H/TD:H/CR:H)
err: <nil>

You can check this input is invalid, using the NVD calculator which displays the vector with all environmental metrics when given this vector, or by looking at the specification Table 13 which shows the environmental vector must contain all metrics when in the CVSS vector.

Found using version/tag v0.1.5.

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