Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improper Input Validation in CVSS v2 parsing #21

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

Improper Input Validation in CVSS v2 parsing #21

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

Comments

@pandatix
Copy link

pandatix commented Jan 29, 2023

During differential fuzzing with github.com/pandatix/go-cvss, 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 (using tag v1.4.4).

package main

import (
	"fmt"

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

func main() {
	vec, err := base.Decode("AV:N/AC:L/Au:N/C:C/I:C/A:C/E:F/RL:OF/rc:C")

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

produces ->

vec: AV:N/AC:L/Au:N/C:C/I:C/A:C/E:F/RL:OF/RC:C
err: <nil>

You can check this input is invalid by looking at the specification Table 13 which shows metrics are only uppercase.
This issue is similar to #15 but related to metrics directly and not their values.

@pandatix pandatix changed the title Improper Input Validation in CVSS v parsing Improper Input Validation in CVSS v2 parsing Jan 29, 2023
spiegel-im-spiegel added a commit that referenced this issue Jan 30, 2023
Fixed validation of v2 metrics (issue #21)
@spiegel-im-spiegel
Copy link
Member

Release v1.4.5

@spiegel-im-spiegel spiegel-im-spiegel added the bug Something isn't working label Jan 30, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants