From 65aa2e25dcc68544d40f1f9daf1c1d06c6f60223 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Mon, 23 Nov 2026 18:06:57 +0000 Subject: [PATCH] fix(grype): parse file sources and scan packages by purl grype 0.121 prints source.target as a string for file, directory and purl sources. The parser expected an object and failed every scan. A bare npm, PyPI or Go archive holds nothing grype can catalog, so a scan of the archive read minimist 0.0.8 as clean. The scanner now passes a purl for these registries and falls back to the file for others. --- pkg/scanner/gomodule/gomodule.go | 20 +++ pkg/scanner/gomodule/gomodule_test.go | 13 ++ pkg/scanner/grype/grype.go | 62 ++++++--- pkg/scanner/grype/grype_test.go | 126 ++++++++++++++++++ .../grype/testdata/file-minimist-0.0.8.json | 1 + .../grype/testdata/purl-dayjs-1.11.13.json | 1 + .../grype/testdata/purl-go-text-0.3.5.json | 1 + .../grype/testdata/purl-minimist-0.0.8.json | 1 + .../testdata/purl-pypi-requests-2.19.0.json | 1 + 9 files changed, 210 insertions(+), 16 deletions(-) create mode 100644 pkg/scanner/gomodule/gomodule.go create mode 100644 pkg/scanner/gomodule/gomodule_test.go create mode 100644 pkg/scanner/grype/grype_test.go create mode 100644 pkg/scanner/grype/testdata/file-minimist-0.0.8.json create mode 100644 pkg/scanner/grype/testdata/purl-dayjs-1.11.13.json create mode 100644 pkg/scanner/grype/testdata/purl-go-text-0.3.5.json create mode 100644 pkg/scanner/grype/testdata/purl-minimist-0.0.8.json create mode 100644 pkg/scanner/grype/testdata/purl-pypi-requests-2.19.0.json diff --git a/pkg/scanner/gomodule/gomodule.go b/pkg/scanner/gomodule/gomodule.go new file mode 100644 index 0000000..f25b978 --- /dev/null +++ b/pkg/scanner/gomodule/gomodule.go @@ -0,0 +1,20 @@ +// Package gomodule maps a Go cache key to a module path. +package gomodule + +import "strings" + +// Path returns the module path of a cache key "module/@v/version.zip", with the module proxy's +// case encoding ("!a" is "A") reversed. A name without "/@v/" is taken as the module path. +func Path(cacheKey string) string { + module, _, _ := strings.Cut(cacheKey, "/@v/") + var b strings.Builder + for i := 0; i < len(module); i++ { + if module[i] == '!' && i+1 < len(module) { + i++ + b.WriteString(strings.ToUpper(string(module[i]))) + continue + } + b.WriteByte(module[i]) + } + return b.String() +} diff --git a/pkg/scanner/gomodule/gomodule_test.go b/pkg/scanner/gomodule/gomodule_test.go new file mode 100644 index 0000000..b7b1d37 --- /dev/null +++ b/pkg/scanner/gomodule/gomodule_test.go @@ -0,0 +1,13 @@ +package gomodule + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestPath(t *testing.T) { + assert.Equal(t, "golang.org/x/text", Path("golang.org/x/text/@v/v0.3.5.zip")) + assert.Equal(t, "github.com/Azure/go-x", Path("github.com/!azure/go-x/@v/v1.2.3.zip")) + assert.Equal(t, "github.com/a/b/v2", Path("github.com/a/b/v2")) +} diff --git a/pkg/scanner/grype/grype.go b/pkg/scanner/grype/grype.go index b581019..98a164c 100644 --- a/pkg/scanner/grype/grype.go +++ b/pkg/scanner/grype/grype.go @@ -3,14 +3,17 @@ package grype import ( + "bytes" "context" "encoding/json" "fmt" "os/exec" + "strings" "time" "github.com/lukaszraczylo/gohoarder/pkg/config" "github.com/lukaszraczylo/gohoarder/pkg/metadata" + "github.com/lukaszraczylo/gohoarder/pkg/scanner/gomodule" "github.com/lukaszraczylo/gohoarder/pkg/uuid" "github.com/rs/zerolog/log" ) @@ -44,25 +47,25 @@ func (s *Scanner) Scan(ctx context.Context, registry, packageName, version strin Str("file", filePath). Msg("Starting Grype scan") - // Run grype scan - cmd := exec.CommandContext(ctx, "grype", filePath, "-o", "json", "-q") - output, err := cmd.CombinedOutput() - if err != nil { - // Grype returns non-zero exit code when vulnerabilities are found - // Only treat it as error if we got no output - if len(output) == 0 { - return nil, fmt.Errorf("grype scan failed: %w (output: %s)", err, string(output)) - } + target := purl(registry, packageName, version) + if target == "" { + target = filePath + } + cmd := exec.CommandContext(ctx, "grype", target, "-o", "json", "-q") // #nosec G204 -- target is a purl or the stored artifact path + var stderr bytes.Buffer + cmd.Stderr = &stderr + output, err := cmd.Output() + if err != nil && len(output) == 0 { + return nil, fmt.Errorf("grype scan failed: %w (stderr: %s)", err, strings.TrimSpace(stderr.String())) } - // Parse Grype JSON output - var grypeResult GrypeResult - if err := json.Unmarshal(output, &grypeResult); err != nil { - return nil, fmt.Errorf("failed to parse grype output: %w", err) + grypeResult, err := parse(output) + if err != nil { + return nil, err } // Convert to our format - result := s.convertGrypeResult(&grypeResult, registry, packageName, version) + result := s.convertGrypeResult(grypeResult, registry, packageName, version) log.Info(). Str("scanner", ScannerName). @@ -73,6 +76,33 @@ func (s *Scanner) Scan(ctx context.Context, registry, packageName, version strin return result, nil } +// purl names the package for grype. A bare npm, PyPI or Go archive has no lockfile or installed +// metadata, so grype catalogs nothing in it and reports clean; a purl is matched against the +// database directly. Empty means no purl can be built. +func purl(registry, name, version string) string { + if name == "" || version == "" { + return "" + } + version = strings.ReplaceAll(version, "+", "%2B") + switch registry { + case "npm": + return "pkg:npm/" + strings.Replace(name, "@", "%40", 1) + "@" + version + case "go": + return "pkg:golang/" + gomodule.Path(name) + "@" + version + case "pypi": + return "pkg:pypi/" + strings.ToLower(strings.NewReplacer("_", "-", ".", "-").Replace(name)) + "@" + version + } + return "" +} + +func parse(output []byte) (*GrypeResult, error) { + var res GrypeResult + if err := json.Unmarshal(output, &res); err != nil { + return nil, fmt.Errorf("failed to parse grype output: %w", err) + } + return &res, nil +} + // Health checks if Grype is available func (s *Scanner) Health(ctx context.Context) error { cmd := exec.CommandContext(ctx, "grype", "version") @@ -166,8 +196,8 @@ type GrypeDescriptor struct { } type GrypeSource struct { - Target map[string]interface{} `json:"target"` - Type string `json:"type"` + Type string `json:"type"` + Target json.RawMessage `json:"target"` // a string for file, directory and purl sources, an object for images } type GrypeMatch struct { diff --git a/pkg/scanner/grype/grype_test.go b/pkg/scanner/grype/grype_test.go new file mode 100644 index 0000000..8d2e7f1 --- /dev/null +++ b/pkg/scanner/grype/grype_test.go @@ -0,0 +1,126 @@ +package grype + +import ( + "context" + "os" + "path/filepath" + "testing" + + "github.com/lukaszraczylo/gohoarder/pkg/config" + "github.com/lukaszraczylo/gohoarder/pkg/metadata" + "github.com/lukaszraczylo/gohoarder/pkg/scanner/scannertest" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// The fixtures are real `grype -o json -q` output from grype 0.121.2 (see FINDINGS GH-25). +func fixture(name string) string { return filepath.Join("testdata", name) } + +func TestParseFileScanTargetIsAString(t *testing.T) { + data, err := os.ReadFile(fixture("file-minimist-0.0.8.json")) + require.NoError(t, err) + + res, err := parse(data) + + require.NoError(t, err) + assert.Equal(t, "file", res.Source.Type) +} + +func TestScanMapsRealOutput(t *testing.T) { + cases := []struct { + wantSeverities map[string]string + wantFixedIn map[string]string + name, fixture, registry, pkg, version string + wantPurl string + wantStatus metadata.ScanStatus + }{ + { + name: "npm vulnerable", fixture: "purl-minimist-0.0.8.json", registry: "npm", pkg: "minimist", version: "0.0.8", + wantPurl: "pkg:npm/minimist@0.0.8", wantStatus: metadata.ScanStatusVulnerable, + wantSeverities: map[string]string{"GHSA-xvch-5gv4-984h": "CRITICAL", "GHSA-vh95-rmgr-6w4m": "MODERATE"}, + wantFixedIn: map[string]string{"GHSA-xvch-5gv4-984h": "0.2.4"}, + }, + { + name: "npm clean", fixture: "purl-dayjs-1.11.13.json", registry: "npm", pkg: "dayjs", version: "1.11.13", + wantPurl: "pkg:npm/dayjs@1.11.13", wantStatus: metadata.ScanStatusClean, + }, + { + name: "go vulnerable", fixture: "purl-go-text-0.3.5.json", registry: "go", pkg: "golang.org/x/text/@v/v0.3.5.zip", version: "v0.3.5", + wantPurl: "pkg:golang/golang.org/x/text@v0.3.5", wantStatus: metadata.ScanStatusVulnerable, + wantSeverities: map[string]string{"GHSA-69ch-w2m2-3vjp": "HIGH", "GO-2026-6629": "HIGH"}, + }, + { + name: "pypi vulnerable", fixture: "purl-pypi-requests-2.19.0.json", registry: "pypi", pkg: "requests", version: "2.19.0", + wantPurl: "pkg:pypi/requests@2.19.0", wantStatus: metadata.ScanStatusVulnerable, + wantSeverities: map[string]string{"GHSA-x84v-xcm2-53pg": "HIGH", "GHSA-j8r2-6x86-q33q": "MODERATE"}, + }, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + args := scannertest.Fake(t, "grype", fixture(tc.fixture), "", 0) + + res, err := New(config.GrypeConfig{}).Scan(context.Background(), tc.registry, tc.pkg, tc.version, "/tmp/artifact") + + require.NoError(t, err) + assert.Equal(t, tc.wantStatus, res.Status) + assert.Equal(t, tc.wantPurl, scannertest.Args(t, args)[0], "the package is scanned by purl, not by its archive") + got := map[string]string{} + fixed := map[string]string{} + for _, v := range res.Vulnerabilities { + got[v.ID] = v.Severity + fixed[v.ID] = v.FixedIn + } + for id, sev := range tc.wantSeverities { + assert.Equal(t, sev, got[id], id) + } + for id, f := range tc.wantFixedIn { + assert.Equal(t, f, fixed[id], id) + } + assert.Equal(t, len(res.Vulnerabilities), res.VulnerabilityCount) + }) + } +} + +func TestScanFallsBackToFileForUnknownRegistry(t *testing.T) { + args := scannertest.Fake(t, "grype", fixture("file-minimist-0.0.8.json"), "", 0) + + res, err := New(config.GrypeConfig{}).Scan(context.Background(), "docker", "x", "1", "/tmp/artifact.tar") + + require.NoError(t, err) + assert.Equal(t, metadata.ScanStatusClean, res.Status) + assert.Equal(t, "/tmp/artifact.tar", scannertest.Args(t, args)[0]) +} + +func TestScanIgnoresStderrNoise(t *testing.T) { + scannertest.Fake(t, "grype", fixture("purl-dayjs-1.11.13.json"), "[0000] WARN something\n", 0) + + res, err := New(config.GrypeConfig{}).Scan(context.Background(), "npm", "dayjs", "1.11.13", "/tmp/a.tgz") + + require.NoError(t, err) + assert.Equal(t, metadata.ScanStatusClean, res.Status) +} + +func TestScanFailureWithoutOutputIsAnError(t *testing.T) { + scannertest.Fake(t, "grype", "", "failed to load vulnerability db", 1) + + _, err := New(config.GrypeConfig{}).Scan(context.Background(), "npm", "dayjs", "1.11.13", "/tmp/a.tgz") + + require.Error(t, err) + assert.Contains(t, err.Error(), "failed to load vulnerability db") +} + +func TestPurl(t *testing.T) { + cases := []struct{ registry, name, version, want string }{ + {"npm", "left-pad", "1.3.0", "pkg:npm/left-pad@1.3.0"}, + {"npm", "@babel/traverse", "7.0.0", "pkg:npm/%40babel/traverse@7.0.0"}, + {"go", "github.com/!azure/go-x/@v/v1.2.3.zip", "v1.2.3", "pkg:golang/github.com/Azure/go-x@v1.2.3"}, + {"go", "github.com/a/b/v2/@v/v2.0.0+incompatible.zip", "v2.0.0+incompatible", "pkg:golang/github.com/a/b/v2@v2.0.0%2Bincompatible"}, + {"pypi", "Zope.Interface_x", "5.0", "pkg:pypi/zope-interface-x@5.0"}, + {"npm", "", "1", ""}, + {"npm", "x", "", ""}, + {"docker", "x", "1", ""}, + } + for _, tc := range cases { + assert.Equal(t, tc.want, purl(tc.registry, tc.name, tc.version), "%s %s", tc.registry, tc.name) + } +} diff --git a/pkg/scanner/grype/testdata/file-minimist-0.0.8.json b/pkg/scanner/grype/testdata/file-minimist-0.0.8.json new file mode 100644 index 0000000..540c49e --- /dev/null +++ b/pkg/scanner/grype/testdata/file-minimist-0.0.8.json @@ -0,0 +1 @@ +{"matches":[],"source":{"type":"file","target":"minimist-0.0.8.tgz"},"distro":{"name":"","version":"","idLike":null},"descriptor":{"name":"grype","version":"0.121.2","configuration":{"output":["json"],"file":"","pretty":false,"distro":"","add-cpes-if-none":false,"output-template-file":"","check-for-app-update":true,"only-fixed":false,"only-notfixed":false,"ignore-wontfix":"","platform":"","search":{"scope":"squashed","unindexed-archives":false,"indexed-archives":true},"ignore":[{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"kernel-headers","version":"","language":"","type":"rpm","location":"","upstream-name":"kernel"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"},{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"linux(-.*)?-headers-.*","version":"","language":"","type":"deb","location":"","upstream-name":"linux.*"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"},{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"linux-libc-dev","version":"","language":"","type":"deb","location":"","upstream-name":"linux"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"},{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"linux-kbuild-.*","version":"","language":"","type":"deb","location":"","upstream-name":"linux.*"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"}],"exclude":[],"externalSources":{"enable":false,"maven":{"searchUpstreamBySha1":true,"baseUrl":"https://search.maven.org/solrsearch/select","rateLimit":300000000}},"match":{"java":{"using-cpes":false},"jvm":{"using-cpes":true},"dotnet":{"using-cpes":false},"golang":{"using-cpes":false,"always-use-cpe-for-stdlib":false,"allow-main-module-pseudo-version-comparison":false},"javascript":{"using-cpes":false},"python":{"using-cpes":false},"ruby":{"using-cpes":false},"rust":{"using-cpes":false},"hex":{"using-cpes":false},"stock":{"using-cpes":true},"dpkg":{"using-cpes":false,"missing-epoch-strategy":"zero","use-cpes-for-eol":false},"rpm":{"using-cpes":false,"missing-epoch-strategy":"auto","use-cpes-for-eol":false}},"fail-on-severity":"","registry":{"insecure-skip-tls-verify":false,"insecure-use-http":false,"ca-cert":""},"show-suppressed":false,"include-matcher-suppressions":false,"by-cve":false,"SortBy":{"sort-by":"risk"},"name":"","default-image-pull-source":"","from":null,"vex-documents":[],"vex-add":[],"match-upstream-kernel-headers":false,"fix-channel":{"redhat-eus":{"apply":"auto","versions":">= 8.0"},"ubuntu-esm":{"apply":"auto","versions":""}},"timestamp":true,"alerts":{"enable-eol-distro-warnings":true},"db":{"cache-dir":"/home/scanner/.cache/grype/db","update-url":"https://grype.anchore.io/databases","ca-cert":"","auto-update":true,"validate-by-hash-on-start":true,"validate-age":true,"max-allowed-built-age":432000000000000,"require-update-check":false,"update-available-timeout":30000000000,"update-download-timeout":300000000000,"max-update-check-frequency":7200000000000},"exp":{},"dev":{"db":{"debug":false}}},"db":{"status":{"schemaVersion":"v6.1.10","from":"https://grype.anchore.io/databases/v6/vulnerability-db_v6.1.10_2026-11-23T00:24:20Z_1795415312.tar.zst?checksum=sha256%3A3d24f57cd3587e2c73f686decc7ad04b213d1f3575bcf1dd847e42df94560f14","built":"2026-11-23T06:28:32Z","path":"/home/scanner/.cache/grype/db/6/vulnerability.db","valid":true},"providers":{"alma":{"captured":"2026-11-23T00:24:25Z","input":"xxh64:9fd4413e0321c324"},"alpine":{"captured":"2026-11-23T00:24:52Z","input":"xxh64:626087ccb8a36373"},"amazon":{"captured":"2026-11-23T00:24:34Z","input":"xxh64:083d74859c705607"},"arch":{"captured":"2026-11-23T00:24:23Z","input":"xxh64:767233e7552ae911"},"bitnami":{"captured":"2026-11-23T00:24:30Z","input":"xxh64:542814d1e958c4e3"},"chainguard":{"captured":"2026-11-23T00:25:25Z","input":"xxh64:40d4772eb76c342f"},"chainguard-libraries":{"captured":"2026-11-23T00:24:52Z","input":"xxh64:73b958306e2dce58"},"debian":{"captured":"2026-11-23T00:24:40Z","input":"xxh64:f9a6456f81777f29"},"dhi":{"captured":"2026-11-23T00:24:45Z","input":"xxh64:a6b8e4e1d1aecfa1"},"echo":{"captured":"2026-11-23T00:24:27Z","input":"xxh64:a2e80388a7d54bb0"},"eol":{"captured":"2026-11-23T00:24:23Z","input":"xxh64:3a3243012dede451"},"epss":{"captured":"2026-11-23T00:24:28Z","input":"xxh64:617f4201c8a347c1"},"fedora":{"captured":"2026-11-23T00:24:35Z","input":"xxh64:55853e5256082c94"},"github":{"captured":"2026-11-23T00:24:47Z","input":"xxh64:1db626b836a7b9a3"},"govulndb":{"captured":"2026-11-23T00:24:22Z","input":"xxh64:4e5d90d5b45aeeb1"},"hummingbird":{"captured":"2026-11-23T00:27:40Z","input":"xxh64:968bec75e99f7d9a"},"kev":{"captured":"2026-11-23T00:24:27Z","input":"xxh64:f9dc8833117b9cfb"},"mariner":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:f8299848201c9565"},"minimos":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:4f5198a5f5c667f3"},"nvd":{"captured":"2026-11-23T00:25:29Z","input":"xxh64:2a0ff8d069da733e"},"oracle":{"captured":"2026-11-23T00:24:36Z","input":"xxh64:ef43f7a6df2d7adf"},"photon":{"captured":"2026-11-23T00:24:26Z","input":"xxh64:830daa42e4331294"},"rhel":{"captured":"2026-11-23T00:26:09Z","input":"xxh64:fc3e7c2e917a2b8d"},"secureos":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:16d87472840d1693"},"sles":{"captured":"2026-11-23T00:26:40Z","input":"xxh64:afa8d8bc8fe91131"},"ubuntu":{"captured":"2026-11-23T00:25:23Z","input":"xxh64:c4e9de4958b5ec11"},"wolfi":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:2d968f4266204048"}}},"timestamp":"2026-11-23T17:56:22.18207516Z"}} diff --git a/pkg/scanner/grype/testdata/purl-dayjs-1.11.13.json b/pkg/scanner/grype/testdata/purl-dayjs-1.11.13.json new file mode 100644 index 0000000..f9ca9f3 --- /dev/null +++ b/pkg/scanner/grype/testdata/purl-dayjs-1.11.13.json @@ -0,0 +1 @@ +{"matches":[],"source":{"type":"purl","target":"pkg:npm/dayjs@1.11.13"},"distro":{"name":"","version":"","idLike":null},"descriptor":{"name":"grype","version":"0.121.2","configuration":{"output":["json"],"file":"","pretty":false,"distro":"","add-cpes-if-none":false,"output-template-file":"","check-for-app-update":true,"only-fixed":false,"only-notfixed":false,"ignore-wontfix":"","platform":"","search":{"scope":"squashed","unindexed-archives":false,"indexed-archives":true},"ignore":[{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"kernel-headers","version":"","language":"","type":"rpm","location":"","upstream-name":"kernel"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"},{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"linux(-.*)?-headers-.*","version":"","language":"","type":"deb","location":"","upstream-name":"linux.*"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"},{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"linux-libc-dev","version":"","language":"","type":"deb","location":"","upstream-name":"linux"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"},{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"linux-kbuild-.*","version":"","language":"","type":"deb","location":"","upstream-name":"linux.*"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"}],"exclude":[],"externalSources":{"enable":false,"maven":{"searchUpstreamBySha1":true,"baseUrl":"https://search.maven.org/solrsearch/select","rateLimit":300000000}},"match":{"java":{"using-cpes":false},"jvm":{"using-cpes":true},"dotnet":{"using-cpes":false},"golang":{"using-cpes":false,"always-use-cpe-for-stdlib":false,"allow-main-module-pseudo-version-comparison":false},"javascript":{"using-cpes":false},"python":{"using-cpes":false},"ruby":{"using-cpes":false},"rust":{"using-cpes":false},"hex":{"using-cpes":false},"stock":{"using-cpes":true},"dpkg":{"using-cpes":false,"missing-epoch-strategy":"zero","use-cpes-for-eol":false},"rpm":{"using-cpes":false,"missing-epoch-strategy":"auto","use-cpes-for-eol":false}},"fail-on-severity":"","registry":{"insecure-skip-tls-verify":false,"insecure-use-http":false,"ca-cert":""},"show-suppressed":false,"include-matcher-suppressions":false,"by-cve":false,"SortBy":{"sort-by":"risk"},"name":"","default-image-pull-source":"","from":null,"vex-documents":[],"vex-add":[],"match-upstream-kernel-headers":false,"fix-channel":{"redhat-eus":{"apply":"auto","versions":">= 8.0"},"ubuntu-esm":{"apply":"auto","versions":""}},"timestamp":true,"alerts":{"enable-eol-distro-warnings":true},"db":{"cache-dir":"/home/scanner/.cache/grype/db","update-url":"https://grype.anchore.io/databases","ca-cert":"","auto-update":true,"validate-by-hash-on-start":true,"validate-age":true,"max-allowed-built-age":432000000000000,"require-update-check":false,"update-available-timeout":30000000000,"update-download-timeout":300000000000,"max-update-check-frequency":7200000000000},"exp":{},"dev":{"db":{"debug":false}}},"db":{"status":{"schemaVersion":"v6.1.10","from":"https://grype.anchore.io/databases/v6/vulnerability-db_v6.1.10_2026-11-23T00:24:20Z_1795415312.tar.zst?checksum=sha256%3A3d24f57cd3587e2c73f686decc7ad04b213d1f3575bcf1dd847e42df94560f14","built":"2026-11-23T06:28:32Z","path":"/home/scanner/.cache/grype/db/6/vulnerability.db","valid":true},"providers":{"alma":{"captured":"2026-11-23T00:24:25Z","input":"xxh64:9fd4413e0321c324"},"alpine":{"captured":"2026-11-23T00:24:52Z","input":"xxh64:626087ccb8a36373"},"amazon":{"captured":"2026-11-23T00:24:34Z","input":"xxh64:083d74859c705607"},"arch":{"captured":"2026-11-23T00:24:23Z","input":"xxh64:767233e7552ae911"},"bitnami":{"captured":"2026-11-23T00:24:30Z","input":"xxh64:542814d1e958c4e3"},"chainguard":{"captured":"2026-11-23T00:25:25Z","input":"xxh64:40d4772eb76c342f"},"chainguard-libraries":{"captured":"2026-11-23T00:24:52Z","input":"xxh64:73b958306e2dce58"},"debian":{"captured":"2026-11-23T00:24:40Z","input":"xxh64:f9a6456f81777f29"},"dhi":{"captured":"2026-11-23T00:24:45Z","input":"xxh64:a6b8e4e1d1aecfa1"},"echo":{"captured":"2026-11-23T00:24:27Z","input":"xxh64:a2e80388a7d54bb0"},"eol":{"captured":"2026-11-23T00:24:23Z","input":"xxh64:3a3243012dede451"},"epss":{"captured":"2026-11-23T00:24:28Z","input":"xxh64:617f4201c8a347c1"},"fedora":{"captured":"2026-11-23T00:24:35Z","input":"xxh64:55853e5256082c94"},"github":{"captured":"2026-11-23T00:24:47Z","input":"xxh64:1db626b836a7b9a3"},"govulndb":{"captured":"2026-11-23T00:24:22Z","input":"xxh64:4e5d90d5b45aeeb1"},"hummingbird":{"captured":"2026-11-23T00:27:40Z","input":"xxh64:968bec75e99f7d9a"},"kev":{"captured":"2026-11-23T00:24:27Z","input":"xxh64:f9dc8833117b9cfb"},"mariner":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:f8299848201c9565"},"minimos":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:4f5198a5f5c667f3"},"nvd":{"captured":"2026-11-23T00:25:29Z","input":"xxh64:2a0ff8d069da733e"},"oracle":{"captured":"2026-11-23T00:24:36Z","input":"xxh64:ef43f7a6df2d7adf"},"photon":{"captured":"2026-11-23T00:24:26Z","input":"xxh64:830daa42e4331294"},"rhel":{"captured":"2026-11-23T00:26:09Z","input":"xxh64:fc3e7c2e917a2b8d"},"secureos":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:16d87472840d1693"},"sles":{"captured":"2026-11-23T00:26:40Z","input":"xxh64:afa8d8bc8fe91131"},"ubuntu":{"captured":"2026-11-23T00:25:23Z","input":"xxh64:c4e9de4958b5ec11"},"wolfi":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:2d968f4266204048"}}},"timestamp":"2026-11-23T17:56:18.278543325Z"}} diff --git a/pkg/scanner/grype/testdata/purl-go-text-0.3.5.json b/pkg/scanner/grype/testdata/purl-go-text-0.3.5.json new file mode 100644 index 0000000..7b51eb5 --- /dev/null +++ b/pkg/scanner/grype/testdata/purl-go-text-0.3.5.json @@ -0,0 +1 @@ +{"matches":[{"vulnerability":{"id":"GHSA-69ch-w2m2-3vjp","dataSource":"https://github.com/advisories/GHSA-69ch-w2m2-3vjp","namespace":"github:language:go","severity":"High","urls":["https://nvd.nist.gov/vuln/detail/CVE-2022-32149","https://go.dev/cl/442235","https://go.dev/issue/56152","https://groups.google.com/g/golang-announce/c/-hjNw559_tE/m/KlGTfid5CAAJ","https://pkg.go.dev/vuln/GO-2022-1059","https://github.com/golang/go/issues/56152","https://github.com/golang/text/commit/434eadcdbc3b0256971992e8c70027278364c72c","https://security.netapp.com/advisory/ntap-20230203-0006"],"description":"golang.org/x/text/language Denial of service via crafted Accept-Language header","cvss":[{"type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","metrics":{"baseScore":7.5,"exploitabilityScore":3.9,"impactScore":3.6},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2022-32149","epss":0.01841,"percentile":0.79543,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2022-32149","cwe":"CWE-772","source":"nvd@nist.gov","type":"Primary"}],"fix":{"versions":["0.3.8"],"state":"fixed","available":[{"version":"0.3.8","date":"2023-02-23","kind":"first-observed"}]},"advisories":[],"risk":1.38075},"relatedVulnerabilities":[{"id":"CVE-2022-32149","dataSource":"https://nvd.nist.gov/vuln/detail/CVE-2022-32149","namespace":"nvd:cpe","severity":"High","urls":["https://go.dev/cl/442235","https://go.dev/issue/56152","https://groups.google.com/g/golang-announce/c/-hjNw559_tE/m/KlGTfid5CAAJ","https://pkg.go.dev/vuln/GO-2022-1059","https://security.netapp.com/advisory/ntap-20230203-0006/"],"description":"An attacker may cause a denial of service by crafting an Accept-Language header which ParseAcceptLanguage will take significant time to parse.","cvss":[{"source":"nvd@nist.gov","type":"Primary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","metrics":{"baseScore":7.5,"exploitabilityScore":3.9,"impactScore":3.6},"vendorMetadata":{}},{"source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","metrics":{"baseScore":7.5,"exploitabilityScore":3.9,"impactScore":3.6},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2022-32149","epss":0.01841,"percentile":0.79543,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2022-32149","cwe":"CWE-772","source":"nvd@nist.gov","type":"Primary"}]}],"matchDetails":[{"type":"exact-direct-match","matcher":"go-module-matcher","searchedBy":{"language":"go","namespace":"github:language:go","package":{"name":"golang.org/x/text","version":"v0.3.5"}},"found":{"vulnerabilityID":"GHSA-69ch-w2m2-3vjp","versionConstraint":"<0.3.8 (go)"},"fix":{"suggestedVersion":"0.3.8"}}],"artifact":{"id":"c798aff519efc8d4","name":"golang.org/x/text","version":"v0.3.5","type":"go-module","locations":null,"language":"go","licenses":[],"cpes":[],"purl":"pkg:golang/golang.org/x/text@v0.3.5","upstreams":[]}},{"vulnerability":{"id":"GHSA-ppp9-7jff-5vj2","dataSource":"https://github.com/advisories/GHSA-ppp9-7jff-5vj2","namespace":"github:language:go","severity":"High","urls":["https://nvd.nist.gov/vuln/detail/CVE-2021-38561","https://deps.dev/advisory/OSV/GO-2021-0113","https://go.googlesource.com/text/+/383b2e75a7a4198c42f8f87833eefb772868a56f","https://groups.google.com/g/golang-announce","https://pkg.go.dev/golang.org/x/text/language","https://go.dev/cl/340830","https://pkg.go.dev/vuln/GO-2021-0113"],"description":"golang.org/x/text/language Out-of-bounds Read vulnerability","cvss":[{"type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","metrics":{"baseScore":7.5,"exploitabilityScore":3.9,"impactScore":3.6},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2021-38561","epss":0.01484,"percentile":0.74657,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2021-38561","cwe":"CWE-125","source":"nvd@nist.gov","type":"Primary"},{"cve":"CVE-2021-38561","cwe":"CWE-125","source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","type":"Secondary"}],"fix":{"versions":["0.3.7"],"state":"fixed","available":[{"version":"0.3.7","date":"2023-02-26","kind":"first-observed"}]},"advisories":[],"risk":1.113},"relatedVulnerabilities":[{"id":"CVE-2021-38561","dataSource":"https://nvd.nist.gov/vuln/detail/CVE-2021-38561","namespace":"nvd:cpe","severity":"High","urls":["https://deps.dev/advisory/OSV/GO-2021-0113","https://go.googlesource.com/text/+/383b2e75a7a4198c42f8f87833eefb772868a56f","https://groups.google.com/g/golang-announce","https://pkg.go.dev/golang.org/x/text/language"],"description":"golang.org/x/text/language in golang.org/x/text before 0.3.7 can panic with an out-of-bounds read during BCP 47 language tag parsing. Index calculation is mishandled. If parsing untrusted user input, this can be used as a vector for a denial-of-service attack.","cvss":[{"source":"nvd@nist.gov","type":"Primary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","metrics":{"baseScore":7.5,"exploitabilityScore":3.9,"impactScore":3.6},"vendorMetadata":{}},{"source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","metrics":{"baseScore":7.5,"exploitabilityScore":3.9,"impactScore":3.6},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2021-38561","epss":0.01484,"percentile":0.74657,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2021-38561","cwe":"CWE-125","source":"nvd@nist.gov","type":"Primary"},{"cve":"CVE-2021-38561","cwe":"CWE-125","source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","type":"Secondary"}]}],"matchDetails":[{"type":"exact-direct-match","matcher":"go-module-matcher","searchedBy":{"language":"go","namespace":"github:language:go","package":{"name":"golang.org/x/text","version":"v0.3.5"}},"found":{"vulnerabilityID":"GHSA-ppp9-7jff-5vj2","versionConstraint":"<0.3.7 (go)"},"fix":{"suggestedVersion":"0.3.7"}}],"artifact":{"id":"c798aff519efc8d4","name":"golang.org/x/text","version":"v0.3.5","type":"go-module","locations":null,"language":"go","licenses":[],"cpes":[],"purl":"pkg:golang/golang.org/x/text@v0.3.5","upstreams":[]}},{"vulnerability":{"id":"GO-2026-5970","dataSource":"https://go.dev/issue/80142","namespace":"govulndb:language:go","severity":"High","urls":["https://go.dev/cl/794100"],"description":"A norm.Iter can enter an infinite loop when handling input containing invalid UTF-8 bytes.","cvss":[{"source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","metrics":{"baseScore":7.5,"exploitabilityScore":3.9,"impactScore":3.6},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2026-56852","epss":0.00475,"percentile":0.41887,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2026-56852","cwe":"CWE-835","source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","type":"Secondary"}],"fix":{"versions":["0.39.0"],"state":"fixed","available":[{"version":"0.39.0","date":"2026-06-30","kind":"release"}]},"advisories":[],"risk":0.35624999999999996},"relatedVulnerabilities":[{"id":"CVE-2026-56852","dataSource":"https://nvd.nist.gov/vuln/detail/CVE-2026-56852","namespace":"nvd:cpe","severity":"High","urls":["https://go.dev/cl/794100","https://go.dev/issue/80142","https://pkg.go.dev/vuln/GO-2026-5970"],"description":"A norm.Iter can enter an infinite loop when handling input containing invalid UTF-8 bytes.","cvss":[{"source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","metrics":{"baseScore":7.5,"exploitabilityScore":3.9,"impactScore":3.6},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2026-56852","epss":0.00475,"percentile":0.41887,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2026-56852","cwe":"CWE-835","source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","type":"Secondary"}]}],"matchDetails":[{"type":"exact-direct-match","matcher":"go-module-matcher","searchedBy":{"language":"go","namespace":"govulndb:language:go","package":{"name":"golang.org/x/text","version":"v0.3.5"}},"found":{"vulnerabilityID":"GO-2026-5970","versionConstraint":"<0.39.0 (go)"},"fix":{"suggestedVersion":"0.39.0"}}],"artifact":{"id":"c798aff519efc8d4","name":"golang.org/x/text","version":"v0.3.5","type":"go-module","locations":null,"language":"go","licenses":[],"cpes":[],"purl":"pkg:golang/golang.org/x/text@v0.3.5","upstreams":[]}},{"vulnerability":{"id":"GO-2026-6629","dataSource":"https://go.dev/cl/793360","namespace":"govulndb:language:go","severity":"High","urls":["https://go.dev/issue/80112"],"description":"The Nickname profile can panic with an out-of-bounds slice error when transforming crafted input into a short destination buffer.","cvss":[{"source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","metrics":{"baseScore":7.5,"exploitabilityScore":3.9,"impactScore":3.6},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2026-56851","epss":0.00466,"percentile":0.41115,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2026-56851","cwe":"CWE-787","source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","type":"Secondary"}],"fix":{"versions":["0.41.0"],"state":"fixed","available":[{"version":"0.41.0","date":"2026-08-11","kind":"release"}]},"advisories":[],"risk":0.3495},"relatedVulnerabilities":[{"id":"CVE-2026-56851","dataSource":"https://nvd.nist.gov/vuln/detail/CVE-2026-56851","namespace":"nvd:cpe","severity":"High","urls":["https://go.dev/cl/793360","https://go.dev/issue/80112","https://pkg.go.dev/vuln/GO-2026-6629"],"description":"The Nickname profile can panic with an out-of-bounds slice error when transforming crafted input into a short destination buffer.","cvss":[{"source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","metrics":{"baseScore":7.5,"exploitabilityScore":3.9,"impactScore":3.6},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2026-56851","epss":0.00466,"percentile":0.41115,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2026-56851","cwe":"CWE-787","source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","type":"Secondary"}]}],"matchDetails":[{"type":"exact-direct-match","matcher":"go-module-matcher","searchedBy":{"language":"go","namespace":"govulndb:language:go","package":{"name":"golang.org/x/text","version":"v0.3.5"}},"found":{"vulnerabilityID":"GO-2026-6629","versionConstraint":"<0.41.0 (go)"},"fix":{"suggestedVersion":"0.41.0"}}],"artifact":{"id":"c798aff519efc8d4","name":"golang.org/x/text","version":"v0.3.5","type":"go-module","locations":null,"language":"go","licenses":[],"cpes":[],"purl":"pkg:golang/golang.org/x/text@v0.3.5","upstreams":[]}}],"source":{"type":"purl","target":"pkg:golang/golang.org/x/text@v0.3.5"},"distro":{"name":"","version":"","idLike":null},"descriptor":{"name":"grype","version":"0.121.2","configuration":{"output":["json"],"file":"","pretty":false,"distro":"","add-cpes-if-none":false,"output-template-file":"","check-for-app-update":true,"only-fixed":false,"only-notfixed":false,"ignore-wontfix":"","platform":"","search":{"scope":"squashed","unindexed-archives":false,"indexed-archives":true},"ignore":[{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"kernel-headers","version":"","language":"","type":"rpm","location":"","upstream-name":"kernel"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"},{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"linux(-.*)?-headers-.*","version":"","language":"","type":"deb","location":"","upstream-name":"linux.*"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"},{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"linux-libc-dev","version":"","language":"","type":"deb","location":"","upstream-name":"linux"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"},{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"linux-kbuild-.*","version":"","language":"","type":"deb","location":"","upstream-name":"linux.*"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"}],"exclude":[],"externalSources":{"enable":false,"maven":{"searchUpstreamBySha1":true,"baseUrl":"https://search.maven.org/solrsearch/select","rateLimit":300000000}},"match":{"java":{"using-cpes":false},"jvm":{"using-cpes":true},"dotnet":{"using-cpes":false},"golang":{"using-cpes":false,"always-use-cpe-for-stdlib":false,"allow-main-module-pseudo-version-comparison":false},"javascript":{"using-cpes":false},"python":{"using-cpes":false},"ruby":{"using-cpes":false},"rust":{"using-cpes":false},"hex":{"using-cpes":false},"stock":{"using-cpes":true},"dpkg":{"using-cpes":false,"missing-epoch-strategy":"zero","use-cpes-for-eol":false},"rpm":{"using-cpes":false,"missing-epoch-strategy":"auto","use-cpes-for-eol":false}},"fail-on-severity":"","registry":{"insecure-skip-tls-verify":false,"insecure-use-http":false,"ca-cert":""},"show-suppressed":false,"include-matcher-suppressions":false,"by-cve":false,"SortBy":{"sort-by":"risk"},"name":"","default-image-pull-source":"","from":null,"vex-documents":[],"vex-add":[],"match-upstream-kernel-headers":false,"fix-channel":{"redhat-eus":{"apply":"auto","versions":">= 8.0"},"ubuntu-esm":{"apply":"auto","versions":""}},"timestamp":true,"alerts":{"enable-eol-distro-warnings":true},"db":{"cache-dir":"/home/scanner/.cache/grype/db","update-url":"https://grype.anchore.io/databases","ca-cert":"","auto-update":true,"validate-by-hash-on-start":true,"validate-age":true,"max-allowed-built-age":432000000000000,"require-update-check":false,"update-available-timeout":30000000000,"update-download-timeout":300000000000,"max-update-check-frequency":7200000000000},"exp":{},"dev":{"db":{"debug":false}}},"db":{"status":{"schemaVersion":"v6.1.10","from":"https://grype.anchore.io/databases/v6/vulnerability-db_v6.1.10_2026-11-23T00:24:20Z_1795415312.tar.zst?checksum=sha256%3A3d24f57cd3587e2c73f686decc7ad04b213d1f3575bcf1dd847e42df94560f14","built":"2026-11-23T06:28:32Z","path":"/home/scanner/.cache/grype/db/6/vulnerability.db","valid":true},"providers":{"alma":{"captured":"2026-11-23T00:24:25Z","input":"xxh64:9fd4413e0321c324"},"alpine":{"captured":"2026-11-23T00:24:52Z","input":"xxh64:626087ccb8a36373"},"amazon":{"captured":"2026-11-23T00:24:34Z","input":"xxh64:083d74859c705607"},"arch":{"captured":"2026-11-23T00:24:23Z","input":"xxh64:767233e7552ae911"},"bitnami":{"captured":"2026-11-23T00:24:30Z","input":"xxh64:542814d1e958c4e3"},"chainguard":{"captured":"2026-11-23T00:25:25Z","input":"xxh64:40d4772eb76c342f"},"chainguard-libraries":{"captured":"2026-11-23T00:24:52Z","input":"xxh64:73b958306e2dce58"},"debian":{"captured":"2026-11-23T00:24:40Z","input":"xxh64:f9a6456f81777f29"},"dhi":{"captured":"2026-11-23T00:24:45Z","input":"xxh64:a6b8e4e1d1aecfa1"},"echo":{"captured":"2026-11-23T00:24:27Z","input":"xxh64:a2e80388a7d54bb0"},"eol":{"captured":"2026-11-23T00:24:23Z","input":"xxh64:3a3243012dede451"},"epss":{"captured":"2026-11-23T00:24:28Z","input":"xxh64:617f4201c8a347c1"},"fedora":{"captured":"2026-11-23T00:24:35Z","input":"xxh64:55853e5256082c94"},"github":{"captured":"2026-11-23T00:24:47Z","input":"xxh64:1db626b836a7b9a3"},"govulndb":{"captured":"2026-11-23T00:24:22Z","input":"xxh64:4e5d90d5b45aeeb1"},"hummingbird":{"captured":"2026-11-23T00:27:40Z","input":"xxh64:968bec75e99f7d9a"},"kev":{"captured":"2026-11-23T00:24:27Z","input":"xxh64:f9dc8833117b9cfb"},"mariner":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:f8299848201c9565"},"minimos":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:4f5198a5f5c667f3"},"nvd":{"captured":"2026-11-23T00:25:29Z","input":"xxh64:2a0ff8d069da733e"},"oracle":{"captured":"2026-11-23T00:24:36Z","input":"xxh64:ef43f7a6df2d7adf"},"photon":{"captured":"2026-11-23T00:24:26Z","input":"xxh64:830daa42e4331294"},"rhel":{"captured":"2026-11-23T00:26:09Z","input":"xxh64:fc3e7c2e917a2b8d"},"secureos":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:16d87472840d1693"},"sles":{"captured":"2026-11-23T00:26:40Z","input":"xxh64:afa8d8bc8fe91131"},"ubuntu":{"captured":"2026-11-23T00:25:23Z","input":"xxh64:c4e9de4958b5ec11"},"wolfi":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:2d968f4266204048"}}},"timestamp":"2026-11-23T17:56:19.408447325Z"}} diff --git a/pkg/scanner/grype/testdata/purl-minimist-0.0.8.json b/pkg/scanner/grype/testdata/purl-minimist-0.0.8.json new file mode 100644 index 0000000..9bf9798 --- /dev/null +++ b/pkg/scanner/grype/testdata/purl-minimist-0.0.8.json @@ -0,0 +1 @@ +{"matches":[{"vulnerability":{"id":"GHSA-xvch-5gv4-984h","dataSource":"https://github.com/advisories/GHSA-xvch-5gv4-984h","namespace":"github:language:javascript","severity":"Critical","urls":["https://nvd.nist.gov/vuln/detail/CVE-2021-44906","https://github.com/substack/minimist/issues/164","https://github.com/substack/minimist/blob/master/index.js#L69","https://snyk.io/vuln/SNYK-JS-MINIMIST-559764","https://stackoverflow.com/questions/8588563/adding-custom-properties-to-a-function/20278068#20278068","https://github.com/Marynk/JavaScript-vulnerability-detection/blob/main/minimist%20PoC.zip","https://github.com/minimistjs/minimist/issues/11","https://github.com/minimistjs/minimist/pull/24","https://github.com/minimistjs/minimist/commit/34e20b8461118608703d6485326abbb8e35e1703","https://github.com/minimistjs/minimist/commit/bc8ecee43875261f4f17eb20b1243d3ed15e70eb","https://github.com/minimistjs/minimist/commit/c2b981977fa834b223b408cfb860f933c9811e4d","https://github.com/minimistjs/minimist/commit/ef9153fc52b6cea0744b2239921c5dcae4697f11","https://github.com/minimistjs/minimist/commits/v0.2.4","https://security.netapp.com/advisory/ntap-20240621-0006"],"description":"Prototype Pollution in minimist","cvss":[{"type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","metrics":{"baseScore":9.8,"exploitabilityScore":3.9,"impactScore":5.9},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2021-44906","epss":0.04581,"percentile":0.91855,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2021-44906","cwe":"CWE-1321","source":"nvd@nist.gov","type":"Primary"}],"fix":{"versions":["0.2.4"],"state":"fixed","available":[{"version":"0.2.4","date":"2023-03-01","kind":"first-observed"}]},"advisories":[],"risk":4.30614},"relatedVulnerabilities":[{"id":"CVE-2021-44906","dataSource":"https://nvd.nist.gov/vuln/detail/CVE-2021-44906","namespace":"nvd:cpe","severity":"Critical","urls":["https://github.com/Marynk/JavaScript-vulnerability-detection/blob/main/minimist%20PoC.zip","https://github.com/substack/minimist/blob/master/index.js#L69","https://github.com/substack/minimist/issues/164","https://security.netapp.com/advisory/ntap-20240621-0006/","https://snyk.io/vuln/SNYK-JS-MINIMIST-559764","https://stackoverflow.com/questions/8588563/adding-custom-properties-to-a-function/20278068#20278068"],"description":"Minimist <=1.2.5 is vulnerable to Prototype Pollution via file index.js, function setKey() (lines 69-95).","cvss":[{"source":"nvd@nist.gov","type":"Primary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","metrics":{"baseScore":9.8,"exploitabilityScore":3.9,"impactScore":5.9},"vendorMetadata":{}},{"source":"nvd@nist.gov","type":"Primary","version":"2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","metrics":{"baseScore":7.5,"exploitabilityScore":10,"impactScore":6.5},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2021-44906","epss":0.04581,"percentile":0.91855,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2021-44906","cwe":"CWE-1321","source":"nvd@nist.gov","type":"Primary"}]}],"matchDetails":[{"type":"exact-direct-match","matcher":"javascript-matcher","searchedBy":{"language":"javascript","namespace":"github:language:javascript","package":{"name":"minimist","version":"0.0.8"}},"found":{"vulnerabilityID":"GHSA-xvch-5gv4-984h","versionConstraint":"<0.2.4 (semantic)"},"fix":{"suggestedVersion":"0.2.4"}}],"artifact":{"id":"8eca3897a051f29d","name":"minimist","version":"0.0.8","type":"npm","locations":null,"language":"javascript","licenses":[],"cpes":[],"purl":"pkg:npm/minimist@0.0.8","upstreams":[]}},{"vulnerability":{"id":"GHSA-vh95-rmgr-6w4m","dataSource":"https://github.com/advisories/GHSA-vh95-rmgr-6w4m","namespace":"github:language:javascript","severity":"Medium","urls":["https://nvd.nist.gov/vuln/detail/CVE-2020-7598","https://snyk.io/vuln/SNYK-JS-MINIMIST-559764","http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00024.html","https://www.npmjs.com/advisories/1179","https://github.com/minimistjs/minimist/commit/10bd4cdf49d9686d48214be9d579a9cdfda37c68","https://github.com/minimistjs/minimist/commit/38a4d1caead72ef99e824bb420a2528eec03d9ab","https://github.com/minimistjs/minimist/commit/4cf1354839cb972e38496d35e12f806eea92c11f#diff-a1e0ee62c91705696ddb71aa30ad4f95","https://github.com/minimistjs/minimist/commit/63e7ed05aa4b1889ec2f3b196426db4500cbda94"],"description":"Prototype Pollution in minimist","cvss":[{"type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L","metrics":{"baseScore":5.6,"exploitabilityScore":2.3,"impactScore":3.4},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2020-7598","epss":0.01931,"percentile":0.8055,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2020-7598","cwe":"CWE-1321","source":"nvd@nist.gov","type":"Primary"}],"fix":{"versions":["0.2.1"],"state":"fixed","available":[{"version":"0.2.1","date":"2020-07-28","kind":"first-observed"}]},"advisories":[],"risk":1.0234300000000003},"relatedVulnerabilities":[{"id":"CVE-2020-7598","dataSource":"https://nvd.nist.gov/vuln/detail/CVE-2020-7598","namespace":"nvd:cpe","severity":"Medium","urls":["http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00024.html","https://snyk.io/vuln/SNYK-JS-MINIMIST-559764"],"description":"minimist before 1.2.2 could be tricked into adding or modifying properties of Object.prototype using a \"constructor\" or \"__proto__\" payload.","cvss":[{"source":"nvd@nist.gov","type":"Primary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L","metrics":{"baseScore":5.6,"exploitabilityScore":2.3,"impactScore":3.4},"vendorMetadata":{}},{"source":"nvd@nist.gov","type":"Primary","version":"2.0","vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","metrics":{"baseScore":6.8,"exploitabilityScore":8.6,"impactScore":6.5},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2020-7598","epss":0.01931,"percentile":0.8055,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2020-7598","cwe":"CWE-1321","source":"nvd@nist.gov","type":"Primary"}]}],"matchDetails":[{"type":"exact-direct-match","matcher":"javascript-matcher","searchedBy":{"language":"javascript","namespace":"github:language:javascript","package":{"name":"minimist","version":"0.0.8"}},"found":{"vulnerabilityID":"GHSA-vh95-rmgr-6w4m","versionConstraint":"<0.2.1 (semantic)"},"fix":{"suggestedVersion":"0.2.1"}}],"artifact":{"id":"8eca3897a051f29d","name":"minimist","version":"0.0.8","type":"npm","locations":null,"language":"javascript","licenses":[],"cpes":[],"purl":"pkg:npm/minimist@0.0.8","upstreams":[]}}],"source":{"type":"purl","target":"pkg:npm/minimist@0.0.8"},"distro":{"name":"","version":"","idLike":null},"descriptor":{"name":"grype","version":"0.121.2","configuration":{"output":["json"],"file":"","pretty":false,"distro":"","add-cpes-if-none":false,"output-template-file":"","check-for-app-update":true,"only-fixed":false,"only-notfixed":false,"ignore-wontfix":"","platform":"","search":{"scope":"squashed","unindexed-archives":false,"indexed-archives":true},"ignore":[{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"kernel-headers","version":"","language":"","type":"rpm","location":"","upstream-name":"kernel"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"},{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"linux(-.*)?-headers-.*","version":"","language":"","type":"deb","location":"","upstream-name":"linux.*"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"},{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"linux-libc-dev","version":"","language":"","type":"deb","location":"","upstream-name":"linux"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"},{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"linux-kbuild-.*","version":"","language":"","type":"deb","location":"","upstream-name":"linux.*"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"}],"exclude":[],"externalSources":{"enable":false,"maven":{"searchUpstreamBySha1":true,"baseUrl":"https://search.maven.org/solrsearch/select","rateLimit":300000000}},"match":{"java":{"using-cpes":false},"jvm":{"using-cpes":true},"dotnet":{"using-cpes":false},"golang":{"using-cpes":false,"always-use-cpe-for-stdlib":false,"allow-main-module-pseudo-version-comparison":false},"javascript":{"using-cpes":false},"python":{"using-cpes":false},"ruby":{"using-cpes":false},"rust":{"using-cpes":false},"hex":{"using-cpes":false},"stock":{"using-cpes":true},"dpkg":{"using-cpes":false,"missing-epoch-strategy":"zero","use-cpes-for-eol":false},"rpm":{"using-cpes":false,"missing-epoch-strategy":"auto","use-cpes-for-eol":false}},"fail-on-severity":"","registry":{"insecure-skip-tls-verify":false,"insecure-use-http":false,"ca-cert":""},"show-suppressed":false,"include-matcher-suppressions":false,"by-cve":false,"SortBy":{"sort-by":"risk"},"name":"","default-image-pull-source":"","from":null,"vex-documents":[],"vex-add":[],"match-upstream-kernel-headers":false,"fix-channel":{"redhat-eus":{"apply":"auto","versions":">= 8.0"},"ubuntu-esm":{"apply":"auto","versions":""}},"timestamp":true,"alerts":{"enable-eol-distro-warnings":true},"db":{"cache-dir":"/home/scanner/.cache/grype/db","update-url":"https://grype.anchore.io/databases","ca-cert":"","auto-update":true,"validate-by-hash-on-start":true,"validate-age":true,"max-allowed-built-age":432000000000000,"require-update-check":false,"update-available-timeout":30000000000,"update-download-timeout":300000000000,"max-update-check-frequency":7200000000000},"exp":{},"dev":{"db":{"debug":false}}},"db":{"status":{"schemaVersion":"v6.1.10","from":"https://grype.anchore.io/databases/v6/vulnerability-db_v6.1.10_2026-11-23T00:24:20Z_1795415312.tar.zst?checksum=sha256%3A3d24f57cd3587e2c73f686decc7ad04b213d1f3575bcf1dd847e42df94560f14","built":"2026-11-23T06:28:32Z","path":"/home/scanner/.cache/grype/db/6/vulnerability.db","valid":true},"providers":{"alma":{"captured":"2026-11-23T00:24:25Z","input":"xxh64:9fd4413e0321c324"},"alpine":{"captured":"2026-11-23T00:24:52Z","input":"xxh64:626087ccb8a36373"},"amazon":{"captured":"2026-11-23T00:24:34Z","input":"xxh64:083d74859c705607"},"arch":{"captured":"2026-11-23T00:24:23Z","input":"xxh64:767233e7552ae911"},"bitnami":{"captured":"2026-11-23T00:24:30Z","input":"xxh64:542814d1e958c4e3"},"chainguard":{"captured":"2026-11-23T00:25:25Z","input":"xxh64:40d4772eb76c342f"},"chainguard-libraries":{"captured":"2026-11-23T00:24:52Z","input":"xxh64:73b958306e2dce58"},"debian":{"captured":"2026-11-23T00:24:40Z","input":"xxh64:f9a6456f81777f29"},"dhi":{"captured":"2026-11-23T00:24:45Z","input":"xxh64:a6b8e4e1d1aecfa1"},"echo":{"captured":"2026-11-23T00:24:27Z","input":"xxh64:a2e80388a7d54bb0"},"eol":{"captured":"2026-11-23T00:24:23Z","input":"xxh64:3a3243012dede451"},"epss":{"captured":"2026-11-23T00:24:28Z","input":"xxh64:617f4201c8a347c1"},"fedora":{"captured":"2026-11-23T00:24:35Z","input":"xxh64:55853e5256082c94"},"github":{"captured":"2026-11-23T00:24:47Z","input":"xxh64:1db626b836a7b9a3"},"govulndb":{"captured":"2026-11-23T00:24:22Z","input":"xxh64:4e5d90d5b45aeeb1"},"hummingbird":{"captured":"2026-11-23T00:27:40Z","input":"xxh64:968bec75e99f7d9a"},"kev":{"captured":"2026-11-23T00:24:27Z","input":"xxh64:f9dc8833117b9cfb"},"mariner":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:f8299848201c9565"},"minimos":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:4f5198a5f5c667f3"},"nvd":{"captured":"2026-11-23T00:25:29Z","input":"xxh64:2a0ff8d069da733e"},"oracle":{"captured":"2026-11-23T00:24:36Z","input":"xxh64:ef43f7a6df2d7adf"},"photon":{"captured":"2026-11-23T00:24:26Z","input":"xxh64:830daa42e4331294"},"rhel":{"captured":"2026-11-23T00:26:09Z","input":"xxh64:fc3e7c2e917a2b8d"},"secureos":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:16d87472840d1693"},"sles":{"captured":"2026-11-23T00:26:40Z","input":"xxh64:afa8d8bc8fe91131"},"ubuntu":{"captured":"2026-11-23T00:25:23Z","input":"xxh64:c4e9de4958b5ec11"},"wolfi":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:2d968f4266204048"}}},"timestamp":"2026-11-23T17:56:17.571764491Z"}} diff --git a/pkg/scanner/grype/testdata/purl-pypi-requests-2.19.0.json b/pkg/scanner/grype/testdata/purl-pypi-requests-2.19.0.json new file mode 100644 index 0000000..06f2337 --- /dev/null +++ b/pkg/scanner/grype/testdata/purl-pypi-requests-2.19.0.json @@ -0,0 +1 @@ +{"matches":[{"vulnerability":{"id":"GHSA-x84v-xcm2-53pg","dataSource":"https://github.com/advisories/GHSA-x84v-xcm2-53pg","namespace":"github:language:python","severity":"High","urls":["https://nvd.nist.gov/vuln/detail/CVE-2018-18074","https://github.com/requests/requests/issues/4716","https://github.com/requests/requests/pull/4718","https://github.com/requests/requests/commit/c45d7c49ea75133e52ab22a8e9e13173938e36ff","https://access.redhat.com/errata/RHSA-2019:2035","https://bugs.debian.org/910766","http://docs.python-requests.org/en/master/community/updates/#release-and-version-history","http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00024.html","https://www.oracle.com/security-alerts/cpujul2022.html","https://github.com/pypa/advisory-database/tree/main/vulns/requests/PYSEC-2018-28.yaml","https://usn.ubuntu.com/3790-1","https://usn.ubuntu.com/3790-2"],"description":"Insufficiently Protected Credentials in Requests","cvss":[{"type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","metrics":{"baseScore":7.5,"exploitabilityScore":3.9,"impactScore":3.6},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2018-18074","epss":0.06925,"percentile":0.94253,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2018-18074","cwe":"CWE-522","source":"nvd@nist.gov","type":"Primary"}],"fix":{"versions":["2.20.0"],"state":"fixed","available":[{"version":"2.20.0","date":"2021-03-30","kind":"first-observed"}]},"advisories":[],"risk":5.1937500000000005},"relatedVulnerabilities":[{"id":"CVE-2018-18074","dataSource":"https://nvd.nist.gov/vuln/detail/CVE-2018-18074","namespace":"nvd:cpe","severity":"High","urls":["http://docs.python-requests.org/en/master/community/updates/#release-and-version-history","http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00024.html","https://access.redhat.com/errata/RHSA-2019:2035","https://bugs.debian.org/910766","https://github.com/requests/requests/commit/c45d7c49ea75133e52ab22a8e9e13173938e36ff","https://github.com/requests/requests/issues/4716","https://github.com/requests/requests/pull/4718","https://usn.ubuntu.com/3790-1/","https://usn.ubuntu.com/3790-2/","https://www.oracle.com/security-alerts/cpujul2022.html"],"description":"The Requests package before 2.20.0 for Python sends an HTTP Authorization header to an http URI upon receiving a same-hostname https-to-http redirect, which makes it easier for remote attackers to discover credentials by sniffing the network.","cvss":[{"source":"nvd@nist.gov","type":"Primary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","metrics":{"baseScore":7.5,"exploitabilityScore":3.9,"impactScore":3.6},"vendorMetadata":{}},{"source":"nvd@nist.gov","type":"Primary","version":"2.0","vector":"AV:N/AC:L/Au:N/C:P/I:N/A:N","metrics":{"baseScore":5,"exploitabilityScore":10,"impactScore":2.9},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2018-18074","epss":0.06925,"percentile":0.94253,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2018-18074","cwe":"CWE-522","source":"nvd@nist.gov","type":"Primary"}]}],"matchDetails":[{"type":"exact-direct-match","matcher":"python-matcher","searchedBy":{"language":"python","namespace":"github:language:python","package":{"name":"requests","version":"2.19.0"}},"found":{"vulnerabilityID":"GHSA-x84v-xcm2-53pg","versionConstraint":"<=2.19.1 (python)"},"fix":{"suggestedVersion":"2.20.0"}}],"artifact":{"id":"083cc8e653b8db7d","name":"requests","version":"2.19.0","type":"python","locations":null,"language":"python","licenses":[],"cpes":[],"purl":"pkg:pypi/requests@2.19.0","upstreams":[]}},{"vulnerability":{"id":"GHSA-j8r2-6x86-q33q","dataSource":"https://github.com/advisories/GHSA-j8r2-6x86-q33q","namespace":"github:language:python","severity":"Medium","urls":["https://github.com/psf/requests/security/advisories/GHSA-j8r2-6x86-q33q","https://github.com/psf/requests/commit/74ea7cf7a6a27a4eeb2ae24e162bcc942a6706d5","https://nvd.nist.gov/vuln/detail/CVE-2023-32681","https://github.com/psf/requests/releases/tag/v2.31.0","https://github.com/pypa/advisory-database/tree/main/vulns/requests/PYSEC-2023-74.yaml","https://lists.debian.org/debian-lts-announce/2023/06/msg00018.html","https://security.gentoo.org/glsa/202309-08","https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AW7HNFGYP44RT3DUDQXG2QT3OEV2PJ7Y","https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KOYASTZDGQG2BWLSNBPL3TQRL2G7QYNZ"],"description":"Unintended leak of Proxy-Authorization header in requests","cvss":[{"type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","metrics":{"baseScore":6.1,"exploitabilityScore":1.7,"impactScore":4},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2023-32681","epss":0.02974,"percentile":0.87593,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2023-32681","cwe":"CWE-200","source":"security-advisories@github.com","type":"Secondary"}],"fix":{"versions":["2.31.0"],"state":"fixed","available":[{"version":"2.31.0","date":"2023-05-23","kind":"first-observed"}]},"advisories":[],"risk":1.6505699999999999},"relatedVulnerabilities":[{"id":"CVE-2023-32681","dataSource":"https://nvd.nist.gov/vuln/detail/CVE-2023-32681","namespace":"nvd:cpe","severity":"Medium","urls":["https://github.com/psf/requests/commit/74ea7cf7a6a27a4eeb2ae24e162bcc942a6706d5","https://github.com/psf/requests/releases/tag/v2.31.0","https://github.com/psf/requests/security/advisories/GHSA-j8r2-6x86-q33q","https://lists.debian.org/debian-lts-announce/2023/06/msg00018.html","https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AW7HNFGYP44RT3DUDQXG2QT3OEV2PJ7Y/","https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KOYASTZDGQG2BWLSNBPL3TQRL2G7QYNZ/","https://security.gentoo.org/glsa/202309-08"],"description":"Requests is a HTTP library. Since Requests 2.3.0, Requests has been leaking Proxy-Authorization headers to destination servers when redirected to an HTTPS endpoint. This is a product of how we use `rebuild_proxies` to reattach the `Proxy-Authorization` header to requests. For HTTP connections sent through the tunnel, the proxy will identify the header in the request itself and remove it prior to forwarding to the destination server. However when sent over HTTPS, the `Proxy-Authorization` header must be sent in the CONNECT request as the proxy has no visibility into the tunneled request. This results in Requests forwarding proxy credentials to the destination server unintentionally, allowing a malicious actor to potentially exfiltrate sensitive information. This issue has been patched in version 2.31.0.","cvss":[{"source":"nvd@nist.gov","type":"Primary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","metrics":{"baseScore":6.1,"exploitabilityScore":1.7,"impactScore":4},"vendorMetadata":{}},{"source":"security-advisories@github.com","type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","metrics":{"baseScore":6.1,"exploitabilityScore":1.7,"impactScore":4},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2023-32681","epss":0.02974,"percentile":0.87593,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2023-32681","cwe":"CWE-200","source":"security-advisories@github.com","type":"Secondary"}]}],"matchDetails":[{"type":"exact-direct-match","matcher":"python-matcher","searchedBy":{"language":"python","namespace":"github:language:python","package":{"name":"requests","version":"2.19.0"}},"found":{"vulnerabilityID":"GHSA-j8r2-6x86-q33q","versionConstraint":">=2.3.0,<2.31.0 (python)"},"fix":{"suggestedVersion":"2.31.0"}}],"artifact":{"id":"083cc8e653b8db7d","name":"requests","version":"2.19.0","type":"python","locations":null,"language":"python","licenses":[],"cpes":[],"purl":"pkg:pypi/requests@2.19.0","upstreams":[]}},{"vulnerability":{"id":"GHSA-9hjg-9r4m-mvj7","dataSource":"https://github.com/advisories/GHSA-9hjg-9r4m-mvj7","namespace":"github:language:python","severity":"Medium","urls":["https://github.com/psf/requests/security/advisories/GHSA-9hjg-9r4m-mvj7","https://nvd.nist.gov/vuln/detail/CVE-2024-47081","https://github.com/psf/requests/pull/6965","https://github.com/psf/requests/commit/96ba401c1296ab1dda74a2365ef36d88f7d144ef","https://requests.readthedocs.io/en/latest/api/#requests.Session.trust_env","https://seclists.org/fulldisclosure/2025/Jun/2","http://www.openwall.com/lists/oss-security/2025/06/03/11","http://www.openwall.com/lists/oss-security/2025/06/03/9","http://www.openwall.com/lists/oss-security/2025/06/04/1","http://www.openwall.com/lists/oss-security/2025/06/04/6","https://github.com/psf/requests","https://github.com/psf/requests/releases/tag/v2.32.4","https://github.com/pypa/advisory-database/tree/main/vulns/requests/PYSEC-2026-1872.yaml","https://pypi.org/project/requests"],"description":"Requests vulnerable to .netrc credentials leak via malicious URLs","cvss":[{"type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N","metrics":{"baseScore":5.3,"exploitabilityScore":1.7,"impactScore":3.6},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2024-47081","epss":0.01022,"percentile":0.64344,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2024-47081","cwe":"CWE-522","source":"security-advisories@github.com","type":"Secondary"}],"fix":{"versions":["2.32.4"],"state":"fixed","available":[{"version":"2.32.4","date":"2025-06-10","kind":"first-observed"}]},"advisories":[],"risk":0.5263300000000001},"relatedVulnerabilities":[{"id":"CVE-2024-47081","dataSource":"https://nvd.nist.gov/vuln/detail/CVE-2024-47081","namespace":"nvd:cpe","severity":"Medium","urls":["https://github.com/psf/requests/commit/96ba401c1296ab1dda74a2365ef36d88f7d144ef","https://github.com/psf/requests/pull/6965","https://github.com/psf/requests/security/advisories/GHSA-9hjg-9r4m-mvj7","https://requests.readthedocs.io/en/latest/api/#requests.Session.trust_env","https://seclists.org/fulldisclosure/2025/Jun/2","http://seclists.org/fulldisclosure/2025/Jun/2","http://www.openwall.com/lists/oss-security/2025/06/03/11","http://www.openwall.com/lists/oss-security/2025/06/03/9","http://www.openwall.com/lists/oss-security/2025/06/04/1","http://www.openwall.com/lists/oss-security/2025/06/04/6"],"description":"Requests is a HTTP library. Due to a URL parsing issue, Requests releases prior to 2.32.4 may leak .netrc credentials to third parties for specific maliciously-crafted URLs. Users should upgrade to version 2.32.4 to receive a fix. For older versions of Requests, use of the .netrc file can be disabled with `trust_env=False` on one's Requests Session.","cvss":[{"source":"security-advisories@github.com","type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N","metrics":{"baseScore":5.3,"exploitabilityScore":1.7,"impactScore":3.6},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2024-47081","epss":0.01022,"percentile":0.64344,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2024-47081","cwe":"CWE-522","source":"security-advisories@github.com","type":"Secondary"}]}],"matchDetails":[{"type":"exact-direct-match","matcher":"python-matcher","searchedBy":{"language":"python","namespace":"github:language:python","package":{"name":"requests","version":"2.19.0"}},"found":{"vulnerabilityID":"GHSA-9hjg-9r4m-mvj7","versionConstraint":"<2.32.4 (python)"},"fix":{"suggestedVersion":"2.32.4"}}],"artifact":{"id":"083cc8e653b8db7d","name":"requests","version":"2.19.0","type":"python","locations":null,"language":"python","licenses":[],"cpes":[],"purl":"pkg:pypi/requests@2.19.0","upstreams":[]}},{"vulnerability":{"id":"GHSA-9wx4-h78v-vm56","dataSource":"https://github.com/advisories/GHSA-9wx4-h78v-vm56","namespace":"github:language:python","severity":"Medium","urls":["https://github.com/psf/requests/security/advisories/GHSA-9wx4-h78v-vm56","https://github.com/psf/requests/pull/6655","https://github.com/psf/requests/commit/a58d7f2ffb4d00b46dca2d70a3932a0b37e22fac","https://nvd.nist.gov/vuln/detail/CVE-2024-35195","https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IYLSNK5TL46Q6XPRVMHVWS63MVJQOK4Q","https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/N7WP6EYDSUOCOJYHDK5NX43PYZ4SNHGZ"],"description":"Requests `Session` object does not verify requests after making first request with verify=False","cvss":[{"type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N","metrics":{"baseScore":5.6,"exploitabilityScore":0.4,"impactScore":5.2},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2024-35195","epss":0.0034,"percentile":0.28018,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2024-35195","cwe":"CWE-670","source":"security-advisories@github.com","type":"Secondary"}],"fix":{"versions":["2.32.0"],"state":"fixed","available":[{"version":"2.32.0","date":"2024-05-21","kind":"first-observed"}]},"advisories":[],"risk":0.1802},"relatedVulnerabilities":[{"id":"CVE-2024-35195","dataSource":"https://nvd.nist.gov/vuln/detail/CVE-2024-35195","namespace":"nvd:cpe","severity":"Medium","urls":["https://github.com/psf/requests/commit/a58d7f2ffb4d00b46dca2d70a3932a0b37e22fac","https://github.com/psf/requests/pull/6655","https://github.com/psf/requests/security/advisories/GHSA-9wx4-h78v-vm56","https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IYLSNK5TL46Q6XPRVMHVWS63MVJQOK4Q/","https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/N7WP6EYDSUOCOJYHDK5NX43PYZ4SNHGZ/"],"description":"Requests is a HTTP library. Prior to 2.32.0, when making requests through a Requests `Session`, if the first request is made with `verify=False` to disable cert verification, all subsequent requests to the same host will continue to ignore cert verification regardless of changes to the value of `verify`. This behavior will continue for the lifecycle of the connection in the connection pool. This vulnerability is fixed in 2.32.0.","cvss":[{"source":"security-advisories@github.com","type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N","metrics":{"baseScore":5.6,"exploitabilityScore":0.4,"impactScore":5.2},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2024-35195","epss":0.0034,"percentile":0.28018,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2024-35195","cwe":"CWE-670","source":"security-advisories@github.com","type":"Secondary"}]}],"matchDetails":[{"type":"exact-direct-match","matcher":"python-matcher","searchedBy":{"language":"python","namespace":"github:language:python","package":{"name":"requests","version":"2.19.0"}},"found":{"vulnerabilityID":"GHSA-9wx4-h78v-vm56","versionConstraint":"<2.32.0 (python)"},"fix":{"suggestedVersion":"2.32.0"}}],"artifact":{"id":"083cc8e653b8db7d","name":"requests","version":"2.19.0","type":"python","locations":null,"language":"python","licenses":[],"cpes":[],"purl":"pkg:pypi/requests@2.19.0","upstreams":[]}},{"vulnerability":{"id":"GHSA-gc5v-m9x4-r6x2","dataSource":"https://github.com/advisories/GHSA-gc5v-m9x4-r6x2","namespace":"github:language:python","severity":"Medium","urls":["https://github.com/psf/requests/security/advisories/GHSA-gc5v-m9x4-r6x2","https://github.com/psf/requests/commit/66d21cb07bd6255b1280291c4fafb71803cdb3b7","https://github.com/psf/requests/releases/tag/v2.33.0","https://nvd.nist.gov/vuln/detail/CVE-2026-25645"],"description":"Requests has Insecure Temp File Reuse in its extract_zipped_paths() utility function","cvss":[{"type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:N","metrics":{"baseScore":4.4,"exploitabilityScore":0.8,"impactScore":3.6},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2026-25645","epss":0.00306,"percentile":0.23788,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2026-25645","cwe":"CWE-377","source":"security-advisories@github.com","type":"Secondary"}],"fix":{"versions":["2.33.0"],"state":"fixed","available":[{"version":"2.33.0","date":"2026-03-26","kind":"first-observed"}]},"advisories":[],"risk":0.14382},"relatedVulnerabilities":[{"id":"CVE-2026-25645","dataSource":"https://nvd.nist.gov/vuln/detail/CVE-2026-25645","namespace":"nvd:cpe","severity":"Medium","urls":["https://github.com/psf/requests/commit/66d21cb07bd6255b1280291c4fafb71803cdb3b7","https://github.com/psf/requests/releases/tag/v2.33.0","https://github.com/psf/requests/security/advisories/GHSA-gc5v-m9x4-r6x2"],"description":"Requests is a HTTP library. Prior to version 2.33.0, the `requests.utils.extract_zipped_paths()` utility function uses a predictable filename when extracting files from zip archives into the system temporary directory. If the target file already exists, it is reused without validation. A local attacker with write access to the temp directory could pre-create a malicious file that would be loaded in place of the legitimate one. Standard usage of the Requests library is not affected by this vulnerability. Only applications that call `extract_zipped_paths()` directly are impacted. Starting in version 2.33.0, the library extracts files to a non-deterministic location. If developers are unable to upgrade, they can set `TMPDIR` in their environment to a directory with restricted write access.","cvss":[{"source":"nvd@nist.gov","type":"Primary","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","metrics":{"baseScore":5.5,"exploitabilityScore":1.9,"impactScore":3.6},"vendorMetadata":{}},{"source":"security-advisories@github.com","type":"Secondary","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:N","metrics":{"baseScore":4.4,"exploitabilityScore":0.8,"impactScore":3.6},"vendorMetadata":{}}],"epss":[{"cve":"CVE-2026-25645","epss":0.00306,"percentile":0.23788,"date":"2026-11-22"}],"cwes":[{"cve":"CVE-2026-25645","cwe":"CWE-377","source":"security-advisories@github.com","type":"Secondary"}]}],"matchDetails":[{"type":"exact-direct-match","matcher":"python-matcher","searchedBy":{"language":"python","namespace":"github:language:python","package":{"name":"requests","version":"2.19.0"}},"found":{"vulnerabilityID":"GHSA-gc5v-m9x4-r6x2","versionConstraint":"<2.33.0 (python)"},"fix":{"suggestedVersion":"2.33.0"}}],"artifact":{"id":"083cc8e653b8db7d","name":"requests","version":"2.19.0","type":"python","locations":null,"language":"python","licenses":[],"cpes":[],"purl":"pkg:pypi/requests@2.19.0","upstreams":[]}}],"source":{"type":"purl","target":"pkg:pypi/requests@2.19.0"},"distro":{"name":"","version":"","idLike":null},"descriptor":{"name":"grype","version":"0.121.2","configuration":{"output":["json"],"file":"","pretty":false,"distro":"","add-cpes-if-none":false,"output-template-file":"","check-for-app-update":true,"only-fixed":false,"only-notfixed":false,"ignore-wontfix":"","platform":"","search":{"scope":"squashed","unindexed-archives":false,"indexed-archives":true},"ignore":[{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"kernel-headers","version":"","language":"","type":"rpm","location":"","upstream-name":"kernel"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"},{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"linux(-.*)?-headers-.*","version":"","language":"","type":"deb","location":"","upstream-name":"linux.*"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"},{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"linux-libc-dev","version":"","language":"","type":"deb","location":"","upstream-name":"linux"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"},{"vulnerability":"","include-aliases":false,"reason":"","namespace":"","fix-state":"","package":{"name":"linux-kbuild-.*","version":"","language":"","type":"deb","location":"","upstream-name":"linux.*"},"vex-status":"","vex-justification":"","match-type":"exact-indirect-match"}],"exclude":[],"externalSources":{"enable":false,"maven":{"searchUpstreamBySha1":true,"baseUrl":"https://search.maven.org/solrsearch/select","rateLimit":300000000}},"match":{"java":{"using-cpes":false},"jvm":{"using-cpes":true},"dotnet":{"using-cpes":false},"golang":{"using-cpes":false,"always-use-cpe-for-stdlib":false,"allow-main-module-pseudo-version-comparison":false},"javascript":{"using-cpes":false},"python":{"using-cpes":false},"ruby":{"using-cpes":false},"rust":{"using-cpes":false},"hex":{"using-cpes":false},"stock":{"using-cpes":true},"dpkg":{"using-cpes":false,"missing-epoch-strategy":"zero","use-cpes-for-eol":false},"rpm":{"using-cpes":false,"missing-epoch-strategy":"auto","use-cpes-for-eol":false}},"fail-on-severity":"","registry":{"insecure-skip-tls-verify":false,"insecure-use-http":false,"ca-cert":""},"show-suppressed":false,"include-matcher-suppressions":false,"by-cve":false,"SortBy":{"sort-by":"risk"},"name":"","default-image-pull-source":"","from":null,"vex-documents":[],"vex-add":[],"match-upstream-kernel-headers":false,"fix-channel":{"redhat-eus":{"apply":"auto","versions":">= 8.0"},"ubuntu-esm":{"apply":"auto","versions":""}},"timestamp":true,"alerts":{"enable-eol-distro-warnings":true},"db":{"cache-dir":"/home/scanner/.cache/grype/db","update-url":"https://grype.anchore.io/databases","ca-cert":"","auto-update":true,"validate-by-hash-on-start":true,"validate-age":true,"max-allowed-built-age":432000000000000,"require-update-check":false,"update-available-timeout":30000000000,"update-download-timeout":300000000000,"max-update-check-frequency":7200000000000},"exp":{},"dev":{"db":{"debug":false}}},"db":{"status":{"schemaVersion":"v6.1.10","from":"https://grype.anchore.io/databases/v6/vulnerability-db_v6.1.10_2026-11-23T00:24:20Z_1795415312.tar.zst?checksum=sha256%3A3d24f57cd3587e2c73f686decc7ad04b213d1f3575bcf1dd847e42df94560f14","built":"2026-11-23T06:28:32Z","path":"/home/scanner/.cache/grype/db/6/vulnerability.db","valid":true},"providers":{"alma":{"captured":"2026-11-23T00:24:25Z","input":"xxh64:9fd4413e0321c324"},"alpine":{"captured":"2026-11-23T00:24:52Z","input":"xxh64:626087ccb8a36373"},"amazon":{"captured":"2026-11-23T00:24:34Z","input":"xxh64:083d74859c705607"},"arch":{"captured":"2026-11-23T00:24:23Z","input":"xxh64:767233e7552ae911"},"bitnami":{"captured":"2026-11-23T00:24:30Z","input":"xxh64:542814d1e958c4e3"},"chainguard":{"captured":"2026-11-23T00:25:25Z","input":"xxh64:40d4772eb76c342f"},"chainguard-libraries":{"captured":"2026-11-23T00:24:52Z","input":"xxh64:73b958306e2dce58"},"debian":{"captured":"2026-11-23T00:24:40Z","input":"xxh64:f9a6456f81777f29"},"dhi":{"captured":"2026-11-23T00:24:45Z","input":"xxh64:a6b8e4e1d1aecfa1"},"echo":{"captured":"2026-11-23T00:24:27Z","input":"xxh64:a2e80388a7d54bb0"},"eol":{"captured":"2026-11-23T00:24:23Z","input":"xxh64:3a3243012dede451"},"epss":{"captured":"2026-11-23T00:24:28Z","input":"xxh64:617f4201c8a347c1"},"fedora":{"captured":"2026-11-23T00:24:35Z","input":"xxh64:55853e5256082c94"},"github":{"captured":"2026-11-23T00:24:47Z","input":"xxh64:1db626b836a7b9a3"},"govulndb":{"captured":"2026-11-23T00:24:22Z","input":"xxh64:4e5d90d5b45aeeb1"},"hummingbird":{"captured":"2026-11-23T00:27:40Z","input":"xxh64:968bec75e99f7d9a"},"kev":{"captured":"2026-11-23T00:24:27Z","input":"xxh64:f9dc8833117b9cfb"},"mariner":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:f8299848201c9565"},"minimos":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:4f5198a5f5c667f3"},"nvd":{"captured":"2026-11-23T00:25:29Z","input":"xxh64:2a0ff8d069da733e"},"oracle":{"captured":"2026-11-23T00:24:36Z","input":"xxh64:ef43f7a6df2d7adf"},"photon":{"captured":"2026-11-23T00:24:26Z","input":"xxh64:830daa42e4331294"},"rhel":{"captured":"2026-11-23T00:26:09Z","input":"xxh64:fc3e7c2e917a2b8d"},"secureos":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:16d87472840d1693"},"sles":{"captured":"2026-11-23T00:26:40Z","input":"xxh64:afa8d8bc8fe91131"},"ubuntu":{"captured":"2026-11-23T00:25:23Z","input":"xxh64:c4e9de4958b5ec11"},"wolfi":{"captured":"2026-11-23T00:24:20Z","input":"xxh64:2d968f4266204048"}}},"timestamp":"2026-11-23T17:56:20.535054867Z"}}