Skip to content

Releases: goark/go-cvss

v1.6.7

11 Mar 11:41
v1.6.7
b4550e1
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.6.6...v1.6.7

v1.6.6

04 Feb 09:12
v1.6.6
e90ceac
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.6.5...v1.6.6

v1.6.5

04 Feb 08:02
v1.6.5
9e847ca
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.6.4...v1.6.5

v1.6.4

04 Feb 02:06
v1.6.4
0f78497
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.6.3...v1.6.4

v1.6.3

02 Feb 23:50
v1.6.3
059836d
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.6.2...v1.6.3

v1.6.2

02 Feb 10:09
v1.6.2
99e85cc
Compare
Choose a tag to compare

What's Changed

package main

import (
    "fmt"

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

func main() {
    testcase := []struct {
        name   string
        vector string
    }{
        // CVE-2003-0062 (cf. https://www.first.org/cvss/v2/guide 3.3.3)
        {name: "full metrics", vector: "AV:L/AC:H/Au:N/C:C/I:C/A:C/E:POC/RL:OF/RC:C/CDP:H/TD:H/CR:M/IR:M/AR:M"},
        {name: "Base only", vector: "AV:L/AC:H/Au:N/C:C/I:C/A:C"},
        {name: "skip Environmental", vector: "AV:L/AC:H/Au:N/C:C/I:C/A:C/E:POC/RL:OF/RC:C"},
        {name: "skip Temporal", vector: "AV:L/AC:H/Au:N/C:C/I:C/A:C/CDP:H/TD:H/CR:M/IR:M/AR:M"},
    }
    for _, tc := range testcase {
        fmt.Println(tc.name)
        vec, err := metric.NewEnvironmental().Decode(tc.vector)
        fmt.Printf("\t-> vector: %v\n", vec)
        fmt.Printf("\t-> err: %v\n", err)
        fmt.Printf("\t-> Severity: %v (%v)\n", vec.Severity(), vec.Score())
    }
}

Output (https://go.dev/play/p/3ZiGMPBxNY0):

full metrics
	-> vector: AV:L/AC:H/Au:N/C:C/I:C/A:C/E:POC/RL:OF/RC:C/CDP:H/TD:H/CR:M/IR:M/AR:M
	-> err: <nil>
	-> Severity: High (7.5)
Base only
	-> vector: AV:L/AC:H/Au:N/C:C/I:C/A:C
	-> err: <nil>
	-> Severity: Medium (6.2)
skip Environmental
	-> vector: AV:L/AC:H/Au:N/C:C/I:C/A:C/E:POC/RL:OF/RC:C
	-> err: <nil>
	-> Severity: Medium (4.9)
skip Temporal
	-> vector: AV:L/AC:H/Au:N/C:C/I:C/A:C/CDP:H/TD:H/CR:M/IR:M/AR:M
	-> err: <nil>
	-> Severity: High (8.1)

Full Changelog: v1.6.1...v1.6.2

v1.6.1

01 Feb 11:26
v1.6.1
808b26d
Compare
Choose a tag to compare

What's Changed

package main

import (
    "errors"
    "fmt"

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

func main() {
    raw := "AV:N/AC:L/Au:N/C:N/I:N/A:C/E:F/RL:OF/RC:C"
    vec, err := metric.NewEnvironmental().Decode(raw)
    fmt.Printf("err: %v\n", err)
    fmt.Printf("vector: %v\n", vec)
    switch true {
    case errors.Is(err, cvsserr.ErrNoEnvironmentalMetrics):
        fmt.Printf("Severity (Temporal): %v (%v)\n", vec.Temporal.Severity(), vec.Temporal.Score())
    case errors.Is(err, cvsserr.ErrNoTemporalMetrics):
        fmt.Printf("Severity (Base): %v (%v)\n", vec.Base.Severity(), vec.Base.Score())
    default:
        fmt.Printf("Severity (Environmental): %v (%v)\n", vec.Severity(), vec.Score())
    }
}

Full Changelog: v1.6.0...v1.6.1

v1.6.0

31 Jan 11:06
v1.6.0
290d6f8
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.5.0...v1.6.0

v1.5.0

31 Jan 07:08
v1.5.0
cb90764
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.4.6...v1.5.0

v1.4.6

31 Jan 01:55
v1.4.6
2953a5b
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.4.5...v1.4.6