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

Another Improper Input Validation in CVSS v3 parsing #13

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

Another Improper Input Validation in CVSS v3 parsing #13

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

Comments

@pandatix
Copy link

After #10, I fuzzed again the implementation and discovered that other 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/goark/go-cvss/v3/metric"
)

func main() {
	vec, err := metric.NewEnvironmental().Decode("CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:0/A:H")

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

produces ->

vec: &{0xc0000ba000 X X X X X X X X X X X}
err: <nil>

The CVSS v3.1 vector is invalid because A is defined twice, but as one is valid, there is no error raised.

You can check this input is invalid, using the official first.org calculator which does not give scores despite base metrics being all defined, or by looking at the specification Table 15 which shows the A (Availability) metric can't be 0.

@spiegel-im-spiegel spiegel-im-spiegel added the bug Something isn't working label Jan 25, 2023
spiegel-im-spiegel added a commit that referenced this issue Jan 25, 2023
Fix validation of CVSSv3 vector string (issue #13)
@spiegel-im-spiegel
Copy link
Member

Relese v1.4.0

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