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 in CVSS v2 parsing #26

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

Improper Input Validation in CVSS v2 parsing #26

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

Comments

@pandatix
Copy link

During differential fuzzing with github.com/pandatix/go-cvss I discovered that your implementation does not properly validate CVSS v2 vectors when environmental metrics values are not defined.
This could be categorized as CWE-20.

In order to be compliant with the first.org specification Table 13 you must only validate a vector when all the group metrics are defined in the input vector, even if Temporal and Environmental ones are set to ND (Not Defined).

The following Go code illustrates this issue.

package main

import (
	"fmt"

	"github.com/goark/go-cvss/v2/metric"
)

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

	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/IR:ND/AR:ND
err: <nil>
spiegel-im-spiegel added a commit that referenced this issue Jan 31, 2023
Fixed *.Decode method when not enough metrics (issue ##26)
@spiegel-im-spiegel spiegel-im-spiegel added the bug Something isn't working label Jan 31, 2023
@spiegel-im-spiegel
Copy link
Member

Release v1.6.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