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

Improper Input Validation on CVSS v2 parsing #1

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

Improper Input Validation on CVSS v2 parsing #1

pandatix opened this issue Jan 28, 2023 · 0 comments

Comments

@pandatix
Copy link

Hello, while fuzzing this implementation, I discovered that it is invalidating valid CVSS v2 vectors.
For instance, let's take the NVD CVSS v2 calculator as a reference.
Build any vector with base and environmental metrics different from Not Defined. Let's say (AV:L/AC:M/Au:S/C:N/I:N/A:P/CDP:N/TD:ND/CR:M/IR:ND/AR:ND).

The following Go code shows your implementation does not properly validate it as it raises an error where there should not be.

package main

import (
	"fmt"

	gocvss "github.com/umisama/go-cvss"
)

func main() {
	vec, err := gocvss.ParseVectors("(AV:L/AC:M/Au:S/C:N/I:N/A:P/CDP:N/TD:ND/CR:M/IR:ND/AR:ND)")

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

produces ->

vec: 
err: invalid vectors string: (AV:L/AC:M/Au:S/C:N/I:N/A:P/CDP:N/TD:ND/CR:M/IR:ND/AR:ND)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant