repo_id
stringclasses 927
values | file_path
stringlengths 99
214
| content
stringlengths 2
4.15M
|
|---|---|---|
TestLintOffline
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/lint/TestLintOffline/no_vulnerable_at_or_skip_fix.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Test: TestLintOffline/no_vulnerable_at_or_skip_fix
Description: At least one of module.vulnerable_at and module.package.skip_fix must be set.
-- data/reports/GO-0000-0000.yaml --
id: GO-0000-0000
modules:
- module: golang.org/x/net
packages:
- package: golang.org/x/net/http2
summary: A summary of the issue in golang.org/x/net
description: description
cves:
- CVE-1234-0000
review_status: REVIEWED
-- golden --
modules[0] "golang.org/x/net": packages[0] "golang.org/x/net/http2": at least one of vulnerable_at and skip_fix must be set
|
TestLintOffline
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/lint/TestLintOffline/skip_fix_ok.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Test: TestLintOffline/skip_fix_ok
Description: The vulnerable_at field can be blank if skip_fix is set.
-- data/reports/GO-0000-0000.yaml --
id: GO-0000-0000
modules:
- module: golang.org/x/net
packages:
- package: golang.org/x/net/http2
skip_fix: a reason
summary: A summary of the issue in golang.org/x/net
description: description
cves:
- CVE-1234-0000
review_status: REVIEWED
-- golden --
|
TestLintOffline
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/lint/TestLintOffline/no_package_path.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Test: TestLintOffline/no_package_path
Description: All packages must have a path.
-- data/reports/GO-0000-0000.yaml --
id: GO-0000-0000
modules:
- module: golang.org/x/net
vulnerable_at: 1.2.3
packages:
- package: golang.org/x/net/http2
- {}
summary: A summary of the issue in golang.org/x/net
description: description
cves:
- CVE-1234-0000
review_status: REVIEWED
-- golden --
modules[0] "golang.org/x/net": packages[1]: no package name
|
TestLintOffline
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/lint/TestLintOffline/invalid_package_path.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Test: TestLintOffline/invalid_package_path
Description: In third party reports, package paths must pass validity checks in x/mod/module.CheckImportPath.
-- data/reports/GO-0000-0000.yaml --
id: GO-0000-0000
modules:
- module: golang.org/x/net
vulnerable_at: 1.2.3
packages:
- package: golang.org/x/net/http2
- module: invalid.
vulnerable_at: 1.0.0
packages:
- package: invalid.
summary: A summary of the issue in golang.org/x/net
description: description
cves:
- CVE-1234-0000
review_status: REVIEWED
-- golden --
modules[1] "invalid.": packages[0] "invalid.": malformed import path "invalid.": trailing dot in path element
|
TestLintOffline
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/lint/TestLintOffline/references_unfixed.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Test: TestLintOffline/references_unfixed
Description: References should not contain non-canonical link formats (that can be auto-fixed).
-- data/reports/GO-0000-0000.yaml --
id: GO-0000-0000
modules:
- module: golang.org/x/net
vulnerable_at: 1.2.3
packages:
- package: golang.org/x/net/http2
summary: A summary of the issue in golang.org/x/net
description: description
cves:
- CVE-1234-0000
references:
- fix: https://github.com/golang/go/commit/12345
- report: https://github.com/golang/go/issues/12345
- web: https://golang.org/xxx
- web: https://groups.google.com/forum/#!/golang-announce/12345/1/
review_status: REVIEWED
-- golden --
references[0] "https://github.com/golang/go/commit/12345": should be "https://go.googlesource.com/+/12345" (can be auto-fixed)
references[1] "https://github.com/golang/go/issues/12345": should be "https://go.dev/issue/12345" (can be auto-fixed)
references[2] "https://golang.org/xxx": should be "https://go.dev/xxx" (can be auto-fixed)
references[3] "https://groups.google.com/forum/#!/golang-announce/12345/1/": should be "https://groups.google.com/g/golang-announce/c/12345/m/1/" (can be auto-fixed)
|
TestLintOffline
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/lint/TestLintOffline/no_package_path_stdlib.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Test: TestLintOffline/no_package_path_stdlib
Description: All packages must have a path.
-- data/reports/GO-0000-0000.yaml --
id: GO-0000-0000
modules:
- module: std
vulnerable_at: 1.2.3
packages:
- {}
summary: A summary of the problem with net/http
description: description
references:
- fix: https://go.dev/cl/12345
- web: https://groups.google.com/g/golang-announce/c/12345
- report: https://go.dev/issue/12345
review_status: REVIEWED
-- golden --
modules[0] "std": packages[0]: no package name
|
TestLintOffline
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/lint/TestLintOffline/references_redundant_web_advisories.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Test: TestLintOffline/references_redundant_web_advisories
Description: Reports should not contain redundant web-type references linking to CVEs/GHSAs listed in the cves/ghsas sections.
-- data/reports/GO-0000-0000.yaml --
id: GO-0000-0000
modules:
- module: golang.org/x/net
vulnerable_at: 1.2.3
packages:
- package: golang.org/x/net/http2
summary: A summary of the issue in golang.org/x/net
description: description
cves:
- CVE-0000-0000
- CVE-0000-0001
ghsas:
- GHSA-0000-0000-0000
references:
- web: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-0000-0000
- web: https://nvd.nist.gov/vuln/detail/CVE-0000-0001
- web: https://nvd.nist.gov/vuln/detail/CVE-0000-0002
- web: https://github.com/advisories/GHSA-0000-0000-0000
- web: https://github.com/advisories/GHSA-0000-0000-0001
review_status: REVIEWED
-- golden --
references[0] "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-0000-0000": redundant non-advisory reference to CVE-0000-0000
references[1] "https://nvd.nist.gov/vuln/detail/CVE-0000-0001": redundant non-advisory reference to CVE-0000-0001
references[3] "https://github.com/advisories/GHSA-0000-0000-0000": redundant non-advisory reference to GHSA-0000-0000-0000
|
TestLint
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/lint/TestLint/module_version_ok.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Test: TestLint/module_version_ok
Description: Module-version pairs that exist are OK.
-- data/reports/GO-0000-0000.yaml --
id: GO-0000-0000
modules:
- module: golang.org/x/net
vulnerable_at: 1.2.3
packages:
- package: golang.org/x/net/http2
- module: golang.org/x/net
versions:
- introduced: 0.2.0
summary: A summary of the issue in golang.org/x/net
description: description
cves:
- CVE-1234-0000
review_status: REVIEWED
-- golden --
|
TestLint
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/lint/TestLint/multiple_problems.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Test: TestLint/multiple_problems
Description: A test for a report with multiple module-version issues at once.
-- data/reports/GO-0000-0000.yaml --
id: GO-0000-0000
modules:
- module: golang.org/x/net
vulnerable_at: 1.2.3
packages:
- package: golang.org/x/net/http2
- module: github.com/golang/vuln
versions:
- introduced: 0.1.0
- fixed: 0.2.5
- introduced: 0.2.6
summary: A summary of the issue in golang.org/x/net
description: description
cves:
- CVE-1234-0000
review_status: REVIEWED
-- golden --
modules[1] "github.com/golang/vuln": 2 versions do not exist: 0.2.5, 0.2.6 and module is not canonical at 1 version(s): 0.1.0 (canonical:golang.org/x/vuln)
|
TestLint
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/lint/TestLint/module_version_invalid.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Test: TestLint/module_version_invalid
Description: Version@module must exist.
-- data/reports/GO-0000-0000.yaml --
id: GO-0000-0000
modules:
- module: golang.org/x/net
vulnerable_at: 1.2.3
packages:
- package: golang.org/x/net/http2
- module: golang.org/x/net
versions:
- introduced: 0.2.5
summary: A summary of the issue in golang.org/x/net
description: description
cves:
- CVE-1234-0000
review_status: REVIEWED
-- golden --
modules[1] "golang.org/x/net": version &{0.2.5 introduced} does not exist
|
TestLint
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/lint/TestLint/no_proxy_client.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Test: TestLint/no_proxy_client
Description: A non-nil proxy client must be provided.
-- data/reports/GO-0000-0000.yaml --
id: GO-0000-0000
modules:
- module: golang.org/x/net
vulnerable_at: 1.2.3
packages:
- package: golang.org/x/net/http2
summary: A summary of the issue in golang.org/x/net
description: description
cves:
- CVE-1234-0000
review_status: REVIEWED
-- golden --
proxy client is nil; cannot perform all lint checks
|
TestLint
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/lint/TestLint/module_non_canonical.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Test: TestLint/module_non_canonical
Description: Module names must be canonical.
-- data/reports/GO-0000-0000.yaml --
id: GO-0000-0000
modules:
- module: golang.org/x/net
vulnerable_at: 1.2.3
packages:
- package: golang.org/x/net/http2
- module: github.com/golang/vuln
versions:
- introduced: 0.1.0
summary: A summary of the issue in golang.org/x/net
description: description
cves:
- CVE-1234-0000
review_status: REVIEWED
-- golden --
modules[1] "github.com/golang/vuln": module is not canonical at 1 version(s): 0.1.0 (canonical:golang.org/x/vuln)
|
pkgsite
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/pkgsite/TestCheckPackages.json
|
{
"/golang.org/x/vulndb/internal/cveschema3@v0.0.0-20240515145110-57274b497de9": false,
"/mod/cmd/go": true,
"/mod/golang.org/x/vulndb/cmd/vulnreport": true,
"/mod/golang.org/x/vulndb/internal/cveschema": true,
"/mod/golang.org/x/vulndb/internal/cveschema3": false,
"/mod/net/http": true
}
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestLint.json
|
{
"github.com/golang/vuln/@latest": {
"body": "{\"Version\":\"v1.1.2\",\"Time\":\"2024-06-06T14:46:51Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/golang/vuln\",\"Ref\":\"refs/tags/v1.1.2\",\"Hash\":\"3740f5cb12a3f93b18dbe200c4bcb6256f8586e2\"}}",
"status_code": 200
},
"github.com/golang/vuln/@v/v0.1.0.mod": {
"body": "module golang.org/x/vuln\n\ngo 1.18\n\nrequire (\n\tgithub.com/client9/misspell v0.3.4\n\tgithub.com/google/go-cmdtest v0.4.1-0.20220921163831-55ab3332a786\n\tgithub.com/google/go-cmp v0.5.8\n\tgolang.org/x/mod v0.10.0\n\tgolang.org/x/sync v0.1.0\n\tgolang.org/x/tools v0.8.1-0.20230421161920-b9619ee54b47\n\thonnef.co/go/tools v0.4.3\n\tmvdan.cc/unparam v0.0.0-20230312165513-e84e2d14e3b8\n)\n\nrequire (\n\tgithub.com/BurntSushi/toml v1.2.1 // indirect\n\tgithub.com/google/renameio v0.1.0 // indirect\n\tgolang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a // indirect\n\tgolang.org/x/sys v0.7.0 // indirect\n)\n",
"status_code": 200
},
"github.com/golang/vuln/@v/v0.2.5.mod": {
"status_code": 404
},
"github.com/golang/vuln/@v/v0.2.6.mod": {
"status_code": 404
},
"golang.org/x/net/@latest": {
"body": "{\"Version\":\"v0.26.0\",\"Time\":\"2024-06-04T17:07:48Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/net\",\"Ref\":\"refs/tags/v0.26.0\",\"Hash\":\"66e838c6fbf5387ecedc26ce490b5f4d6864a854\"}}",
"status_code": 200
},
"golang.org/x/net/@v/v0.2.0.mod": {
"body": "module golang.org/x/net\n\ngo 1.17\n\nrequire (\n\tgolang.org/x/sys v0.2.0\n\tgolang.org/x/term v0.2.0\n\tgolang.org/x/text v0.4.0\n)\n",
"status_code": 200
},
"golang.org/x/net/@v/v0.2.5.mod": {
"status_code": 404
}
}
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestGuessVulnerableAt.json
|
{
"golang.org/x/tools/@latest": {
"body": "{\"Version\":\"v0.22.0\",\"Time\":\"2024-06-04T17:56:46Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/tools\",\"Ref\":\"refs/tags/v0.22.0\",\"Hash\":\"bc6931db37c33e064504346d9259b3b6d20e13f6\"}}",
"status_code": 200
},
"golang.org/x/tools/@v/list": {
"body": "v0.15.0\nv0.1.4\nv0.9.3\nv0.7.0\nv0.1.12\nv0.1.3\nv0.9.2\nv0.3.0\nv0.8.0\nv0.6.0\nv0.10.0\nv0.20.0\nv0.1.9\nv0.5.0\nv0.22.0\nv0.18.0\nv0.1.7\nv0.21.0\nv0.1.10\nv0.12.0\nv0.1.6\nv0.19.0\nv0.1.2\nv0.9.0\nv0.1.11\nv0.4.0\nv0.1.8\nv0.14.0\nv0.11.0\nv0.1.0\nv0.1.5\nv0.9.1\nv0.1.1\nv0.11.1\nv0.16.1\nv0.13.0\nv0.17.0\nv0.2.0\nv0.16.0\n",
"status_code": 200
}
}
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestFix.json
|
{
"golang.org/x/vulndb/@latest": {
"body": "{\"Version\":\"v0.0.0-20240626230022-4408037c1739\",\"Time\":\"2024-06-26T23:00:22Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/vulndb\",\"Hash\":\"4408037c1739cc5a078d9d0d410162ee4f336c09\"}}",
"status_code": 200
},
"golang.org/x/vulndb/@v/0cbf4ffdb4e70fce663ec8d59198745b04e7801b.info": {
"body": "{\"Version\":\"v0.0.0-20230522180520-0cbf4ffdb4e7\",\"Time\":\"2023-05-22T18:05:20Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/vulndb\",\"Hash\":\"0cbf4ffdb4e70fce663ec8d59198745b04e7801b\"}}",
"status_code": 200
},
"golang.org/x/vulndb/@v/list": {
"status_code": 200
},
"golang.org/x/vulndb/@v/v0.0.0-20230522180520-0cbf4ffdb4e7.mod": {
"body": "module golang.org/x/vulndb\n\ngo 1.18\n\nrequire (\n\tgolang.org/x/vuln v0.0.0-20230217204342-b91abcc5ae3c\n\tgolang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect\n)\n\nrequire (\n\tcloud.google.com/go/errorreporting v0.1.0\n\tcloud.google.com/go/firestore v1.6.1\n\tgithub.com/GoogleCloudPlatform/opentelemetry-operations-go v1.0.0\n\tgithub.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.26.0\n\tgithub.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.0.0\n\tgithub.com/client9/misspell v0.3.4\n\tgithub.com/go-git/go-billy/v5 v5.3.1\n\tgithub.com/go-git/go-git/v5 v5.4.2\n\tgithub.com/google/go-cmp v0.5.8\n\tgithub.com/google/go-github/v41 v41.0.0\n\tgithub.com/google/safehtml v0.0.2\n\tgithub.com/jba/templatecheck v0.6.0\n\tgithub.com/shurcooL/githubv4 v0.0.0-20220115235240-a14260e6f8a2\n\tgo.opentelemetry.io/otel v1.4.0\n\tgo.opentelemetry.io/otel/sdk v1.4.0\n\tgolang.org/x/exp v0.0.0-20220722155223-a9213eeb770e\n\tgolang.org/x/exp/event v0.0.0-20220218215828-6cf2b201936e\n\tgolang.org/x/mod v0.10.0\n\tgolang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8\n\tgolang.org/x/sync v0.2.0\n\tgolang.org/x/time v0.0.0-20191024005414-555d28b269f0\n\tgolang.org/x/tools v0.9.1\n\tgoogle.golang.org/api v0.70.0\n\tgoogle.golang.org/grpc v1.44.0\n\tgopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c\n\thonnef.co/go/tools v0.2.2\n\tmvdan.cc/unparam v0.0.0-20220926085101-66de63301820\n)\n\nrequire (\n\tcloud.google.com/go v0.100.2 // indirect\n\tcloud.google.com/go/compute v1.3.0 // indirect\n\tcloud.google.com/go/monitoring v1.2.0 // indirect\n\tcloud.google.com/go/trace v1.0.0 // indirect\n\tgithub.com/BurntSushi/toml v0.3.1 // indirect\n\tgithub.com/Microsoft/go-winio v0.4.16 // indirect\n\tgithub.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect\n\tgithub.com/acomagu/bufpipe v1.0.3 // indirect\n\tgithub.com/emirpasic/gods v1.12.0 // indirect\n\tgithub.com/go-git/gcfg v1.5.0 // indirect\n\tgithub.com/go-logr/logr v1.2.2 // indirect\n\tgithub.com/go-logr/stdr v1.2.2 // indirect\n\tgithub.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect\n\tgithub.com/golang/protobuf v1.5.2 // indirect\n\tgithub.com/google/go-querystring v1.1.0 // indirect\n\tgithub.com/googleapis/gax-go/v2 v2.1.1 // indirect\n\tgithub.com/imdario/mergo v0.3.12 // indirect\n\tgithub.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect\n\tgithub.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect\n\tgithub.com/mitchellh/go-homedir v1.1.0 // indirect\n\tgithub.com/sergi/go-diff v1.1.0 // indirect\n\tgithub.com/shurcooL/graphql v0.0.0-20200928012149-18c5c3165e3a // indirect\n\tgithub.com/xanzy/ssh-agent v0.3.0 // indirect\n\tgo.opencensus.io v0.23.0 // indirect\n\tgo.opentelemetry.io/otel/internal/metric v0.27.0 // indirect\n\tgo.opentelemetry.io/otel/metric v0.27.0 // indirect\n\tgo.opentelemetry.io/otel/sdk/export/metric v0.26.0 // indirect\n\tgo.opentelemetry.io/otel/sdk/metric v0.26.0 // indirect\n\tgo.opentelemetry.io/otel/trace v1.4.0 // indirect\n\tgolang.org/x/crypto v0.1.0 // indirect\n\tgolang.org/x/net v0.10.0 // indirect\n\tgolang.org/x/sys v0.8.0 // indirect\n\tgolang.org/x/text v0.9.0 // indirect\n\tgoogle.golang.org/appengine v1.6.7 // indirect\n\tgoogle.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf // indirect\n\tgoogle.golang.org/protobuf v1.27.1 // indirect\n\tgopkg.in/warnings.v0 v0.1.2 // indirect\n)\n",
"status_code": 200
}
}
|
TestFixModules
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestFixModules/ok.json
|
{
"github.com/influxdata/influxdb/@latest": {
"body": "{\"Version\":\"v1.11.5\",\"Time\":\"2024-01-23T17:07:52Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/influxdata/influxdb\",\"Ref\":\"refs/tags/v1.11.5\",\"Hash\":\"8b9a9c63c5b792e0d589873dc87dbda86a84c983\"}}",
"status_code": 200
},
"github.com/influxdata/influxdb/@v/list": {
"body": "v1.9.0\nv0.8.0-rc.2\nv1.3.0\nv1.0.2\nv0.5.8\nv0.9.0-rc22\nv0.9.0-rc21\nv0.9.5-rc3\nv1.7.0\nv1.8.8\nv0.9.0-rc23\nv1.0.0-beta3\nv0.10.0-rc2\nv0.9.0-rc3\nv0.5.5\nv0.5.0-rc.4\nv1.2.3\nv0.9.3\nv0.7.0\nv1.7.9\nv1.1.0-rc2\nv0.9.0-rc33\nv0.8.1\nv0.9.0-rc24\nv1.9.6\nv0.9.0-rc18\nv0.9.2\nv0.7.3\nv1.9.8\nv1.5.1\nv1.8.0\nv1.2.1-rc4\nv1.6.4\nv0.9.0-rc13\nv0.9.0-rc29\nv0.9.0-rc14\nv1.6.5\nv0.5.0-rc.3\nv0.8.8\nv0.9.0-rc10\nv0.3.0\nv1.7.9-dev1\nv1.7.8\nv0.11.0-rc1\nv1.6.0\nv0.5.2\nv1.4.2\nv0.6.1\nv1.11.2\nv0.9.0-rc19\nv1.9.7\nv1.0.0\nv0.7.2\nv1.8.10\nv0.8.0\nv0.9.0-rc4\nv1.8.3\nv0.9.0-rc12\nv0.9.0-rc27\nv0.5.11\nv1.4.3\nv0.8.3\nv0.4.3\nv1.8.5\nv0.6.0\nv0.9.0-rc31\nv0.0.1\nv0.9.1-rc2\nv0.5.0-rc.6\nv1.3.3\nv0.10.0-beta2\nv0.5.6\nv0.10.0-beta1\nv0.10.0\nv1.8.7\nv0.5.3\nv1.3.6\nv0.10.2\nv1.1.0-rc1\nv0.6.2\nv0.5.0-rc.2\nv1.8.9\nv0.5.0\nv0.9.0-rc9\nv1.8.2\nv0.9.0-rc6\nv1.11.4\nv1.5.5\nv0.9.0-rc7\nv1.1.1\nv0.5.0-rc.5\nv0.8.0-rc.4\nv0.9.6-rc1\nv0.9.0-rc30\nv0.9.5\nv1.8.6\nv1.9.12\nv0.8.0-rc.5\nv0.10.3\nv1.3.1\nv1.0.0-beta1\nv1.5.0\nv1.2.3-gershontest\nv1.3.4\nv0.0.5\nv1.7.2\nv0.12.0\nv0.8.7\nv1.7.1\nv1.4.1\nv0.12.2\nv1.10.7\nv0.9.0-rc20\nv1.1.3\nv1.7.11\nv1.9.13\nv1.1.2\nv1.6.1-exp-2-tr\nv1.9.1\nv1.6.3\nv0.8.5\nv1.10.0\nv0.9.0-rc16\nv1.7.3\nv0.5.0-rc.1\nv0.9.2-rc1\nv0.4.4\nv0.9.0\nv0.6.5\nv0.4.0\nv1.9.10\nv0.4.1\nv0.9.0-rc28\nv0.5.4\nv0.9.0-rc25\nv0.0.3\nv1.2.0-rc1\nv1.2.1-rc2\nv0.5.1\nv1.7.5\nv1.11.0\nv0.8.4\nv0.0.4\nv1.5.2\nv0.9.4-rc1\nv1.10.2\nv1.9.4\nv1.0.0-rc1\nv1.2.4\nv1.3.2\nv1.2.1\nv1.5.4\nv0.10.1\nv1.9.3\nv1.2.0-rc2\nv0.3.1\nv1.2.1-rc3\nv0.9.6-rc2\nv0.11.0\nv1.1.5\nv0.5.7\nv0.1.0\nv0.9.3-rc1\nv1.4.0\nv0.7.1\nv0.9.5-rc1\nv0.0.2\nv1.1.4\nv0.9.1\nv1.2.0\nv0.6.3\nv0.9.6\nv1.6.1-exp-tr\nv1.10.4\nv1.9.9\nv1.2.1-rc1\nv1.3.9\nv1.9.11\nv1.2.1-rc5\nv1.2.2\nv0.0.8\nv0.9.0-rc11\nv0.0.9\nv0.10.0-rc1\nv0.9.3-rc2\nv1.6.1\nv0.9.0-rc17\nv1.7.7\nv1.10.1\nv0.13.0-rc2\nv1.5.3\nv0.8.2\nv0.11.1\nv0.9.0-rc32\nv0.5.10\nv1.10.5\nv1.3.5\nv0.13.0\nv1.9.2\nv0.5.9\nv1.6.6\nv1.10.6\nv0.8.0-rc.1\nv1.7.10\nv1.3.8\nv0.8.6\nv0.9.0-rc5\nv0.9.0-rc8\nv1.9.5\nv0.13.0-rc1\nv1.8.1\nv1.10.3\nv1.6.2\nv1.7.4\nv1.0.1\nv0.9.0-rc2\nv1.11.5\nv0.9.3-rc3\nv1.1.0\nv1.0.0-rc2\nv0.6.4\nv1.11.1\nv0.0.6\nv0.0.7\nv1.8.4\nv0.2.0\nv1.3.7\nv0.9.5-rc2\nv1.0.0-beta2\nv0.8.0-rc.3\nv0.4.2\nv0.9.0-rc15\nv0.8.9\nv0.8.4-rc.1\nv0.9.1-rc1\nv0.3.2\nv0.12.1\nv0.9.4\nv1.7.6\nv0.5.12\nv0.9.0-rc26\n",
"status_code": 200
},
"github.com/influxdata/influxdb/@v/v0.3.2.mod": {
"body": "module github.com/influxdata/influxdb\n",
"status_code": 200
},
"github.com/influxdata/influxdb/@v/v1.7.6.mod": {
"body": "module github.com/influxdata/influxdb\n",
"status_code": 200
}
}
|
TestFixModules
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestFixModules/bad_versions.json
|
{
"github.com/hashicorp/go-getter/@latest": {
"body": "{\"Version\":\"v1.7.5\",\"Time\":\"2024-06-21T21:06:48Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/hashicorp/go-getter\",\"Hash\":\"5a63fd9c0d5b8da8a6805e8c283f46f0dacb30b3\",\"Ref\":\"refs/tags/v1.7.5\"}}",
"status_code": 200
},
"github.com/hashicorp/go-getter/@v/list": {
"body": "v1.3.0\nv1.0.2\nv1.7.0\nv1.5.8\nv1.5.1\nv1.6.0\nv1.4.2\nv1.0.0\nv1.5.6\nv1.5.5\nv1.5.0\nv1.7.2\nv1.5.10\nv1.7.1\nv1.4.1\nv1.0.3\nv1.5.9\nv1.7.3\nv1.5.11\nv1.7.5\nv1.5.2\nv1.5.4\nv1.4.0\nv1.2.0\nv1.5.7\nv1.6.1\nv1.5.3\nv1.6.2\nv1.7.4\nv1.0.1\nv1.1.0\n",
"status_code": 200
},
"github.com/hashicorp/go-getter/@v/v1.6.3.mod": {
"status_code": 404
},
"github.com/hashicorp/go-getter/v15/@latest": {
"status_code": 404
},
"github.com/hashicorp/go-getter/v15/@v/list": {
"status_code": 404
},
"github.com/hashicorp/go-getter/v2/@latest": {
"body": "{\"Version\":\"v2.2.2\",\"Time\":\"2024-05-17T13:52:29Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/hashicorp/go-getter\",\"Ref\":\"refs/tags/v2.2.2\",\"Hash\":\"035baf040a61a36387844b7ca0eeaa62d06d3265\"}}",
"status_code": 200
},
"github.com/hashicorp/go-getter/v2/@v/list": {
"body": "v2.2.0\nv2.0.2\nv2.0.0\nv2.2.1\nv2.2.2\nv2.1.0\nv2.0.1\nv2.1.1\n",
"status_code": 200
},
"github.com/hashicorp/go-getter/v2/@v/v2.0.2.mod": {
"body": "module github.com/hashicorp/go-getter/v2\n\nrequire (\n\tgithub.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d\n\tgithub.com/google/go-cmp v0.3.0\n\tgithub.com/hashicorp/go-cleanhttp v0.5.0\n\tgithub.com/hashicorp/go-multierror v1.1.0\n\tgithub.com/hashicorp/go-safetemp v1.0.0\n\tgithub.com/hashicorp/go-version v1.1.0\n\tgithub.com/mitchellh/go-homedir v1.0.0\n\tgithub.com/mitchellh/go-testing-interface v1.0.0\n\tgithub.com/ulikunitz/xz v0.5.8\n)\n\ngo 1.13\n",
"status_code": 200
},
"github.com/hashicorp/go-getter/v2/@v/v2.0.300.mod": {
"status_code": 404
}
}
|
TestFixModules
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestFixModules/canonicalize.json
|
{
"github.com/golang/vulndb/@latest": {
"body": "{\"Version\":\"v0.0.0-20240626230022-4408037c1739\",\"Time\":\"2024-06-26T23:00:22Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/golang/vulndb\",\"Hash\":\"4408037c1739cc5a078d9d0d410162ee4f336c09\"}}",
"status_code": 200
},
"github.com/golang/vulndb/@v/v0.0.0-20230712151357-4fee11d0f8f9.mod": {
"body": "module golang.org/x/vulndb\n\ngo 1.18\n\nrequire golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect\n\nrequire (\n\tcloud.google.com/go/errorreporting v0.1.0\n\tcloud.google.com/go/firestore v1.6.1\n\tgithub.com/GoogleCloudPlatform/opentelemetry-operations-go v1.0.0\n\tgithub.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.26.0\n\tgithub.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.0.0\n\tgithub.com/client9/misspell v0.3.4\n\tgithub.com/go-git/go-billy/v5 v5.4.1\n\tgithub.com/go-git/go-git/v5 v5.7.0\n\tgithub.com/google/go-cmp v0.5.9\n\tgithub.com/google/go-github/v41 v41.0.0\n\tgithub.com/google/osv-scanner v1.3.4\n\tgithub.com/google/safehtml v0.0.2\n\tgithub.com/jba/templatecheck v0.6.0\n\tgithub.com/shurcooL/githubv4 v0.0.0-20220115235240-a14260e6f8a2\n\tgo.opentelemetry.io/otel v1.4.0\n\tgo.opentelemetry.io/otel/sdk v1.4.0\n\tgolang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1\n\tgolang.org/x/exp/event v0.0.0-20220218215828-6cf2b201936e\n\tgolang.org/x/mod v0.10.0\n\tgolang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8\n\tgolang.org/x/sync v0.2.0\n\tgolang.org/x/time v0.0.0-20191024005414-555d28b269f0\n\tgolang.org/x/tools v0.9.3\n\tgoogle.golang.org/api v0.70.0\n\tgoogle.golang.org/grpc v1.44.0\n\tgopkg.in/yaml.v3 v3.0.1\n\thonnef.co/go/tools v0.2.2\n\tmvdan.cc/unparam v0.0.0-20220926085101-66de63301820\n)\n\nrequire (\n\tcloud.google.com/go v0.100.2 // indirect\n\tcloud.google.com/go/compute v1.3.0 // indirect\n\tcloud.google.com/go/monitoring v1.2.0 // indirect\n\tcloud.google.com/go/trace v1.0.0 // indirect\n\tgithub.com/BurntSushi/toml v1.3.0 // indirect\n\tgithub.com/Microsoft/go-winio v0.5.2 // indirect\n\tgithub.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 // indirect\n\tgithub.com/acomagu/bufpipe v1.0.4 // indirect\n\tgithub.com/cloudflare/circl v1.3.3 // indirect\n\tgithub.com/emirpasic/gods v1.18.1 // indirect\n\tgithub.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect\n\tgithub.com/go-logr/logr v1.2.2 // indirect\n\tgithub.com/go-logr/stdr v1.2.2 // indirect\n\tgithub.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect\n\tgithub.com/golang/protobuf v1.5.2 // indirect\n\tgithub.com/google/go-querystring v1.1.0 // indirect\n\tgithub.com/googleapis/gax-go/v2 v2.1.1 // indirect\n\tgithub.com/imdario/mergo v0.3.15 // indirect\n\tgithub.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect\n\tgithub.com/kevinburke/ssh_config v1.2.0 // indirect\n\tgithub.com/pjbgf/sha1cd v0.3.0 // indirect\n\tgithub.com/sergi/go-diff v1.1.0 // indirect\n\tgithub.com/shurcooL/graphql v0.0.0-20200928012149-18c5c3165e3a // indirect\n\tgithub.com/skeema/knownhosts v1.1.1 // indirect\n\tgithub.com/xanzy/ssh-agent v0.3.3 // indirect\n\tgo.opencensus.io v0.23.0 // indirect\n\tgo.opentelemetry.io/otel/internal/metric v0.27.0 // indirect\n\tgo.opentelemetry.io/otel/metric v0.27.0 // indirect\n\tgo.opentelemetry.io/otel/sdk/export/metric v0.26.0 // indirect\n\tgo.opentelemetry.io/otel/sdk/metric v0.26.0 // indirect\n\tgo.opentelemetry.io/otel/trace v1.4.0 // indirect\n\tgolang.org/x/crypto v0.9.0 // indirect\n\tgolang.org/x/net v0.10.0 // indirect\n\tgolang.org/x/sys v0.8.0 // indirect\n\tgolang.org/x/text v0.9.0 // indirect\n\tgoogle.golang.org/appengine v1.6.7 // indirect\n\tgoogle.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf // indirect\n\tgoogle.golang.org/protobuf v1.27.1 // indirect\n\tgopkg.in/warnings.v0 v0.1.2 // indirect\n)\n",
"status_code": 200
},
"golang.org/x/vulndb/@latest": {
"body": "{\"Version\":\"v0.0.0-20240626230022-4408037c1739\",\"Time\":\"2024-06-26T23:00:22Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/vulndb\",\"Hash\":\"4408037c1739cc5a078d9d0d410162ee4f336c09\"}}",
"status_code": 200
},
"golang.org/x/vulndb/@v/v0.0.0-20230712151357-4fee11d0f8f9.mod": {
"body": "module golang.org/x/vulndb\n\ngo 1.18\n\nrequire golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect\n\nrequire (\n\tcloud.google.com/go/errorreporting v0.1.0\n\tcloud.google.com/go/firestore v1.6.1\n\tgithub.com/GoogleCloudPlatform/opentelemetry-operations-go v1.0.0\n\tgithub.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.26.0\n\tgithub.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.0.0\n\tgithub.com/client9/misspell v0.3.4\n\tgithub.com/go-git/go-billy/v5 v5.4.1\n\tgithub.com/go-git/go-git/v5 v5.7.0\n\tgithub.com/google/go-cmp v0.5.9\n\tgithub.com/google/go-github/v41 v41.0.0\n\tgithub.com/google/osv-scanner v1.3.4\n\tgithub.com/google/safehtml v0.0.2\n\tgithub.com/jba/templatecheck v0.6.0\n\tgithub.com/shurcooL/githubv4 v0.0.0-20220115235240-a14260e6f8a2\n\tgo.opentelemetry.io/otel v1.4.0\n\tgo.opentelemetry.io/otel/sdk v1.4.0\n\tgolang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1\n\tgolang.org/x/exp/event v0.0.0-20220218215828-6cf2b201936e\n\tgolang.org/x/mod v0.10.0\n\tgolang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8\n\tgolang.org/x/sync v0.2.0\n\tgolang.org/x/time v0.0.0-20191024005414-555d28b269f0\n\tgolang.org/x/tools v0.9.3\n\tgoogle.golang.org/api v0.70.0\n\tgoogle.golang.org/grpc v1.44.0\n\tgopkg.in/yaml.v3 v3.0.1\n\thonnef.co/go/tools v0.2.2\n\tmvdan.cc/unparam v0.0.0-20220926085101-66de63301820\n)\n\nrequire (\n\tcloud.google.com/go v0.100.2 // indirect\n\tcloud.google.com/go/compute v1.3.0 // indirect\n\tcloud.google.com/go/monitoring v1.2.0 // indirect\n\tcloud.google.com/go/trace v1.0.0 // indirect\n\tgithub.com/BurntSushi/toml v1.3.0 // indirect\n\tgithub.com/Microsoft/go-winio v0.5.2 // indirect\n\tgithub.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 // indirect\n\tgithub.com/acomagu/bufpipe v1.0.4 // indirect\n\tgithub.com/cloudflare/circl v1.3.3 // indirect\n\tgithub.com/emirpasic/gods v1.18.1 // indirect\n\tgithub.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect\n\tgithub.com/go-logr/logr v1.2.2 // indirect\n\tgithub.com/go-logr/stdr v1.2.2 // indirect\n\tgithub.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect\n\tgithub.com/golang/protobuf v1.5.2 // indirect\n\tgithub.com/google/go-querystring v1.1.0 // indirect\n\tgithub.com/googleapis/gax-go/v2 v2.1.1 // indirect\n\tgithub.com/imdario/mergo v0.3.15 // indirect\n\tgithub.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect\n\tgithub.com/kevinburke/ssh_config v1.2.0 // indirect\n\tgithub.com/pjbgf/sha1cd v0.3.0 // indirect\n\tgithub.com/sergi/go-diff v1.1.0 // indirect\n\tgithub.com/shurcooL/graphql v0.0.0-20200928012149-18c5c3165e3a // indirect\n\tgithub.com/skeema/knownhosts v1.1.1 // indirect\n\tgithub.com/xanzy/ssh-agent v0.3.3 // indirect\n\tgo.opencensus.io v0.23.0 // indirect\n\tgo.opentelemetry.io/otel/internal/metric v0.27.0 // indirect\n\tgo.opentelemetry.io/otel/metric v0.27.0 // indirect\n\tgo.opentelemetry.io/otel/sdk/export/metric v0.26.0 // indirect\n\tgo.opentelemetry.io/otel/sdk/metric v0.26.0 // indirect\n\tgo.opentelemetry.io/otel/trace v1.4.0 // indirect\n\tgolang.org/x/crypto v0.9.0 // indirect\n\tgolang.org/x/net v0.10.0 // indirect\n\tgolang.org/x/sys v0.8.0 // indirect\n\tgolang.org/x/text v0.9.0 // indirect\n\tgoogle.golang.org/appengine v1.6.7 // indirect\n\tgoogle.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf // indirect\n\tgoogle.golang.org/protobuf v1.27.1 // indirect\n\tgopkg.in/warnings.v0 v0.1.2 // indirect\n)\n",
"status_code": 200
}
}
|
TestFixModules
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestFixModules/ok2.json
|
{
"golang.org/x/crypto/@latest": {
"body": "{\"Version\":\"v0.24.0\",\"Time\":\"2024-06-04T16:30:12Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/crypto\",\"Ref\":\"refs/tags/v0.24.0\",\"Hash\":\"332fd656f4f013f66e643818fe8c759538456535\"}}",
"status_code": 200
}
}
|
TestFixModules
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestFixModules/preserve_major.json
|
{
"github.com/mattermost/mattermost-server/@latest": {
"body": "{\"Version\":\"v9.9.1+incompatible\",\"Time\":\"2024-06-26T16:43:22Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/mattermost/mattermost-server\",\"Hash\":\"c758cecaf30c2dabaf31b7e38b6679c2a4552502\",\"Ref\":\"refs/tags/v9.9.1\"}}",
"status_code": 200
},
"github.com/mattermost/mattermost-server/@v/v1.1.0.mod": {
"body": "module github.com/mattermost/mattermost-server\n",
"status_code": 200
},
"github.com/mattermost/mattermost-server/v2/@latest": {
"status_code": 404
},
"github.com/mattermost/mattermost-server/v2/@v/list": {
"status_code": 404
},
"github.com/mattermost/mattermost-server/v3/@latest": {
"status_code": 404
},
"github.com/mattermost/mattermost-server/v3/@v/list": {
"status_code": 404
},
"github.com/mattermost/mattermost-server/v4/@latest": {
"status_code": 404
},
"github.com/mattermost/mattermost-server/v4/@v/list": {
"status_code": 404
},
"github.com/mattermost/mattermost-server/v5/@latest": {
"body": "{\"Version\":\"v5.39.3\",\"Time\":\"2021-12-15T17:40:34Z\"}",
"status_code": 200
},
"github.com/mattermost/mattermost-server/v6/@latest": {
"body": "{\"Version\":\"v6.7.2\",\"Time\":\"2022-06-14T11:04:53Z\"}",
"status_code": 200
},
"github.com/mattermost/mattermost-server/v7/@latest": {
"status_code": 404
},
"github.com/mattermost/mattermost-server/v7/@v/list": {
"status_code": 404
},
"github.com/mattermost/mattermost/server/v8/@latest": {
"body": "{\"Version\":\"v8.0.0-20240627132757-e85d34163c94\",\"Time\":\"2024-06-27T13:27:57Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/mattermost/mattermost\",\"Subdir\":\"server\",\"Hash\":\"e85d34163c94d9d37a7d86f3c4343454187a7ccc\"}}",
"status_code": 200
}
}
|
TestFixModules
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestFixModules/add_incompatible.json
|
{
"github.com/docker/docker/@latest": {
"body": "{\"Version\":\"v27.0.2+incompatible\",\"Time\":\"2024-06-26T18:30:43Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/docker/docker\",\"Hash\":\"e953d76450b64bd64b2374137b0580223a114fdb\",\"Ref\":\"refs/tags/v27.0.2\"}}",
"status_code": 200
},
"github.com/docker/docker/@v/list": {
"body": "v1.9.0\nv1.6.0-rc3\nv1.3.0\nv1.12.0-rc3\nv1.8.2-rc1\nv20.10.11+incompatible\nv24.0.3+incompatible\nv27.0.1-rc.1+incompatible\nv1.7.0\nv23.0.0-rc.3+incompatible\nv1.7.0-rc5\nv0.1.4\nv25.0.1+incompatible\nv1.12.2-rc3\nv23.0.9+incompatible\nv1.11.0-rc3\nv1.13.0-rc2\nv23.0.3+incompatible\nv20.10.21+incompatible\nv17.11.0-ce-rc3+incompatible\nv25.0.0-rc.1+incompatible\nv17.10.0-ce+incompatible\nv1.12.0-rc2\nv0.7.5\nv0.2.2\nv0.7.0-rc1\nv1.6.0-rc7\nv0.7.0\nv1.13.1-rc1\nv1.10.0-rc3\nv25.0.5+incompatible\nv0.1.3\nv20.10.6+incompatible\nv0.8.1\nv26.0.2+incompatible\nv1.13.1\nv20.10.1+incompatible\nv0.7.3\nv17.12.1-ce+incompatible\nv1.8.0\nv20.10.0+incompatible\nv1.12.0-rc4\nv0.6.6\nv20.10.4+incompatible\nv1.9.0-rc2\nv1.12.2-rc2\nv0.4.5\nv0.3.0\nv0.4.6\nv1.6.0\nv0.5.2\nv26.0.0-rc1+incompatible\nv0.6.1\nv20.10.23+incompatible\nv0.3.4\nv1.11.2\nv1.0.0\nv0.7.2\nv0.8.0\nv23.0.0-rc.2+incompatible\nv1.8.3\nv24.0.1+incompatible\nv23.0.8+incompatible\nv1.7.0-rc1\nv23.0.11+incompatible\nv1.12.0\nv27.0.0+incompatible\nv0.4.3\nv0.6.0\nv20.10.10-rc1+incompatible\nv26.1.1+incompatible\nv23.0.2+incompatible\nv1.3.3\nv24.0.2+incompatible\nv1.13.0-rc6\nv1.11.2-rc1\nv0.10.0\nv0.7.4\nv1.12.4-rc1\nv0.5.3\nv1.8.0-rc1\nv0.7.0-rc2\nv1.5.0-rc4\nv1.6.0-rc2\nv0.6.2\nv24.0.0+incompatible\nv23.0.0+incompatible\nv1.7.0-rc3\nv20.10.15+incompatible\nv17.10.0-ce-rc2+incompatible\nv20.10.17+incompatible\nv0.5.0\nv24.0.0-rc.2+incompatible\nv1.13.1-rc2\nv1.8.2\nv20.10.16+incompatible\nv1.9.0-rc1\nv20.10.2+incompatible\nv20.10.22+incompatible\nv1.1.1\nv20.10.20+incompatible\nv1.12.6\nv20.10.0-rc2+incompatible\nv1.12.1\nv25.0.2+incompatible\nv20.10.27+incompatible\nv1.5.0-rc2\nv1.3.1\nv0.1.7\nv17.12.0-ce-rc1+incompatible\nv1.5.0\nv23.0.7+incompatible\nv17.11.0-ce+incompatible\nv23.0.6+incompatible\nv1.11.0-rc5\nv1.11.0-rc4\nv0.12.0\nv0.1.6\nv17.11.0-ce-rc1+incompatible\nv1.7.1\nv1.4.1\nv20.10.9+incompatible\nv1.7.1-rc1\nv17.12.0-ce-rc3+incompatible\nv1.6.0-rc6\nv25.0.0-beta.3+incompatible\nv1.5.0-rc1\nv0.7.0-rc5\nv1.1.2\nv20.10.18+incompatible\nv1.9.1\nv17.11.0-ce-rc2+incompatible\nv1.12.3\nv1.10.0\nv17.12.1-ce-rc2+incompatible\nv20.10.26+incompatible\nv1.8.0-rc3\nv0.1.2\nv0.3.3\nv24.0.0-rc.4+incompatible\nv0.4.4\nv20.10.14+incompatible\nv0.7.0-rc4\nv0.9.0\nv0.6.5\nv0.4.0\nv25.0.0-beta.1+incompatible\nv0.1.8\nv0.4.1\nv20.10.8+incompatible\nv1.11.0-rc2\nv1.7.1-rc3\nv23.0.0-rc.4+incompatible\nv23.0.12+incompatible\nv25.0.0+incompatible\nv20.10.0-rc1+incompatible\nv0.5.1\nv0.7.0-rc7\nv24.0.0-beta.2+incompatible\nv1.9.1-rc1\nv1.11.0\nv23.0.1+incompatible\nv24.0.6+incompatible\nv23.0.5+incompatible\nv26.1.3+incompatible\nv20.10.3+incompatible\nv1.10.1-rc1\nv1.12.5\nv1.6.0-rc4\nv25.0.0-rc.3+incompatible\nv25.0.3+incompatible\nv1.10.2\nv1.13.0-rc5\nv24.0.0-rc.1+incompatible\nv24.0.5+incompatible\nv23.0.13+incompatible\nv1.3.2\nv17.12.0-ce-rc2+incompatible\nv0.3.1\nv0.2.1\nv26.1.4+incompatible\nv0.11.0\nv1.10.2-rc1\nv1.7.0-rc2\nv0.1.0\nv17.12.0-ce-rc4+incompatible\nv1.11.1-rc1\nv20.10.10+incompatible\nv1.4.0\nv0.7.1\nv0.1.5\nv27.0.0-rc.1+incompatible\nv1.13.0-rc1\nv0.9.1\nv1.2.0\nv1.13.0-rc7\nv0.6.3\nv0.1.1\nv24.0.0-beta.1+incompatible\nv1.12.1-rc2\nv25.0.0-beta.2+incompatible\nv20.10.0-beta1+incompatible\nv25.0.4+incompatible\nv0.4.7\nv1.12.2\nv1.10.3-rc2\nv1.9.0-rc4\nv26.1.0+incompatible\nv1.10.0-rc2\nv20.10.5+incompatible\nv20.10.13+incompatible\nv1.6.1\nv1.13.0-rc3\nv1.12.4\nv1.10.1\nv0.7.0-rc6\nv26.0.0+incompatible\nv1.13.0-rc4\nv0.7.6\nv1.12.5-rc1\nv24.0.4+incompatible\nv1.12.3-rc1\nv0.11.1\nv1.7.0-rc4\nv26.0.0-rc3+incompatible\nv27.0.0-rc.2+incompatible\nv1.12.1-rc1\nv25.0.0-rc.2+incompatible\nv1.7.1-rc2\nv27.0.2+incompatible\nv1.10.3-rc1\nv0.6.7\nv1.13.0\nv24.0.9+incompatible\nv1.6.0-rc1\nv26.0.0-rc2+incompatible\nv1.10.0-rc4\nv1.8.1\nv1.10.3\nv24.0.7+incompatible\nv1.12.0-rc5\nv1.6.2\nv1.9.0-rc3\nv26.1.2+incompatible\nv17.10.0-ce-rc1+incompatible\nv24.0.8+incompatible\nv1.0.1\nv27.0.1+incompatible\nv1.1.0\nv17.11.0-ce-rc4+incompatible\nv20.10.24+incompatible\nv0.6.4\nv1.11.1\nv1.11.0-rc1\nv1.12.0-rc1\nv1.5.0-rc3\nv0.2.0\nv1.8.0-rc2\nv1.10.0-rc1\nv0.4.2\nv23.0.0-beta.1+incompatible\nv20.10.25+incompatible\nv23.0.10+incompatible\nv17.12.1-ce-rc1+incompatible\nv24.0.0-rc.3+incompatible\nv20.10.7+incompatible\nv0.3.2\nv23.0.0-rc.1+incompatible\nv0.4.8\nv1.9.0-rc5\nv0.7.0-rc3\nv20.10.12+incompatible\nv17.12.0-ce+incompatible\nv1.6.0-rc5\nv20.10.19+incompatible\nv23.0.4+incompatible\nv26.0.1+incompatible\nv1.12.2-rc1\n",
"status_code": 200
},
"github.com/docker/docker/@v/v23.0.0+incompatible.mod": {
"body": "module github.com/docker/docker\n",
"status_code": 200
},
"github.com/docker/docker/v23/@latest": {
"status_code": 404
},
"github.com/docker/docker/v23/@v/list": {
"status_code": 404
}
}
|
TestFixModules
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestFixModules/merge_modules.json
|
{
"github.com/hashicorp/go-getter/@latest": {
"body": "{\"Version\":\"v1.7.5\",\"Time\":\"2024-06-21T21:06:48Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/hashicorp/go-getter\",\"Hash\":\"5a63fd9c0d5b8da8a6805e8c283f46f0dacb30b3\",\"Ref\":\"refs/tags/v1.7.5\"}}",
"status_code": 200
},
"github.com/hashicorp/go-getter/v2/@latest": {
"body": "{\"Version\":\"v2.2.2\",\"Time\":\"2024-05-17T13:52:29Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/hashicorp/go-getter\",\"Ref\":\"refs/tags/v2.2.2\",\"Hash\":\"035baf040a61a36387844b7ca0eeaa62d06d3265\"}}",
"status_code": 200
},
"github.com/hashicorp/go-getter/v2/@v/list": {
"body": "v2.2.0\nv2.0.2\nv2.0.0\nv2.2.1\nv2.2.2\nv2.1.0\nv2.0.1\nv2.1.1\n",
"status_code": 200
},
"github.com/hashicorp/go-getter/v2/@v/v2.0.0.mod": {
"body": "module github.com/hashicorp/go-getter/v2\n\nrequire (\n\tgithub.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d\n\tgithub.com/google/go-cmp v0.3.0\n\tgithub.com/hashicorp/go-cleanhttp v0.5.0\n\tgithub.com/hashicorp/go-multierror v1.1.0\n\tgithub.com/hashicorp/go-safetemp v1.0.0\n\tgithub.com/hashicorp/go-version v1.1.0\n\tgithub.com/mitchellh/go-homedir v1.0.0\n\tgithub.com/mitchellh/go-testing-interface v1.0.0\n\tgithub.com/ulikunitz/xz v0.5.8\n)\n\ngo 1.13\n",
"status_code": 200
},
"github.com/hashicorp/go-getter/v2/@v/v2.0.2.mod": {
"body": "module github.com/hashicorp/go-getter/v2\n\nrequire (\n\tgithub.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d\n\tgithub.com/google/go-cmp v0.3.0\n\tgithub.com/hashicorp/go-cleanhttp v0.5.0\n\tgithub.com/hashicorp/go-multierror v1.1.0\n\tgithub.com/hashicorp/go-safetemp v1.0.0\n\tgithub.com/hashicorp/go-version v1.1.0\n\tgithub.com/mitchellh/go-homedir v1.0.0\n\tgithub.com/mitchellh/go-testing-interface v1.0.0\n\tgithub.com/ulikunitz/xz v0.5.8\n)\n\ngo 1.13\n",
"status_code": 200
},
"github.com/hashicorp/go-getter/v2/@v/v2.1.0.mod": {
"body": "module github.com/hashicorp/go-getter/v2\n\nrequire (\n\tgithub.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d\n\tgithub.com/google/go-cmp v0.3.0\n\tgithub.com/hashicorp/go-cleanhttp v0.5.0\n\tgithub.com/hashicorp/go-multierror v1.1.0\n\tgithub.com/hashicorp/go-safetemp v1.0.0\n\tgithub.com/hashicorp/go-version v1.1.0\n\tgithub.com/mitchellh/go-homedir v1.0.0\n\tgithub.com/mitchellh/go-testing-interface v1.0.0\n\tgithub.com/ulikunitz/xz v0.5.8\n)\n\ngo 1.13\n",
"status_code": 200
},
"github.com/hashicorp/go-getter/v2/@v/v2.1.1.mod": {
"body": "module github.com/hashicorp/go-getter/v2\n\nrequire (\n\tgithub.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d\n\tgithub.com/google/go-cmp v0.3.0\n\tgithub.com/hashicorp/go-cleanhttp v0.5.0\n\tgithub.com/hashicorp/go-multierror v1.1.0\n\tgithub.com/hashicorp/go-safetemp v1.0.0\n\tgithub.com/hashicorp/go-version v1.1.0\n\tgithub.com/mitchellh/go-homedir v1.0.0\n\tgithub.com/mitchellh/go-testing-interface v1.0.0\n\tgithub.com/ulikunitz/xz v0.5.8\n)\n\ngo 1.13\n",
"status_code": 200
}
}
|
TestFixModules
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestFixModules/ok_no_versions.json
|
{
"github.com/influxdata/influxdb/@latest": {
"body": "{\"Version\":\"v1.11.5\",\"Time\":\"2024-01-23T17:07:52Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/influxdata/influxdb\",\"Ref\":\"refs/tags/v1.11.5\",\"Hash\":\"8b9a9c63c5b792e0d589873dc87dbda86a84c983\"}}",
"status_code": 200
}
}
|
TestFixModules
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestFixModules/import_path.json
|
{
"github.com/influxdata/influxdb/@latest": {
"body": "{\"Version\":\"v1.11.5\",\"Time\":\"2024-01-23T17:07:52Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/influxdata/influxdb\",\"Ref\":\"refs/tags/v1.11.5\",\"Hash\":\"8b9a9c63c5b792e0d589873dc87dbda86a84c983\"}}",
"status_code": 200
},
"github.com/influxdata/influxdb/@v/list": {
"body": "v1.9.0\nv0.8.0-rc.2\nv1.3.0\nv1.0.2\nv0.5.8\nv0.9.0-rc22\nv0.9.0-rc21\nv0.9.5-rc3\nv1.7.0\nv1.8.8\nv0.9.0-rc23\nv1.0.0-beta3\nv0.10.0-rc2\nv0.9.0-rc3\nv0.5.5\nv0.5.0-rc.4\nv1.2.3\nv0.9.3\nv0.7.0\nv1.7.9\nv1.1.0-rc2\nv0.9.0-rc33\nv0.8.1\nv0.9.0-rc24\nv1.9.6\nv0.9.0-rc18\nv0.9.2\nv0.7.3\nv1.9.8\nv1.5.1\nv1.8.0\nv1.2.1-rc4\nv1.6.4\nv0.9.0-rc13\nv0.9.0-rc29\nv0.9.0-rc14\nv1.6.5\nv0.5.0-rc.3\nv0.8.8\nv0.9.0-rc10\nv0.3.0\nv1.7.9-dev1\nv1.7.8\nv0.11.0-rc1\nv1.6.0\nv0.5.2\nv1.4.2\nv0.6.1\nv1.11.2\nv0.9.0-rc19\nv1.9.7\nv1.0.0\nv0.7.2\nv1.8.10\nv0.8.0\nv0.9.0-rc4\nv1.8.3\nv0.9.0-rc12\nv0.9.0-rc27\nv0.5.11\nv1.4.3\nv0.8.3\nv0.4.3\nv1.8.5\nv0.6.0\nv0.9.0-rc31\nv0.0.1\nv0.9.1-rc2\nv0.5.0-rc.6\nv1.3.3\nv0.10.0-beta2\nv0.5.6\nv0.10.0-beta1\nv0.10.0\nv1.8.7\nv0.5.3\nv1.3.6\nv0.10.2\nv1.1.0-rc1\nv0.6.2\nv0.5.0-rc.2\nv1.8.9\nv0.5.0\nv0.9.0-rc9\nv1.8.2\nv0.9.0-rc6\nv1.11.4\nv1.5.5\nv0.9.0-rc7\nv1.1.1\nv0.5.0-rc.5\nv0.8.0-rc.4\nv0.9.6-rc1\nv0.9.0-rc30\nv0.9.5\nv1.8.6\nv1.9.12\nv0.8.0-rc.5\nv0.10.3\nv1.3.1\nv1.0.0-beta1\nv1.5.0\nv1.2.3-gershontest\nv1.3.4\nv0.0.5\nv1.7.2\nv0.12.0\nv0.8.7\nv1.7.1\nv1.4.1\nv0.12.2\nv1.10.7\nv0.9.0-rc20\nv1.1.3\nv1.7.11\nv1.9.13\nv1.1.2\nv1.6.1-exp-2-tr\nv1.9.1\nv1.6.3\nv0.8.5\nv1.10.0\nv0.9.0-rc16\nv1.7.3\nv0.5.0-rc.1\nv0.9.2-rc1\nv0.4.4\nv0.9.0\nv0.6.5\nv0.4.0\nv1.9.10\nv0.4.1\nv0.9.0-rc28\nv0.5.4\nv0.9.0-rc25\nv0.0.3\nv1.2.0-rc1\nv1.2.1-rc2\nv0.5.1\nv1.7.5\nv1.11.0\nv0.8.4\nv0.0.4\nv1.5.2\nv0.9.4-rc1\nv1.10.2\nv1.9.4\nv1.0.0-rc1\nv1.2.4\nv1.3.2\nv1.2.1\nv1.5.4\nv0.10.1\nv1.9.3\nv1.2.0-rc2\nv0.3.1\nv1.2.1-rc3\nv0.9.6-rc2\nv0.11.0\nv1.1.5\nv0.5.7\nv0.1.0\nv0.9.3-rc1\nv1.4.0\nv0.7.1\nv0.9.5-rc1\nv0.0.2\nv1.1.4\nv0.9.1\nv1.2.0\nv0.6.3\nv0.9.6\nv1.6.1-exp-tr\nv1.10.4\nv1.9.9\nv1.2.1-rc1\nv1.3.9\nv1.9.11\nv1.2.1-rc5\nv1.2.2\nv0.0.8\nv0.9.0-rc11\nv0.0.9\nv0.10.0-rc1\nv0.9.3-rc2\nv1.6.1\nv0.9.0-rc17\nv1.7.7\nv1.10.1\nv0.13.0-rc2\nv1.5.3\nv0.8.2\nv0.11.1\nv0.9.0-rc32\nv0.5.10\nv1.10.5\nv1.3.5\nv0.13.0\nv1.9.2\nv0.5.9\nv1.6.6\nv1.10.6\nv0.8.0-rc.1\nv1.7.10\nv1.3.8\nv0.8.6\nv0.9.0-rc5\nv0.9.0-rc8\nv1.9.5\nv0.13.0-rc1\nv1.8.1\nv1.10.3\nv1.6.2\nv1.7.4\nv1.0.1\nv0.9.0-rc2\nv1.11.5\nv0.9.3-rc3\nv1.1.0\nv1.0.0-rc2\nv0.6.4\nv1.11.1\nv0.0.6\nv0.0.7\nv1.8.4\nv0.2.0\nv1.3.7\nv0.9.5-rc2\nv1.0.0-beta2\nv0.8.0-rc.3\nv0.4.2\nv0.9.0-rc15\nv0.8.9\nv0.8.4-rc.1\nv0.9.1-rc1\nv0.3.2\nv0.12.1\nv0.9.4\nv1.7.6\nv0.5.12\nv0.9.0-rc26\n",
"status_code": 200
},
"github.com/influxdata/influxdb/@v/v0.3.2.mod": {
"body": "module github.com/influxdata/influxdb\n",
"status_code": 200
},
"github.com/influxdata/influxdb/@v/v1.7.6.mod": {
"body": "module github.com/influxdata/influxdb\n",
"status_code": 200
},
"github.com/influxdata/influxdb/services/@latest": {
"status_code": 404
},
"github.com/influxdata/influxdb/services/@v/list": {
"status_code": 404
},
"github.com/influxdata/influxdb/services/httpd/@latest": {
"status_code": 404
},
"github.com/influxdata/influxdb/services/httpd/@v/list": {
"status_code": 404
}
}
|
TestFixModules
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestFixModules/split_major.json
|
{
"github.com/hashicorp/go-getter/@latest": {
"body": "{\"Version\":\"v1.7.5\",\"Time\":\"2024-06-21T21:06:48Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/hashicorp/go-getter\",\"Hash\":\"5a63fd9c0d5b8da8a6805e8c283f46f0dacb30b3\",\"Ref\":\"refs/tags/v1.7.5\"}}",
"status_code": 200
},
"github.com/hashicorp/go-getter/@v/v1.0.1.mod": {
"body": "module github.com/hashicorp/go-getter\n\nrequire (\n\tgithub.com/aws/aws-sdk-go v1.15.78\n\tgithub.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d\n\tgithub.com/cheggaaa/pb v1.0.27\n\tgithub.com/davecgh/go-spew v1.1.1 // indirect\n\tgithub.com/fatih/color v1.7.0 // indirect\n\tgithub.com/hashicorp/go-cleanhttp v0.5.0\n\tgithub.com/hashicorp/go-safetemp v1.0.0\n\tgithub.com/hashicorp/go-version v1.0.0\n\tgithub.com/mattn/go-colorable v0.0.9 // indirect\n\tgithub.com/mattn/go-isatty v0.0.4 // indirect\n\tgithub.com/mattn/go-runewidth v0.0.4 // indirect\n\tgithub.com/mitchellh/go-homedir v1.0.0\n\tgithub.com/mitchellh/go-testing-interface v1.0.0\n\tgithub.com/pmezard/go-difflib v1.0.0 // indirect\n\tgithub.com/stretchr/testify v1.2.2 // indirect\n\tgithub.com/ulikunitz/xz v0.5.5\n\tgolang.org/x/net v0.0.0-20181114220301-adae6a3d119a // indirect\n\tgolang.org/x/sys v0.0.0-20181213200352-4d1cda033e06 // indirect\n\tgolang.org/x/text v0.3.0 // indirect\n\tgopkg.in/cheggaaa/pb.v1 v1.0.27 // indirect\n)\n",
"status_code": 200
},
"github.com/hashicorp/go-getter/v2/@latest": {
"body": "{\"Version\":\"v2.2.2\",\"Time\":\"2024-05-17T13:52:29Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/hashicorp/go-getter\",\"Ref\":\"refs/tags/v2.2.2\",\"Hash\":\"035baf040a61a36387844b7ca0eeaa62d06d3265\"}}",
"status_code": 200
},
"github.com/hashicorp/go-getter/v2/@v/list": {
"body": "v2.2.0\nv2.0.2\nv2.0.0\nv2.2.1\nv2.2.2\nv2.1.0\nv2.0.1\nv2.1.1\n",
"status_code": 200
},
"github.com/hashicorp/go-getter/v2/@v/v2.0.2.mod": {
"body": "module github.com/hashicorp/go-getter/v2\n\nrequire (\n\tgithub.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d\n\tgithub.com/google/go-cmp v0.3.0\n\tgithub.com/hashicorp/go-cleanhttp v0.5.0\n\tgithub.com/hashicorp/go-multierror v1.1.0\n\tgithub.com/hashicorp/go-safetemp v1.0.0\n\tgithub.com/hashicorp/go-version v1.1.0\n\tgithub.com/mitchellh/go-homedir v1.0.0\n\tgithub.com/mitchellh/go-testing-interface v1.0.0\n\tgithub.com/ulikunitz/xz v0.5.8\n)\n\ngo 1.13\n",
"status_code": 200
}
}
|
TestFixModules
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestFixModules/major_version.json
|
{
"github.com/nats-io/nats-server/@latest": {
"body": "{\"Version\":\"v1.4.1\",\"Time\":\"2019-02-07T23:30:30Z\"}",
"status_code": 200
},
"github.com/nats-io/nats-server/v2/@latest": {
"body": "{\"Version\":\"v2.10.16\",\"Time\":\"2024-05-21T18:43:13Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/nats-io/nats-server\",\"Ref\":\"refs/tags/v2.10.16\",\"Hash\":\"80e29794e56dd4dd9de593029e86768eaf59e09c\"}}",
"status_code": 200
},
"github.com/nats-io/nats-server/v2/@v/list": {
"body": "v2.8.3\nv2.10.17-RC.6\nv2.10.1\nv2.3.0\nv2.2.0\nv2.9.18\nv2.8.4\nv2.9.1\nv2.6.0\nv2.10.9\nv2.0.2\nv2.9.11\nv2.10.3\nv2.6.3\nv2.11.0-dev\nv2.9.10\nv2.10.6\nv2.9.9\nv2.2.4\nv2.7.4\nv2.10.7\nv2.1.2\nv2.0.4\nv2.10.5\nv2.6.2\nv2.10.17-RC.3\nv2.7.2\nv2.9.22\nv2.2.5\nv2.6.5\nv2.9.19\nv2.10.14\nv2.0.0\nv2.10.17-RC.4\nv2.9.21\nv2.9.17\nv2.2.1\nv2.10.12\nv2.10.17-RC.1\nv2.7.3\nv2.3.4\nv2.4.0\nv2.10.17-RC.9\nv2.11.0-preview.1\nv2.10.11\nv2.2.2\nv2.7.1\nv2.8.0\nv2.3.2\nv2.10.17-RC.7\nv2.9.7\nv2.10.16\nv2.2.6\nv2.7.0-rc2\nv2.10.4\nv2.7.0\nv2.1.7\nv2.9.4\nv2.1.8\nv2.9.5\nv2.9.14\nv2.9.12\nv2.9.23\nv2.9.24\nv2.8.1\nv2.11.0-preview.2\nv2.10.17-RC.8\nv2.9.3\nv2.0.0-RC19\nv2.1.0\nv2.3.3\nv2.9.16\nv2.9.8\nv2.9.25\nv2.1.4\nv2.10.8\nv2.10.0\nv2.3.1\nv2.10.2\nv2.9.0\nv2.9.6\nv2.6.1\nv2.9.2\nv2.10.17-RC.2\nv2.1.9\nv2.10.17-RC.5\nv2.9.20\nv2.1.6\nv2.9.15\nv2.2.3\nv2.7.0-rc1\nv2.0.0-RC14\nv2.10.15\nv2.8.2\nv2.6.4\nv2.5.0\nv2.6.6\nv2.10.10\n",
"status_code": 200
},
"github.com/nats-io/nats-server/v2/@v/v2.2.0.mod": {
"body": "module github.com/nats-io/nats-server/v2\n\ngo 1.16\n\nrequire (\n\tgithub.com/klauspost/compress v1.11.12\n\tgithub.com/minio/highwayhash v1.0.1\n\tgithub.com/nats-io/jwt/v2 v2.0.1\n\tgithub.com/nats-io/nats.go v1.10.1-0.20210228004050-ed743748acac\n\tgithub.com/nats-io/nkeys v0.3.0\n\tgithub.com/nats-io/nuid v1.0.1\n\tgolang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b\n\tgolang.org/x/sys v0.0.0-20201119102817-f84b799fce68\n\tgolang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1\n)\n",
"status_code": 200
},
"github.com/nats-io/nats-server/v2/@v/v2.8.3.mod": {
"body": "module github.com/nats-io/nats-server/v2\n\ngo 1.17\n\nrequire (\n\tgithub.com/klauspost/compress v1.14.4\n\tgithub.com/minio/highwayhash v1.0.2\n\tgithub.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a\n\tgithub.com/nats-io/nats.go v1.15.0\n\tgithub.com/nats-io/nkeys v0.3.0\n\tgithub.com/nats-io/nuid v1.0.1\n\tgolang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd\n\tgolang.org/x/sys v0.0.0-20220111092808-5a964db01320\n\tgolang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11\n)\n\nrequire (\n\tgithub.com/golang/protobuf v1.4.2 // indirect\n\tgoogle.golang.org/protobuf v1.23.0 // indirect\n)\n",
"status_code": 200
}
}
|
TestFixModules
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestFixModules/mattermost.json
|
{
"github.com/mattermost/mattermost-server/@latest": {
"body": "{\"Version\":\"v9.9.1+incompatible\",\"Time\":\"2024-06-26T16:43:22Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/mattermost/mattermost-server\",\"Hash\":\"c758cecaf30c2dabaf31b7e38b6679c2a4552502\",\"Ref\":\"refs/tags/v9.9.1\"}}",
"status_code": 200
}
}
|
TestFixModules
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/report/testdata/proxy/TestFixModules/sort_major.json
|
{
"github.com/evmos/evmos/@latest": {
"body": "{\"Version\":\"v1.1.3\",\"Time\":\"2022-07-13T15:43:34Z\"}",
"status_code": 200
},
"github.com/evmos/evmos/v10/@latest": {
"body": "{\"Version\":\"v10.0.1\",\"Time\":\"2023-01-03T20:26:16Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/evmos/evmos\",\"Ref\":\"refs/tags/v10.0.1\",\"Hash\":\"f2180eb9bef3e957a0a327c4927dedfc93f9c80a\"}}",
"status_code": 200
},
"github.com/evmos/evmos/v11/@latest": {
"body": "{\"Version\":\"v11.0.2\",\"Time\":\"2023-02-10T16:47:56Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/evmos/evmos\",\"Ref\":\"refs/tags/v11.0.2\",\"Hash\":\"8eeeac7ae42a5b2695fea7f56868f3c6e9bc2378\"}}",
"status_code": 200
},
"github.com/evmos/evmos/v2/@latest": {
"body": "{\"Version\":\"v2.0.2\",\"Time\":\"2022-07-13T14:33:04Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/evmos/evmos\",\"Ref\":\"refs/tags/v2.0.2\",\"Hash\":\"dca9da1813b6173e5bc0ab779601793aef1f42ce\"}}",
"status_code": 200
},
"github.com/evmos/evmos/v3/@latest": {
"body": "{\"Version\":\"v3.0.3\",\"Time\":\"2022-07-13T14:33:19Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/evmos/evmos\",\"Ref\":\"refs/tags/v3.0.3\",\"Hash\":\"552555b2ea3c08a1c8b57b53f151436775ed61b7\"}}",
"status_code": 200
},
"github.com/evmos/evmos/v4/@latest": {
"body": "{\"Version\":\"v4.0.2\",\"Time\":\"2022-07-13T14:33:15Z\"}",
"status_code": 200
},
"github.com/evmos/evmos/v5/@latest": {
"body": "{\"Version\":\"v5.0.1\",\"Time\":\"2022-07-13T14:33:24Z\"}",
"status_code": 200
},
"github.com/evmos/evmos/v6/@latest": {
"body": "{\"Version\":\"v6.0.4\",\"Time\":\"2022-08-03T15:16:21Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/evmos/evmos\",\"Ref\":\"refs/tags/v6.0.4\",\"Hash\":\"6ce34e5c13e83e559628e625df53f53dfca57d06\"}}",
"status_code": 200
},
"github.com/evmos/evmos/v7/@latest": {
"body": "{\"Version\":\"v7.0.0\",\"Time\":\"2022-08-04T19:51:07Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/evmos/evmos\",\"Ref\":\"refs/tags/v7.0.0\",\"Hash\":\"a1c4b7af4cecd908d703a00bbb808c66ea61ab8a\"}}",
"status_code": 200
},
"github.com/evmos/evmos/v8/@latest": {
"body": "{\"Version\":\"v8.2.3\",\"Time\":\"2022-10-16T01:33:17Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/evmos/evmos\",\"Ref\":\"refs/tags/v8.2.3\",\"Hash\":\"1ca54a4e1c0812933960a9c943a7ab6c4901210d\"}}",
"status_code": 200
},
"github.com/evmos/evmos/v9/@latest": {
"body": "{\"Version\":\"v9.1.0\",\"Time\":\"2022-10-25T20:04:49Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/evmos/evmos\",\"Ref\":\"refs/tags/v9.1.0\",\"Hash\":\"80c38f659a65a983b221e2a568c6172b8ac3bffc\"}}",
"status_code": 200
},
"github.com/hashicorp/go-getter/@latest": {
"body": "{\"Version\":\"v1.7.5\",\"Time\":\"2024-06-21T21:06:48Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/hashicorp/go-getter\",\"Hash\":\"5a63fd9c0d5b8da8a6805e8c283f46f0dacb30b3\",\"Ref\":\"refs/tags/v1.7.5\"}}",
"status_code": 200
},
"github.com/hashicorp/go-getter/v2/@latest": {
"body": "{\"Version\":\"v2.2.2\",\"Time\":\"2024-05-17T13:52:29Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/hashicorp/go-getter\",\"Ref\":\"refs/tags/v2.2.2\",\"Hash\":\"035baf040a61a36387844b7ca0eeaa62d06d3265\"}}",
"status_code": 200
}
}
|
ghsa
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/ghsa/ghsa_test.go
|
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ghsa
import (
"context"
"flag"
"os"
"reflect"
"strings"
"testing"
"time"
)
var githubTokenFile = flag.String("ghtokenfile", "",
"path to file containing GitHub access token")
var githubToken = flag.String("ghtoken", os.Getenv("VULN_GITHUB_ACCESS_TOKEN"), "GitHub access token")
func mustGetAccessToken(t *testing.T) string {
var token string
switch {
case *githubToken != "":
token = *githubToken
case *githubTokenFile != "":
bytes, err := os.ReadFile(*githubTokenFile)
if err != nil {
t.Fatal(err)
}
token = string(bytes)
default:
t.Skip("neither -ghtokenfile nor -ghtoken provided")
}
return strings.TrimSpace(string(token))
}
func setupClient(ctx context.Context, t *testing.T) *Client {
t.Helper()
accessToken := mustGetAccessToken(t)
return NewClient(ctx, accessToken)
}
func TestList(t *testing.T) {
ctx := context.Background()
c := setupClient(ctx, t)
// There were at least three relevant SAs since this date.
since := time.Date(2022, 9, 1, 0, 0, 0, 0, time.UTC)
got, err := c.List(context.Background(), since)
if err != nil {
t.Fatal(err)
}
want := 3
if len(got) < want {
t.Errorf("got %d, want at least %d", len(got), want)
}
}
func TestFetchGHSA(t *testing.T) {
ctx := context.Background()
c := setupClient(ctx, t)
// Real GHSA that should be found.
const ghsaID string = "GHSA-g9mp-8g3h-3c5c"
got, err := c.FetchGHSA(context.Background(), ghsaID)
if err != nil {
t.Fatal(err)
}
if gotID, want := got.ID, ghsaID; gotID != want {
t.Errorf("got GHSA with id %q, want %q", got.ID, want)
}
}
func TestListForCVE(t *testing.T) {
ctx := context.Background()
c := setupClient(ctx, t)
tests := []struct {
name string
cve string
want []string
}{
{
name: "Real CVE/GHSA",
cve: "CVE-2022-27191",
want: []string{"GHSA-8c26-wmh5-6g9v"},
},
{
name: "Check exact matching",
cve: "CVE-2022-2529",
want: []string{"GHSA-9rpw-2h95-666c"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := c.ListForCVE(ctx, tt.cve)
if err != nil {
t.Errorf("ListForCVE() error = %v", err)
return
}
gotIDs := []string{}
for _, sa := range got {
gotIDs = append(gotIDs, sa.ID)
}
if !reflect.DeepEqual(gotIDs, tt.want) {
t.Errorf("ListForCVE() = %v, want %v", gotIDs, tt.want)
}
})
}
}
|
ghsa
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/ghsa/ghsa.go
|
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package ghsa supports GitHub security advisories.
package ghsa
import (
"context"
"fmt"
"time"
"github.com/shurcooL/githubv4"
"golang.org/x/oauth2"
)
// A SecurityAdvisory represents a GitHub security advisory.
type SecurityAdvisory struct {
// The GitHub Security Advisory identifier.
ID string
// A complete list of identifiers, e.g. CVE numbers.
Identifiers []Identifier
// A short description of the advisory.
Summary string
// A full description of the advisory.
Description string
// Where the advisory came from.
Origin string
// A link to a page for the advisory.
Permalink string
// When the advisory was first published.
PublishedAt time.Time
// References linked to by this advisory.
References []Reference
// When the advisory was last updated; should always be >= PublishedAt.
UpdatedAt time.Time
// The vulnerabilities associated with this advisory.
Vulns []*Vuln
}
// An Identifier identifies an advisory according to some scheme or
// organization, given by the Type field. Example types are GHSA and CVE.
type Identifier struct {
Type string
Value string
}
// A Reference is a URL linked to by the advisory.
type Reference struct {
URL string
}
// A Vuln represents a vulnerability.
type Vuln struct {
// The vulnerable Go package or module.
Package string
// The severity of the vulnerability.
Severity githubv4.SecurityAdvisorySeverity
// The earliest fixed version.
EarliestFixedVersion string
// A string representing the range of vulnerable versions.
// E.g. ">= 1.0.3"
VulnerableVersionRange string
// When the vulnerability was last updated.
UpdatedAt time.Time
}
// A gqlSecurityAdvisory represents a GitHub security advisory structured for
// GitHub's GraphQL schema. The fields must be exported to be populated by
// Github's Client.Query function.
type gqlSecurityAdvisory struct {
GhsaID string
Identifiers []Identifier
Summary string
Description string
Origin string
Permalink githubv4.URI
References []Reference
PublishedAt time.Time
UpdatedAt time.Time
Vulnerabilities struct {
Nodes []struct {
Package struct {
Name string
Ecosystem string
}
FirstPatchedVersion struct{ Identifier string }
Severity githubv4.SecurityAdvisorySeverity
UpdatedAt time.Time
VulnerableVersionRange string
}
PageInfo struct {
HasNextPage bool
}
} `graphql:"vulnerabilities(first: 100, ecosystem: $go)"` // include only Go vulns
}
// securityAdvisory converts a gqlSecurityAdvisory into a SecurityAdvisory.
// Errors if the security advisory was updated before it was published, or if
// there are more than 100 vulnerabilities associated with the advisory.
func (sa *gqlSecurityAdvisory) securityAdvisory() (*SecurityAdvisory, error) {
if sa.PublishedAt.After(sa.UpdatedAt) {
return nil, fmt.Errorf("%s: published at %s, after updated at %s", sa.GhsaID, sa.PublishedAt, sa.UpdatedAt)
}
if sa.Vulnerabilities.PageInfo.HasNextPage {
return nil, fmt.Errorf("%s has more than 100 vulns", sa.GhsaID)
}
var permalink string
if sa.Permalink.URL != nil {
permalink = sa.Permalink.URL.String()
}
s := &SecurityAdvisory{
ID: sa.GhsaID,
Identifiers: sa.Identifiers,
Summary: sa.Summary,
Description: sa.Description,
Origin: sa.Origin,
Permalink: permalink,
References: sa.References,
PublishedAt: sa.PublishedAt,
UpdatedAt: sa.UpdatedAt,
}
for _, v := range sa.Vulnerabilities.Nodes {
s.Vulns = append(s.Vulns, &Vuln{
Package: v.Package.Name,
Severity: v.Severity,
EarliestFixedVersion: v.FirstPatchedVersion.Identifier,
VulnerableVersionRange: v.VulnerableVersionRange,
UpdatedAt: v.UpdatedAt,
})
}
return s, nil
}
// Client is a client that can fetch data about GitHub security advisories.
type Client struct {
client *githubv4.Client
token string
}
// NewClient creates a new client for making requests to the GHSA API.
func NewClient(ctx context.Context, accessToken string) *Client {
ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: accessToken})
tc := oauth2.NewClient(ctx, ts)
return &Client{
client: githubv4.NewClient(tc),
token: accessToken,
}
}
// List returns all SecurityAdvisories that affect Go,
// published or updated since the given time.
func (c *Client) List(ctx context.Context, since time.Time) ([]*SecurityAdvisory, error) {
var query struct { // the GraphQL query
SAs struct {
Nodes []gqlSecurityAdvisory
PageInfo struct {
EndCursor githubv4.String
HasNextPage bool
}
} `graphql:"securityAdvisories(updatedSince: $since, first: 100, after: $cursor)"`
}
vars := map[string]any{
"cursor": (*githubv4.String)(nil),
"go": githubv4.SecurityAdvisoryEcosystemGo,
"since": githubv4.DateTime{Time: since},
}
var sas []*SecurityAdvisory
// We need a loop to page through the list. The GitHub API limits us to 100
// values per call.
for {
if err := c.client.Query(ctx, &query, vars); err != nil {
return nil, err
}
for _, sa := range query.SAs.Nodes {
if len(sa.Vulnerabilities.Nodes) == 0 {
continue
}
s, err := sa.securityAdvisory()
if err != nil {
return nil, err
}
sas = append(sas, s)
}
if !query.SAs.PageInfo.HasNextPage {
break
}
vars["cursor"] = githubv4.NewString(query.SAs.PageInfo.EndCursor)
}
return sas, nil
}
func (c *Client) ListForCVE(ctx context.Context, cve string) ([]*SecurityAdvisory, error) {
var query struct { // The GraphQL query
SAs struct {
Nodes []gqlSecurityAdvisory
PageInfo struct {
EndCursor githubv4.String
HasNextPage bool
}
} `graphql:"securityAdvisories(identifier: $id, first: 100)"`
}
vars := map[string]any{
"id": githubv4.SecurityAdvisoryIdentifierFilter{
Type: githubv4.SecurityAdvisoryIdentifierTypeCve,
Value: githubv4.String(cve),
},
"go": githubv4.SecurityAdvisoryEcosystemGo,
}
if err := c.client.Query(ctx, &query, vars); err != nil {
return nil, err
}
if query.SAs.PageInfo.HasNextPage {
return nil, fmt.Errorf("CVE %s has more than 100 GHSAs", cve)
}
var sas []*SecurityAdvisory
for _, sa := range query.SAs.Nodes {
if len(sa.Vulnerabilities.Nodes) == 0 {
continue
}
exactMatch := false
for _, id := range sa.Identifiers {
if id.Type == "CVE" && id.Value == cve {
exactMatch = true
continue
}
}
if !exactMatch {
continue
}
s, err := sa.securityAdvisory()
if err != nil {
return nil, err
}
sas = append(sas, s)
}
return sas, nil
}
// FetchGHSA returns the SecurityAdvisory for the given Github Security
// Advisory ID.
func (c *Client) FetchGHSA(ctx context.Context, ghsaID string) (_ *SecurityAdvisory, err error) {
var query struct {
SA gqlSecurityAdvisory `graphql:"securityAdvisory(ghsaId: $id)"`
}
vars := map[string]any{
"id": githubv4.String(ghsaID),
"go": githubv4.SecurityAdvisoryEcosystemGo,
}
if err := c.client.Query(ctx, &query, vars); err != nil {
return nil, err
}
return query.SA.securityAdvisory()
}
|
ghsa
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/ghsa/ghsa2report.go
|
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ghsa
import (
"context"
"fmt"
"strings"
"golang.org/x/vulndb/internal/report"
)
var _ report.Source = &SecurityAdvisory{}
func (sa *SecurityAdvisory) ToReport(modulePath string) *report.Report {
return ghsaToReport(sa, modulePath)
}
func (sa *SecurityAdvisory) SourceID() string {
return sa.ID
}
var _ report.Fetcher = &Client{}
func (c *Client) Fetch(ctx context.Context, id string) (report.Source, error) {
return c.FetchGHSA(ctx, id)
}
// ghsaToReport creates a Report struct from a given GHSA SecurityAdvisory and modulePath.
func ghsaToReport(sa *SecurityAdvisory, modulePath string) *report.Report {
r := &report.Report{
Summary: report.Summary(sa.Summary),
Description: report.Description(sa.Description),
}
var cves, ghsas []string
for _, id := range sa.Identifiers {
switch id.Type {
case "CVE":
cves = append(cves, id.Value)
case "GHSA":
ghsas = append(ghsas, id.Value)
}
}
for _, ref := range sa.References {
r.References = append(r.References, report.ReferenceFromUrl(ref.URL))
}
r.CVEs = cves
r.GHSAs = ghsas
for _, v := range sa.Vulns {
if modulePath == "" {
modulePath = v.Package
}
m := &report.Module{
Module: modulePath,
Versions: versions(v.EarliestFixedVersion, v.VulnerableVersionRange),
Packages: []*report.Package{{
Package: v.Package,
}},
}
r.Modules = append(r.Modules, m)
}
return r
}
// versions extracts the versions in which a vulnerability was introduced and
// fixed from a Github Security Advisory's EarliestFixedVersion and
// VulnerableVersionRange fields, and wraps them in a []VersionRange.
//
// If the vulnRange cannot be parsed, or the earliestFixed and vulnRange are
// incompatible, populate the relevant fields with a TODO for a human to handle.
func versions(earliestFixed, vulnRange string) report.Versions {
// Don't try to be fully general here. Handle the common cases (which, as of
// March 2022, are the only cases), and let a person handle the others.
items, err := parseVulnRange(vulnRange)
if err != nil {
return report.Versions{
report.Introduced(fmt.Sprintf("TODO (got error %q)", err)),
}
}
var intro, fixed string
// Most common case: a single "<" item with a version that matches earliestFixed.
if len(items) == 1 && items[0].op == "<" && items[0].version == earliestFixed {
intro = "0.0.0"
fixed = earliestFixed
}
// Two items, one >= and one <, with the latter matching earliestFixed.
if len(items) == 2 && items[0].op == ">=" && items[1].op == "<" && items[1].version == earliestFixed {
intro = items[0].version
fixed = earliestFixed
}
// A single "<=" item with no fixed version.
if len(items) == 1 && items[0].op == "<=" && earliestFixed == "" {
intro = "0.0.0"
}
if intro == "" {
intro = fmt.Sprintf("TODO (earliest fixed %q, vuln range %q)", earliestFixed, vulnRange)
}
// Unset intro if vuln was always present.
if intro == "0.0.0" {
intro = ""
}
var result report.Versions
if intro != "" {
result = append(result, report.Introduced(intro))
}
if fixed != "" {
result = append(result, report.Fixed(fixed))
}
return result
}
type vulnRangeItem struct {
op, version string
}
// parseVulnRange splits the contents of a GitHub Security Advisory's
// VulnerableVersionRange field into separate items.
func parseVulnRange(s string) ([]vulnRangeItem, error) {
// A GHSA vuln range is a comma-separated list of items of the form "OP VERSION"
// where OP is one of "<", ">", "<=" or ">=" and VERSION is a semantic
// version.
var items []vulnRangeItem
parts := strings.Split(s, ",")
for _, p := range parts {
p = strings.TrimSpace(p)
if p == "" {
continue
}
before, after, found := strings.Cut(p, " ")
if !found {
return nil, fmt.Errorf("invalid vuln range item %q", p)
}
items = append(items, vulnRangeItem{strings.TrimSpace(before), strings.TrimSpace(after)})
}
return items, nil
}
|
ghsa
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/ghsa/ghsa2report_test.go
|
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ghsa
import (
"flag"
"testing"
"time"
"github.com/google/go-cmp/cmp"
"golang.org/x/vulndb/internal/proxy"
"golang.org/x/vulndb/internal/report"
)
var (
realProxy = flag.Bool("proxy", false, "if true, contact the real module proxy and update expected responses")
)
var testTime = time.Date(1999, 1, 1, 0, 0, 0, 0, time.UTC)
func TestGHSAToReport(t *testing.T) {
updatedTime := time.Date(2022, 01, 01, 01, 01, 00, 00, time.UTC)
sa := &SecurityAdvisory{
ID: "G1_blah",
Identifiers: []Identifier{{Type: "GHSA", Value: "G1"}, {Type: "CVE", Value: "C1"}},
UpdatedAt: updatedTime,
Permalink: "https://github.com/permalink/to/G1",
Description: "a description",
Vulns: []*Vuln{{
Package: "golang.org/x/tools/go/packages",
EarliestFixedVersion: "0.9.0",
VulnerableVersionRange: "< 0.9.0",
}},
References: []Reference{{URL: "https://github.com/permalink/to/issue/12345"}},
}
pc, err := proxy.NewTestClient(t, *realProxy)
if err != nil {
t.Fatal(err)
}
for _, test := range []struct {
name string
module string
reviewStatus report.ReviewStatus
want *report.Report
}{
{
name: "module provided",
module: "golang.org/x/tools",
reviewStatus: report.Reviewed,
want: &report.Report{
ID: report.PendingID,
Modules: []*report.Module{{
Module: "golang.org/x/tools",
VulnerableAt: report.VulnerableAt("0.8.0"),
Versions: report.Versions{
report.Fixed("0.9.0"),
},
Packages: []*report.Package{{
Package: "golang.org/x/tools/go/packages",
}},
}},
Summary: "C1 in golang.org/x/tools",
Description: "a description",
GHSAs: []string{"G1"},
CVEs: []string{"C1"},
References: []*report.Reference{{Type: "REPORT", URL: "https://github.com/permalink/to/issue/12345"}},
SourceMeta: &report.SourceMeta{
ID: "G1_blah",
Created: &testTime,
},
ReviewStatus: report.Reviewed,
},
},
{
name: "empty module attempts to find module from package",
module: "",
reviewStatus: report.Reviewed,
want: &report.Report{
ID: report.PendingID,
Modules: []*report.Module{{
Module: "golang.org/x/tools",
Versions: report.Versions{
report.Fixed("0.9.0"),
},
VulnerableAt: report.VulnerableAt("0.8.0"),
Packages: []*report.Package{{
Package: "golang.org/x/tools/go/packages",
},
{
Package: "golang.org/x/tools/go/packages",
}},
}},
Summary: "C1 in golang.org/x/tools",
Description: "a description",
GHSAs: []string{"G1"},
CVEs: []string{"C1"},
References: []*report.Reference{{Type: "REPORT", URL: "https://github.com/permalink/to/issue/12345"}},
SourceMeta: &report.SourceMeta{
ID: "G1_blah",
Created: &testTime,
},
ReviewStatus: report.Reviewed,
},
},
} {
test := test
t.Run(test.name, func(t *testing.T) {
got := report.New(sa, pc, report.WithModulePath(test.module),
report.WithCreated(testTime), report.WithReviewStatus(test.reviewStatus))
if diff := cmp.Diff(*got, *test.want); diff != "" {
t.Errorf("mismatch (-want, +got):\n%s", diff)
}
})
}
}
func TestParseVulnRange(t *testing.T) {
for _, test := range []struct {
in string
want []vulnRangeItem
}{
{"", nil},
{"< 1.2.3", []vulnRangeItem{{"<", "1.2.3"}}},
{"< 4.3.2, >= 1.2.3", []vulnRangeItem{
{"<", "4.3.2"},
{">=", "1.2.3"},
}},
} {
got, err := parseVulnRange(test.in)
if err != nil {
t.Fatal(err)
}
if !cmp.Equal(got, test.want, cmp.AllowUnexported(vulnRangeItem{})) {
t.Errorf("%q:\ngot %+v\nwant %+v", test.in, got, test.want)
}
}
}
func TestVersions(t *testing.T) {
for _, test := range []struct {
earliestFixed string
vulnRange string
want report.Versions
}{
{"1.0.0", "< 1.0.0", report.Versions{report.Fixed("1.0.0")}},
{"", "<= 1.4.2", nil},
{
"1.1.3", ">= 1.1.0, < 1.1.3",
report.Versions{report.Introduced("1.1.0"), report.Fixed("1.1.3")},
},
{
"1.2.3", "<= 2.3.4",
report.Versions{report.Introduced(`TODO (earliest fixed "1.2.3", vuln range "<= 2.3.4")`)},
},
} {
got := versions(test.earliestFixed, test.vulnRange)
want := test.want
if !cmp.Equal(got, want) {
t.Errorf("%q, %q:\ngot %+v\nwant %+v",
test.earliestFixed, test.vulnRange, got, want)
}
}
}
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/ghsa/testdata/proxy/TestGHSAToReport.json
|
{
"golang.org/x/tools/@latest": {
"body": "{\"Version\":\"v0.22.0\",\"Time\":\"2024-06-04T17:56:46Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/tools\",\"Ref\":\"refs/tags/v0.22.0\",\"Hash\":\"bc6931db37c33e064504346d9259b3b6d20e13f6\"}}",
"status_code": 200
},
"golang.org/x/tools/@v/list": {
"body": "v0.15.0\nv0.1.4\nv0.9.3\nv0.7.0\nv0.1.12\nv0.1.3\nv0.9.2\nv0.3.0\nv0.8.0\nv0.6.0\nv0.10.0\nv0.20.0\nv0.1.9\nv0.5.0\nv0.22.0\nv0.18.0\nv0.1.7\nv0.21.0\nv0.1.10\nv0.12.0\nv0.1.6\nv0.19.0\nv0.1.2\nv0.9.0\nv0.1.11\nv0.4.0\nv0.1.8\nv0.14.0\nv0.11.0\nv0.1.0\nv0.1.5\nv0.9.1\nv0.1.1\nv0.11.1\nv0.16.1\nv0.13.0\nv0.17.0\nv0.2.0\nv0.16.0\n",
"status_code": 200
},
"golang.org/x/tools/@v/v0.9.0.mod": {
"body": "module golang.org/x/tools\n\ngo 1.18 // tagx:compat 1.16\n\nrequire (\n\tgithub.com/yuin/goldmark v1.4.13\n\tgolang.org/x/mod v0.10.0\n\tgolang.org/x/net v0.10.0\n\tgolang.org/x/sys v0.8.0\n)\n\nrequire golang.org/x/sync v0.2.0\n",
"status_code": 200
},
"golang.org/x/tools/go/@latest": {
"status_code": 404
},
"golang.org/x/tools/go/@v/list": {
"status_code": 404
},
"golang.org/x/tools/go/packages/@latest": {
"status_code": 404
},
"golang.org/x/tools/go/packages/@v/list": {
"status_code": 404
}
}
|
cve4
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/report.go
|
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cve4
import (
"golang.org/x/vulndb/internal/report"
"golang.org/x/vulndb/internal/stdlib"
)
var _ report.Source = &CVE{}
func (c *CVE) ToReport(modulePath string) *report.Report {
return cveToReport(c, modulePath)
}
func (c *CVE) SourceID() string {
return c.ID
}
func (c *CVE) ReferenceURLs() []string {
var result []string
for _, r := range c.References.Data {
result = append(result, r.URL)
}
return result
}
// cveToReport creates a Report struct from a given CVE and modulePath.
func cveToReport(c *CVE, modulePath string) *report.Report {
var description report.Description
for _, d := range c.Description.Data {
description += report.Description(d.Value + "\n")
}
var refs []*report.Reference
for _, r := range c.References.Data {
refs = append(refs, report.ReferenceFromUrl(r.URL))
}
var credits []string
for _, v := range c.Credit.Data.Description.Data {
credits = append(credits, v.Value)
}
var pkgPath string
if data := c.Affects.Vendor.Data; len(data) > 0 {
if data2 := data[0].Product.Data; len(data2) > 0 {
pkgPath = data2[0].ProductName
}
}
if stdlib.Contains(modulePath) {
pkgPath = modulePath
modulePath = stdlib.ModulePath
}
if modulePath == "" {
modulePath = "TODO"
}
if pkgPath == "" {
pkgPath = modulePath
}
r := &report.Report{
Modules: []*report.Module{{
Module: modulePath,
Packages: []*report.Package{{
Package: pkgPath,
}},
}},
Description: description,
Credits: credits,
References: refs,
}
r.AddCVE(c.Metadata.ID, getCWE(c), isGoCNA(c))
return r
}
func getCWE(c *CVE) string {
if len(c.ProblemType.Data) == 0 || len(c.ProblemType.Data[0].Description) == 0 {
return ""
}
return c.ProblemType.Data[0].Description[0].Value
}
func isGoCNA(c *CVE) bool {
return c.Assigner == "security@golang.org"
}
|
cve4
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/cveschema_test.go
|
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cve4
import (
"encoding/json"
"testing"
"github.com/google/go-cmp/cmp"
)
func TestDecodeCVE(t *testing.T) {
for _, test := range []struct {
name string
json string
want *CVE
}{
{"full 2017", json1, want1},
{"LangString credit", json2, want2},
{"CreditData credit", json3, want3},
} {
t.Run(test.name, func(t *testing.T) {
var got *CVE
if err := json.Unmarshal([]byte(test.json), &got); err != nil {
t.Fatal(err)
}
if diff := cmp.Diff(test.want, got); diff != "" {
t.Errorf("mismatch (-want, +got):\n%s", diff)
}
})
}
}
// A full CVE record from 2017, with a Credit field that is a list of strings.
const json1 = `
{
"CVE_data_meta": {
"ASSIGNER": "security@kubernetes.io",
"DATE_ASSIGNED": "2017-12-06",
"ID": "CVE-2017-1002101",
"STATE": "PUBLIC"
},
"affects": {
"vendor": {
"vendor_data": [
{
"product": {
"product_data": [
{
"product_name": "Kubernetes",
"version": {
"version_data": [
{
"version_affected": "=",
"version_value": "v1.3.x"
},
{
"version_affected": "=",
"version_value": "v1.4.x"
},
{
"version_affected": "=",
"version_value": "v1.5.x"
},
{
"version_affected": "=",
"version_value": "v1.6.x"
},
{
"version_affected": "<",
"version_value": "v1.7.14"
},
{
"version_affected": "<",
"version_value": "v1.8.9"
},
{
"version_affected": "<",
"version_value": "v1.9.4"
}
]
}
}
]
},
"vendor_name": "Kubernetes"
}
]
}
},
"credit": [
"Reported by Maxim Ivanov"
],
"data_format": "MITRE",
"data_type": "CVE",
"data_version": "4.0",
"description": {
"description_data": [
{
"lang": "eng",
"value": "In Kubernetes versions 1.3.x, 1.4.x, 1.5.x, 1.6.x and prior to versions 1.7.14, 1.8.9 and 1.9.4 containers using subpath volume mounts with any volume type (including non-privileged pods, subject to file permissions) can access files/directories outside of the volume, including the host's filesystem."
}
]
},
"impact": {
"cvss": {
"attackComplexity": "LOW",
"attackVector": "NETWORK",
"availabilityImpact": "HIGH",
"baseScore": 8.8,
"baseSeverity": "HIGH",
"confidentialityImpact": "HIGH",
"integrityImpact": "HIGH",
"privilegesRequired": "LOW",
"scope": "UNCHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"version": "3.0"
}
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "handled symbolic links insecurely"
}
]
}
]
},
"references": {
"reference_data": [
{
"name": "RHSA-2018:0475",
"refsource": "REDHAT",
"url": "https://access.redhat.com/errata/RHSA-2018:0475"
},
{
"name": "https://github.com/kubernetes/kubernetes/issues/60813",
"refsource": "CONFIRM",
"url": "https://github.com/kubernetes/kubernetes/issues/60813"
},
{
"name": "https://github.com/bgeesaman/subpath-exploit/",
"refsource": "MISC",
"url": "https://github.com/bgeesaman/subpath-exploit/"
},
{
"refsource": "SUSE",
"name": "openSUSE-SU-2020:0554",
"url": "http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00041.html"
}
]
}
}
`
var want1 = &CVE{
Metadata: Metadata{
Assigner: "security@kubernetes.io",
ID: "CVE-2017-1002101",
State: "PUBLIC",
},
DataType: "CVE",
DataFormat: "MITRE",
DataVersion: "4.0",
Affects: Affects{
Vendor: Vendor{
Data: []VendorDataItem{
{
VendorName: "Kubernetes",
Product: Product{
Data: []ProductDataItem{
{
ProductName: "Kubernetes",
Version: VersionData{
Data: []VersionDataItem{
{VersionValue: "v1.3.x", VersionAffected: "="},
{VersionValue: "v1.4.x", VersionAffected: "="},
{VersionValue: "v1.5.x", VersionAffected: "="},
{VersionValue: "v1.6.x", VersionAffected: "="},
{VersionValue: "v1.7.14", VersionAffected: "<"},
{VersionValue: "v1.8.9", VersionAffected: "<"},
{VersionValue: "v1.9.4", VersionAffected: "<"},
},
},
},
},
},
},
},
},
},
Description: Description{
Data: []LangString{
{
Lang: "eng",
Value: `In Kubernetes versions 1.3.x, 1.4.x, 1.5.x, 1.6.x and prior to versions 1.7.14, 1.8.9 and 1.9.4 containers using subpath volume mounts with any volume type (including non-privileged pods, subject to file permissions) can access files/directories outside of the volume, including the host's filesystem.`,
},
},
},
ProblemType: ProblemType{
Data: []ProblemTypeDataItem{
{Description: []LangString{
{Lang: "eng", Value: "handled symbolic links insecurely"},
}},
},
},
References: References{
Data: []Reference{
{URL: "https://access.redhat.com/errata/RHSA-2018:0475"},
{URL: "https://github.com/kubernetes/kubernetes/issues/60813"},
{URL: "https://github.com/bgeesaman/subpath-exploit/"},
{URL: "http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00041.html"},
},
},
Credit: Credit{
Data: CreditData{
Description: Description{
Data: []LangString{{Lang: "eng", Value: "Reported by Maxim Ivanov"}},
},
},
},
}
// A pared-down record, whose Credit field is a list of LangStrings.
const json2 = `
{
"CVE_data_meta": {
"ID": "CVE-2021-0204"
},
"credit": [
{
"lang": "eng",
"value": "Juniper SIRT would like to acknowledge..."
}
]
}
`
var want2 = &CVE{
Metadata: Metadata{
ID: "CVE-2021-0204",
},
Credit: Credit{
Data: CreditData{
Description: Description{
Data: []LangString{{Lang: "eng", Value: "Juniper SIRT would like to acknowledge..."}},
},
},
},
}
// Another simplified record, whose Credit field is a CreditData.
const json3 = `
{
"CVE_data_meta": {
"ID": "CVE-2021-28711"
},
"credit": {
"credit_data": {
"description": {
"description_data": [
{
"lang": "eng",
"value": "This issue was discovered by..."
}
]
}
}
}
}
`
var want3 = &CVE{
Metadata: Metadata{
ID: "CVE-2021-28711",
},
Credit: Credit{
Data: CreditData{
Description: Description{
Data: []LangString{{Lang: "eng", Value: "This issue was discovered by..."}},
},
},
},
}
|
cve4
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/cveschema.go
|
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// package cve4 contains the schema for a CVE, as derived from
// https://github.com/CVEProject/automation-working-group/tree/master/cve_json_schema.
package cve4
import (
"bytes"
"encoding/json"
"errors"
"golang.org/x/vulndb/internal/derrors"
)
const (
// StateReserved is the initial state for a CVE Record; when the associated
// CVE ID is Reserved by a CNA.
StateReserved = "RESERVED"
// StatePublic is when a CNA populates the data associated with a CVE ID
// as a CVE Record, the state of the CVE Record is PUBLIC. The
// associated data must contain an identification number (CVE ID), a prose
// description, and at least one public reference.
StatePublic = "PUBLIC"
// StateRejected is when the CVE ID and associated CVE Record should no
// longer be used, the CVE Record is placed in the REJECT state. A Rejected
// CVE Record remains on the CVE List so that users can know when it is
// invalid.
StateRejected = "REJECT"
)
// CVE represents a "Common Vulnerabilities and Exposures" record, which is
// associated with a CVE ID and provided by a CNA.
//
// A CVE corresponds to a flaw in a software, firmware, hardware, or service
// component resulting from a weakness that can be exploited, causing a negative
// impact to the confidentiality, integrity, or availability of an impacted
// component or components.
type CVE struct {
// Metadata is metadata about the CVE ID such as the CVE ID, who
// requested it, who assigned it, when it was requested, when it was assigned,
// the current state (PUBLIC, REJECT, etc.) and so on.
Metadata `json:"CVE_data_meta"`
// DataType identifies what kind of data is held in this JSON file. This is
// mandatory and designed to prevent problems with attempting to detect
// what kind of file this is. Valid values for this string are CVE, CNA,
// CVEMENTOR.
DataType string `json:"data_type"`
// DataFormat identifies what data format is used in this JSON file. This
// is mandatory and designed to prevent problems with attempting to detect
// what format of data is used. Valid values for this string are MITRE, it can
// also be user defined (e.g. for internal use).
DataFormat string `json:"data_format"`
// DataVersion identifies which version of the data format is in use. This
// is mandatory and designed to prevent problems with attempting to detect
// what format of data is used.
DataVersion string `json:"data_version"`
// Affects is the root level container for affected vendors and in turn
// their affected technologies, products, hardware, etc. It only goes in
// the root level.
Affects Affects `json:"affects"`
// Description is a description of the issue. It can exist in the root
// level or within virtually any other container, the intent being that for
// example different products, and configurations may result in different
// impacts and thus descriptions of the issue.
Description Description `json:"description"`
// ProblemType is problem type information (e.g. CWE identifier).
ProblemType ProblemType `json:"problemtype"`
// References is reference data in the form of URLs or file objects
// (uuencoded and embedded within the JSON file, exact format to be
// decided, e.g. we may require a compressed format so the objects require
// unpacking before they are "dangerous").
References References `json:"references"`
// Credit is the credit information (different than CVE_timeline in that
// these are specific things being credited to specific
// people/organizations/etc.).
Credit Credit `json:"-"`
// RawCredit is for unmarshaling only. Do not use.
RawCredit json.RawMessage `json:"credit"`
}
// Credit is the credit information (different than CVE_timeline in that these
// are specific things being credited to specific people/organizations/etc.).
type Credit struct {
Data CreditData `json:"credit_data"`
}
type CreditData struct {
Description Description `json:"description"`
}
// Metadata is meta data about the CVE ID such as the CVE ID, who requested
// it, who assigned it, when it was requested, when it was assigned, the
// current state (PUBLIC, REJECT, etc.) and so on.
type Metadata struct {
Assigner string `json:"ASSIGNER"`
ID string `json:"ID"`
State string `json:"STATE"`
}
// Affects is the root level container for affected vendors and in turn their
// affected technologies, products, hardware, etc. It only goes in the root
// level.
type Affects struct {
Vendor Vendor `json:"vendor"`
}
// Description is a description of the issue. It can exist in the root level or
// within virtually any other container, the intent being that for example
// different products, and configurations may result in different impacts and
// thus descriptions of the issue.
//
// The description could include:
//
// An explanation of an attack type using the vulnerability;
// The impact of the vulnerability;
// The software components within a software product that are affected by the
// vulnerability; and
// Any attack vectors that can make use of the vulnerability.
//
// Descriptions often follow this template:
//
// [PROBLEM TYPE] in [PRODUCT/VERSION] causes [IMPACT] when [ATTACK]
//
// where impact and attack are arbitrary terms that should be relevant to the
// nature of the vulnerability.
type Description struct {
Data []LangString `json:"description_data"`
}
// ProblemType is problem type information (e.g. CWE identifier).
//
// It can include an arbitrary summary of the problem, though Common Weakness
// Enumerations (CWEs) are a standard to use in this field.
type ProblemType struct {
Data []ProblemTypeDataItem `json:"problemtype_data"`
}
// A ProblemTypeDataItem is an entry in ProblemType.Data.
type ProblemTypeDataItem struct {
Description []LangString `json:"description"`
}
// LangString is a JSON data type containing the language that a description is
// written in and the text string.
type LangString struct {
Lang string `json:"lang"`
Value string `json:"value"`
}
// References is reference data in the form of URLs or file objects (uuencoded
// and embedded within the JSON file, exact format to be decided, e.g. we may
// require a compressed format so the objects require unpacking before they are
// "dangerous").
type References struct {
Data []Reference `json:"reference_data"`
}
// A reference is a URL pointing to a world-wide-web-based resource. For
// CSV and flat-file formats, they should be separated by a space. References
// should point to content that is relevant to the vulnerability and include at
// least all the details included in the CVE entry. Ideally, references should
// point to content that includes the CVE ID itself whenever possible. References
// must also be publicly available, as described in Section 2.1.1 of the CVE
// Numbering Authorities (CNA) Rules.
type Reference struct {
URL string `json:"url"`
}
// Vendor is the container for affected vendors, it only goes in the affects
// container.
type Vendor struct {
// Data is an array of version values (vulnerable and not); we use an
// array so that different entities can make statements about the same
// vendor and they are separate (if we used a JSON object we'd essentially
// be keying on the vendor name and they would have to overlap). Also this
// allows things like data_version or description to be applied directly to
// the vendor entry.
Data []VendorDataItem `json:"vendor_data"`
}
// A VendorDataItem represents a single vendor name and product.
type VendorDataItem struct {
Product Product `json:"product"`
VendorName string `json:"vendor_name"`
}
// Product is the container for affected technologies, products, hardware, etc.
//
// As a general guideline, the product should include the vendor, developer, or
// project name as well as the name of the actual software or hardware in which
// the vulnerability exists.
type Product struct {
// Data is an array of version values (vulnerable and not); we use
// an array so that we can make multiple statements about the same product and
// they are separate (if we used a JSON object we'd essentially be keying on
// the product name and they would have to overlap). Also this allows things
// like data_version or description to be applied directly to the product
// entry.
Data []ProductDataItem `json:"product_data"`
}
// ProductDataItem represents a single product name and version that belongs to
// a product container.
type ProductDataItem struct {
ProductName string `json:"product_name"`
Version VersionData `json:"version"`
}
// VersionData is an array of version values (vulnerable and not); we use an
// array so that we can make multiple statements about the same version and they
// are separate (if we used a JSON object we'd essentially be keying on the
// version name/number and they would have to overlap). Also this allows things
// like data_version or description to be applied directly to the product entry.
// This also allows more complex statements such as "Product X between versions
// 10.2 and 10.8" to be put in a machine-readable format. As well since multiple
// statements can be used multiple branches of the same product can be defined
// here.
type VersionData struct {
Data []VersionDataItem `json:"version_data"`
}
// A VersionDataItem represents a version, the date of release, or whatever
// indicator that is used by vendors, developers, or projects to differentiate
// between releases. The version can be described with specific version
// numbers, ranges of versions, or “all versions before/after” a version number or
// date.
type VersionDataItem struct {
VersionValue string `json:"version_value"`
VersionAffected string `json:"version_affected"`
}
var nullBytes = []byte("null")
// UnmarshalJSON implements json.Unmarshaler.
func (c *CVE) UnmarshalJSON(data []byte) (err error) {
defer derrors.Wrap(&err, "cve4.CVE.UnmarshalJSON")
if bytes.Equal(data, nullBytes) {
return nil
}
// To avoid infinite recursion, disable the UnmarshalJSON method on CVE
// by defining a new type.
type nomethod CVE
if err := json.Unmarshal(data, (*nomethod)(c)); err != nil {
return err
}
c.Credit, err = decodeCredit(c.RawCredit)
if err != nil {
return err
}
c.RawCredit = nil
return nil
}
// The Credit field can have one of several formats.
func decodeCredit(raw []byte) (Credit, error) {
if len(raw) == 0 {
return Credit{}, nil
}
var c Credit
if err := json.Unmarshal(raw, &c); err == nil {
return c, nil
}
var lstrings []LangString
if err := json.Unmarshal(raw, &lstrings); err == nil {
return Credit{Data: CreditData{Description: Description{Data: lstrings}}}, nil
}
var strings []string
if err := json.Unmarshal(raw, &strings); err == nil {
var ls []LangString
for _, s := range strings {
ls = append(ls, LangString{Lang: "eng", Value: s})
}
return Credit{Data: CreditData{Description: Description{Data: ls}}}, nil
}
var str string
if err := json.Unmarshal(raw, &str); err == nil {
return Credit{
Data: CreditData{
Description: Description{
Data: []LangString{{Lang: "eng", Value: str}},
},
},
}, nil
}
return Credit{}, errors.New("could not parse credit field")
}
|
cve4
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/report_test.go
|
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cve4
import (
"context"
"flag"
"testing"
"golang.org/x/vulndb/internal/cvelistrepo"
)
var (
updateTxtarRepo = flag.Bool("update-repo", false, "update the test repo (cvelist.txtar) with real CVE data - this takes a while")
update = flag.Bool("update", false, "update golden files")
realProxy = flag.Bool("proxy", false, "if true, contact the real module proxy and update expected responses")
)
func TestToReport(t *testing.T) {
if *updateTxtarRepo {
cvelistrepo.UpdateTxtar(context.Background(), t, cvelistrepo.URLv4)
}
if err := cvelistrepo.TestToReport[*CVE](t, *update, *realProxy); err != nil {
t.Fatal(err)
}
}
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/testdata/proxy/TestCVEToReport.json
|
{
"github.com/!consensys/gnark/@latest": {
"body": "{\"Version\":\"v0.9.1\",\"Time\":\"2023-10-16T18:27:07Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/Consensys/gnark\",\"Ref\":\"refs/tags/v0.9.1\",\"Hash\":\"3421eaa7d544286abf3de8c46282b8d4da6d5da0\"}}",
"status_code": 200
},
"github.com/!consensys/gnark/@v/list": {
"body": "v0.2.0-alpha\nv0.7.0\nv0.8.1\nv0.3.8\nv0.3.0\nv0.5.2\nv0.3.6\nv0.6.1\nv0.3.4\nv0.8.0\nv0.6.0\nv0.3.7\nv0.6.2\nv0.5.0\nv0.3.5\nv0.2.1-alpha\nv0.3.3\nv0.9.0\nv0.6.5\nv0.4.0\nv0.5.1\nv0.3.1\nv0.7.1\nv0.9.1\nv0.6.3\nv0.3.0-alpha\nv0.9.0-alpha\nv0.1.0-alpha\nv0.6.4\n",
"status_code": 200
},
"github.com/go-resty/resty/v2/@latest": {
"body": "{\"Version\":\"v2.12.0\",\"Time\":\"2024-03-17T20:50:19Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/go-resty/resty\",\"Ref\":\"refs/tags/v2.12.0\",\"Hash\":\"89d25d9d1aed90c422d5dd816e6788ac4e893def\"}}",
"status_code": 200
},
"github.com/go-resty/resty/v2/@v/list": {
"body": "v2.3.0\nv2.2.0\nv2.9.1\nv2.6.0\nv2.0.0-rc.3\nv2.3.0-rc.1\nv2.0.0-rc.1\nv2.0.0-rc.4\nv2.0.0\nv2.4.0\nv2.10.0-rc.1\nv2.12.0\nv2.8.0\nv2.7.0\nv2.10.0-rc.3\nv2.1.0\nv2.10.0\nv2.11.0\nv2.9.0\nv2.0.0-rc.2\nv2.3.0-rc.2\nv2.5.0\nv2.10.0-rc.2\n",
"status_code": 200
},
"github.com/gofiber/fiber/@latest": {
"body": "{\"Version\":\"v1.14.6\",\"Time\":\"2020-09-11T18:56:02Z\"}",
"status_code": 200
},
"github.com/gofiber/fiber/@v/list": {
"body": "v1.9.0\nv1.0.2\nv1.14.1\nv1.7.0\nv1.13.3\nv1.2.3\nv0.9.3\nv0.7.0\nv0.8.1\nv1.9.6\nv1.13.1\nv1.8.0\nv1.6.0\nv1.4.2\nv1.12.0-alpha\nv1.0.0\nv1.14.0\nv0.8.0\nv1.8.3\nv1.12.0\nv1.4.3\nv0.6.9\nv1.3.3\nv1.14.4\nv1.14.5\nv1.8.2\nv1.12.6\nv1.12.1\nv1.3.1\nv1.5.0\nv1.14.6\nv1.3.4\nv1.7.1\nv1.4.1\nv1.8.31\nv1.14.3\nv1.9.1\nv1.12.3\nv1.10.0\nv0.9.0\nv1.11.0\nv1.4.4\nv1.12.5\nv1.10.2\nv1.9.4\nv1.3.2\nv1.9.3\nv1.4.0\nv0.9.1\nv1.2.0\nv1.13.2\nv1.12.2\nv1.6.1\nv1.12.4\nv1.10.1\nv1.8.32\nv1.8.33\nv1.8.43\nv1.10.5\nv1.0.1-beta\nv1.9.2\nv1.13.0\nv1.9.5\nv1.8.1\nv1.10.3\nv1.14.2\nv1.0.1\nv1.1.0\nv1.11.1\nv1.8.4\nv1.8.41\nv1.8.42\nv1.8.431\n",
"status_code": 200
},
"github.com/pandatix/go-cvss/@latest": {
"body": "{\"Version\":\"v0.6.2\",\"Time\":\"2023-10-29T09:33:31Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/pandatix/go-cvss\",\"Ref\":\"refs/tags/v0.6.2\",\"Hash\":\"c469bad96b51674ff275fa1a76fcd9fa409c180a\"}}",
"status_code": 200
},
"github.com/pandatix/go-cvss/@v/list": {
"body": "v0.3.0\nv0.5.2\nv0.6.1\nv0.6.0\nv0.6.2\nv0.5.0\nv0.4.0\nv0.4.1\nv0.5.1\nv0.1.0\nv0.1.1\nv0.2.0\nv0.4.2\n",
"status_code": 200
},
"golang.org/x/crypto/@latest": {
"body": "{\"Version\":\"v0.22.0\",\"Time\":\"2024-04-04T16:59:43Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/crypto\",\"Ref\":\"refs/tags/v0.22.0\",\"Hash\":\"d042a396a6de487c29b6907508ba7e86925f6e09\"}}",
"status_code": 200
},
"golang.org/x/crypto/@v/list": {
"body": "v0.15.0\nv0.7.0\nv0.3.0\nv0.8.0\nv0.6.0\nv0.10.0\nv0.20.0\nv0.5.0\nv0.22.0\nv0.18.0\nv0.21.0\nv0.12.0\nv0.19.0\nv0.9.0\nv0.4.0\nv0.14.0\nv0.11.0\nv0.1.0\nv0.13.0\nv0.17.0\nv0.2.0\nv0.16.0\n",
"status_code": 200
},
"golang.org/x/image/@latest": {
"body": "{\"Version\":\"v0.15.0\",\"Time\":\"2023-12-19T18:03:06Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/image\",\"Ref\":\"refs/tags/v0.15.0\",\"Hash\":\"9e190ae4a3c5edc736fd99ba38be1c9d08ea5320\"}}",
"status_code": 200
},
"golang.org/x/image/@v/list": {
"body": "v0.15.0\nv0.7.0\nv0.3.0\nv0.8.0\nv0.6.0\nv0.10.0\nv0.5.0\nv0.12.0\nv0.9.0\nv0.4.0\nv0.14.0\nv0.11.0\nv0.1.0\nv0.13.0\nv0.2.0\n",
"status_code": 200
}
}
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/testdata/proxy/TestToReport.json
|
{
"github.com/!consensys/gnark/@latest": {
"body": "{\"Version\":\"v0.10.0\",\"Time\":\"2024-04-22T13:57:16Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/Consensys/gnark\",\"Ref\":\"refs/tags/v0.10.0\",\"Hash\":\"b2dfec74eae2578fdebd2c63be6da390f2aad564\"}}",
"status_code": 200
},
"github.com/go-resty/resty/@latest": {
"body": "{\"Version\":\"v1.12.0\",\"Time\":\"2019-02-28T07:26:48Z\"}",
"status_code": 200
},
"github.com/go-resty/resty/v2/@latest": {
"body": "{\"Version\":\"v2.13.1\",\"Time\":\"2024-05-11T01:40:23Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/go-resty/resty\",\"Ref\":\"refs/tags/v2.13.1\",\"Hash\":\"baf7c1219b781803557018eba206ad8fa544941f\"}}",
"status_code": 200
},
"github.com/gofiber/fiber/@latest": {
"body": "{\"Version\":\"v1.14.6\",\"Time\":\"2020-09-11T18:56:02Z\"}",
"status_code": 200
},
"github.com/pandatix/go-cvss/@latest": {
"body": "{\"Version\":\"v0.6.2\",\"Time\":\"2023-10-29T09:33:31Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/pandatix/go-cvss\",\"Ref\":\"refs/tags/v0.6.2\",\"Hash\":\"c469bad96b51674ff275fa1a76fcd9fa409c180a\"}}",
"status_code": 200
},
"golang.org/x/crypto/@latest": {
"body": "{\"Version\":\"v0.24.0\",\"Time\":\"2024-06-04T16:30:12Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/crypto\",\"Ref\":\"refs/tags/v0.24.0\",\"Hash\":\"332fd656f4f013f66e643818fe8c759538456535\"}}",
"status_code": 200
},
"golang.org/x/image/@latest": {
"body": "{\"Version\":\"v0.18.0\",\"Time\":\"2024-06-18T20:19:45Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/image\",\"Hash\":\"3bbf4a659e56fde394e7214ddd17673223aca672\",\"Ref\":\"refs/tags/v0.18.0\"}}",
"status_code": 200
}
}
|
cve
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/testdata/cve/cvelist.txtar
|
Copyright 2023 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Repo in the shape of "https://github.com/CVEProject/cvelist".
Updated with real data 2023-12-05T19:00:00-05:00.
Auto-generated; do not edit directly.
-- README.md --
ignore me please
-- 2020/9xxx/CVE-2020-9283.json --
{
"CVE_data_meta": {
"ASSIGNER": "cve@mitre.org",
"ID": "CVE-2020-9283",
"STATE": "PUBLIC"
},
"affects": {
"vendor": {
"vendor_data": [
{
"product": {
"product_data": [
{
"product_name": "n/a",
"version": {
"version_data": [
{
"version_value": "n/a"
}
]
}
}
]
},
"vendor_name": "n/a"
}
]
}
},
"data_format": "MITRE",
"data_type": "CVE",
"data_version": "4.0",
"description": {
"description_data": [
{
"lang": "eng",
"value": "golang.org/x/crypto before v0.0.0-20200220183623-bac4c82f6975 for Go allows a panic during signature verification in the golang.org/x/crypto/ssh package. A client can attack an SSH server that accepts public keys. Also, a server can attack any SSH client."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "n/a"
}
]
}
]
},
"references": {
"reference_data": [
{
"refsource": "CONFIRM",
"name": "https://groups.google.com/forum/#!topic/golang-announce/3L45YRc91SY",
"url": "https://groups.google.com/forum/#!topic/golang-announce/3L45YRc91SY"
},
{
"refsource": "MISC",
"name": "http://packetstormsecurity.com/files/156480/Go-SSH-0.0.2-Denial-Of-Service.html",
"url": "http://packetstormsecurity.com/files/156480/Go-SSH-0.0.2-Denial-Of-Service.html"
},
{
"refsource": "MLIST",
"name": "[debian-lts-announce] 20201007 [SECURITY] [DLA 2402-1] golang-go.crypto security update",
"url": "https://lists.debian.org/debian-lts-announce/2020/10/msg00014.html"
},
{
"refsource": "MLIST",
"name": "[debian-lts-announce] 20201116 [SECURITY] [DLA 2453-1] restic security update",
"url": "https://lists.debian.org/debian-lts-announce/2020/11/msg00027.html"
},
{
"refsource": "MLIST",
"name": "[debian-lts-announce] 20201118 [SECURITY] [DLA 2455-1] packer security update",
"url": "https://lists.debian.org/debian-lts-announce/2020/11/msg00031.html"
},
{
"refsource": "MLIST",
"name": "[debian-lts-announce] 20230616 [SECURITY] [DLA 3455-1] golang-go.crypto security update",
"url": "https://lists.debian.org/debian-lts-announce/2023/06/msg00017.html"
}
]
}
}
-- 2021/27xxx/CVE-2021-27919.json --
{
"CVE_data_meta": {
"ASSIGNER": "cve@mitre.org",
"ID": "CVE-2021-27919",
"STATE": "PUBLIC"
},
"affects": {
"vendor": {
"vendor_data": [
{
"product": {
"product_data": [
{
"product_name": "n/a",
"version": {
"version_data": [
{
"version_value": "n/a"
}
]
}
}
]
},
"vendor_name": "n/a"
}
]
}
},
"data_format": "MITRE",
"data_type": "CVE",
"data_version": "4.0",
"description": {
"description_data": [
{
"lang": "eng",
"value": "archive/zip in Go 1.16.x before 1.16.1 allows attackers to cause a denial of service (panic) upon attempted use of the Reader.Open API for a ZIP archive in which ../ occurs at the beginning of any filename."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "n/a"
}
]
}
]
},
"references": {
"reference_data": [
{
"refsource": "MISC",
"name": "https://groups.google.com/g/golang-announce/c/MfiLYjG-RAw",
"url": "https://groups.google.com/g/golang-announce/c/MfiLYjG-RAw"
},
{
"refsource": "FEDORA",
"name": "FEDORA-2021-6a3024b3fd",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2MU47VKTNXX33ZDLTI2ORRUY3KLJKU6G/"
},
{
"refsource": "FEDORA",
"name": "FEDORA-2021-e71b05ba7b",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HM7U5JNS5WU66Q3S26PFIU2ITB2ATTQ4/"
},
{
"refsource": "GENTOO",
"name": "GLSA-202208-02",
"url": "https://security.gentoo.org/glsa/202208-02"
}
]
}
}
-- 2021/3xxx/CVE-2021-3115.json --
{
"CVE_data_meta": {
"ASSIGNER": "cve@mitre.org",
"ID": "CVE-2021-3115",
"STATE": "PUBLIC"
},
"affects": {
"vendor": {
"vendor_data": [
{
"product": {
"product_data": [
{
"product_name": "n/a",
"version": {
"version_data": [
{
"version_value": "n/a"
}
]
}
}
]
},
"vendor_name": "n/a"
}
]
}
},
"data_format": "MITRE",
"data_type": "CVE",
"data_version": "4.0",
"description": {
"description_data": [
{
"lang": "eng",
"value": "Go before 1.14.14 and 1.15.x before 1.15.7 on Windows is vulnerable to Command Injection and remote code execution when using the \"go get\" command to fetch modules that make use of cgo (for example, cgo can execute a gcc program from an untrusted download)."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "n/a"
}
]
}
]
},
"references": {
"reference_data": [
{
"refsource": "CONFIRM",
"name": "https://groups.google.com/g/golang-announce/c/mperVMGa98w",
"url": "https://groups.google.com/g/golang-announce/c/mperVMGa98w"
},
{
"refsource": "CONFIRM",
"name": "https://blog.golang.org/path-security",
"url": "https://blog.golang.org/path-security"
},
{
"refsource": "FEDORA",
"name": "FEDORA-2021-e435a8bb88",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YWAYJGXWC232SG3UR3TR574E6BP3OSQQ/"
},
{
"refsource": "CONFIRM",
"name": "https://security.netapp.com/advisory/ntap-20210219-0001/",
"url": "https://security.netapp.com/advisory/ntap-20210219-0001/"
},
{
"refsource": "GENTOO",
"name": "GLSA-202208-02",
"url": "https://security.gentoo.org/glsa/202208-02"
}
]
}
}
-- 2022/39xxx/CVE-2022-39213.json --
{
"CVE_data_meta": {
"ASSIGNER": "security-advisories@github.com",
"ID": "CVE-2022-39213",
"STATE": "PUBLIC",
"TITLE": "Out-of-bounds Read in go-cvss"
},
"affects": {
"vendor": {
"vendor_data": [
{
"product": {
"product_data": [
{
"product_name": "go-cvss",
"version": {
"version_data": [
{
"version_value": ">= 0.2.0, < 0.4.0"
}
]
}
}
]
},
"vendor_name": "pandatix"
}
]
}
},
"data_format": "MITRE",
"data_type": "CVE",
"data_version": "4.0",
"description": {
"description_data": [
{
"lang": "eng",
"value": "go-cvss is a Go module to manipulate Common Vulnerability Scoring System (CVSS). In affected versions when a full CVSS v2.0 vector string is parsed using `ParseVector`, an Out-of-Bounds Read is possible due to a lack of tests. The Go module will then panic. The problem is patched in tag `v0.4.0`, by the commit `d9d478ff0c13b8b09ace030db9262f3c2fe031f4`. Users are advised to upgrade. Users unable to upgrade may avoid this issue by parsing only CVSS v2.0 vector strings that do not have all attributes defined (e.g. `AV:N/AC:L/Au:N/C:P/I:P/A:C/E:U/RL:OF/RC:C/CDP:MH/TD:H/CR:M/IR:M/AR:M`). As stated in [SECURITY.md](https://github.com/pandatix/go-cvss/blob/master/SECURITY.md), the CPE v2.3 to refer to this Go module is `cpe:2.3:a:pandatix:go_cvss:*:*:*:*:*:*:*:*`. The entry has already been requested to the NVD CPE dictionary."
}
]
},
"impact": {
"cvss": {
"attackComplexity": "LOW",
"attackVector": "NETWORK",
"availabilityImpact": "HIGH",
"baseScore": 7.5,
"baseSeverity": "HIGH",
"confidentialityImpact": "NONE",
"integrityImpact": "NONE",
"privilegesRequired": "NONE",
"scope": "UNCHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"version": "3.1"
}
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "CWE-125: Out-of-bounds Read"
}
]
}
]
},
"references": {
"reference_data": [
{
"name": "https://github.com/pandatix/go-cvss/security/advisories/GHSA-xhmf-mmv2-4hhx",
"refsource": "CONFIRM",
"url": "https://github.com/pandatix/go-cvss/security/advisories/GHSA-xhmf-mmv2-4hhx"
},
{
"name": "https://github.com/pandatix/go-cvss/commit/d9d478ff0c13b8b09ace030db9262f3c2fe031f4",
"refsource": "MISC",
"url": "https://github.com/pandatix/go-cvss/commit/d9d478ff0c13b8b09ace030db9262f3c2fe031f4"
},
{
"name": "https://github.com/pandatix/go-cvss/blob/master/SECURITY.md",
"refsource": "MISC",
"url": "https://github.com/pandatix/go-cvss/blob/master/SECURITY.md"
}
]
},
"source": {
"advisory": "GHSA-xhmf-mmv2-4hhx",
"discovery": "UNKNOWN"
}
}
-- 2023/29xxx/CVE-2023-29407.json --
{
"data_version": "4.0",
"data_type": "CVE",
"data_format": "MITRE",
"CVE_data_meta": {
"ID": "CVE-2023-29407",
"ASSIGNER": "security@golang.org",
"STATE": "PUBLIC"
},
"description": {
"description_data": [
{
"lang": "eng",
"value": "A maliciously-crafted image can cause excessive CPU consumption in decoding. A tiled image with a height of 0 and a very large width can cause excessive CPU consumption, despite the image size (width * height) appearing to be zero."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "CWE-834: Excessive Iteration"
}
]
}
]
},
"affects": {
"vendor": {
"vendor_data": [
{
"vendor_name": "golang.org/x/image",
"product": {
"product_data": [
{
"product_name": "golang.org/x/image/tiff",
"version": {
"version_data": [
{
"version_affected": "<",
"version_name": "0",
"version_value": "0.10.0"
}
]
}
}
]
}
}
]
}
},
"references": {
"reference_data": [
{
"url": "https://go.dev/issue/61581",
"refsource": "MISC",
"name": "https://go.dev/issue/61581"
},
{
"url": "https://go.dev/cl/514897",
"refsource": "MISC",
"name": "https://go.dev/cl/514897"
},
{
"url": "https://pkg.go.dev/vuln/GO-2023-1990",
"refsource": "MISC",
"name": "https://pkg.go.dev/vuln/GO-2023-1990"
},
{
"url": "https://security.netapp.com/advisory/ntap-20230831-0009/",
"refsource": "MISC",
"name": "https://security.netapp.com/advisory/ntap-20230831-0009/"
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KO54NBDUJXKAZNGCFOEYL2LKK2RQP6K6/",
"refsource": "MISC",
"name": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KO54NBDUJXKAZNGCFOEYL2LKK2RQP6K6/"
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XWH6Q7NVM4MV3GWFEU4PA67AWZHVFJQ2/",
"refsource": "MISC",
"name": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XWH6Q7NVM4MV3GWFEU4PA67AWZHVFJQ2/"
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XZTEP6JYILRBNDTNWTEQ5D4QUUVQBESK/",
"refsource": "MISC",
"name": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XZTEP6JYILRBNDTNWTEQ5D4QUUVQBESK/"
}
]
},
"credits": [
{
"lang": "en",
"value": "Philippe Antoine (Catena cyber)"
}
]
}
-- 2023/44xxx/CVE-2023-44378.json --
{
"data_version": "4.0",
"data_type": "CVE",
"data_format": "MITRE",
"CVE_data_meta": {
"ID": "CVE-2023-44378",
"ASSIGNER": "security-advisories@github.com",
"STATE": "PUBLIC"
},
"description": {
"description_data": [
{
"lang": "eng",
"value": "gnark is a zk-SNARK library that offers a high-level API to design circuits. Prior to version 0.9.0, for some in-circuit values, it is possible to construct two valid decomposition to bits. In addition to the canonical decomposition of `a`, for small values there exists a second decomposition for `a+r` (where `r` is the modulus the values are being reduced by). The second decomposition was possible due to overflowing the field where the values are defined. Upgrading to version 0.9.0 should fix the issue without needing to change the calls to value comparison methods."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "CWE-191: Integer Underflow (Wrap or Wraparound)",
"cweId": "CWE-191"
}
]
},
{
"description": [
{
"lang": "eng",
"value": "CWE-697: Incorrect Comparison",
"cweId": "CWE-697"
}
]
}
]
},
"affects": {
"vendor": {
"vendor_data": [
{
"vendor_name": "Consensys",
"product": {
"product_data": [
{
"product_name": "gnark",
"version": {
"version_data": [
{
"version_affected": "=",
"version_value": "< 0.9.0"
}
]
}
}
]
}
}
]
}
},
"references": {
"reference_data": [
{
"url": "https://github.com/Consensys/gnark/security/advisories/GHSA-498w-5j49-vqjg",
"refsource": "MISC",
"name": "https://github.com/Consensys/gnark/security/advisories/GHSA-498w-5j49-vqjg"
},
{
"url": "https://github.com/zkopru-network/zkopru/issues/116",
"refsource": "MISC",
"name": "https://github.com/zkopru-network/zkopru/issues/116"
},
{
"url": "https://github.com/Consensys/gnark/commit/59a4087261a6c73f13e80d695c17b398c3d0934f",
"refsource": "MISC",
"name": "https://github.com/Consensys/gnark/commit/59a4087261a6c73f13e80d695c17b398c3d0934f"
}
]
},
"source": {
"advisory": "GHSA-498w-5j49-vqjg",
"discovery": "UNKNOWN"
},
"impact": {
"cvss": [
{
"attackComplexity": "LOW",
"attackVector": "LOCAL",
"availabilityImpact": "NONE",
"baseScore": 7.1,
"baseSeverity": "HIGH",
"confidentialityImpact": "NONE",
"integrityImpact": "HIGH",
"privilegesRequired": "NONE",
"scope": "CHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N",
"version": "3.1"
}
]
}
}
-- 2023/45xxx/CVE-2023-45141.json --
{
"data_version": "4.0",
"data_type": "CVE",
"data_format": "MITRE",
"CVE_data_meta": {
"ID": "CVE-2023-45141",
"ASSIGNER": "security-advisories@github.com",
"STATE": "PUBLIC"
},
"description": {
"description_data": [
{
"lang": "eng",
"value": "Fiber is an express inspired web framework written in Go. A Cross-Site Request Forgery (CSRF) vulnerability has been identified in the application, which allows an attacker to obtain tokens and forge malicious requests on behalf of a user. This can lead to unauthorized actions being taken on the user's behalf, potentially compromising the security and integrity of the application. The vulnerability is caused by improper validation and enforcement of CSRF tokens within the application. This vulnerability has been addressed in version 2.50.0 and users are advised to upgrade. Users should take additional security measures like captchas or Two-Factor Authentication (2FA) and set Session cookies with SameSite=Lax or SameSite=Secure, and the Secure and HttpOnly attributes."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "CWE-352: Cross-Site Request Forgery (CSRF)",
"cweId": "CWE-352"
}
]
},
{
"description": [
{
"lang": "eng",
"value": "CWE-565: Reliance on Cookies without Validation and Integrity Checking",
"cweId": "CWE-565"
}
]
}
]
},
"affects": {
"vendor": {
"vendor_data": [
{
"vendor_name": "gofiber",
"product": {
"product_data": [
{
"product_name": "fiber",
"version": {
"version_data": [
{
"version_affected": "=",
"version_value": "< 2.50.0"
}
]
}
}
]
}
}
]
}
},
"references": {
"reference_data": [
{
"url": "https://github.com/gofiber/fiber/security/advisories/GHSA-mv73-f69x-444p",
"refsource": "MISC",
"name": "https://github.com/gofiber/fiber/security/advisories/GHSA-mv73-f69x-444p"
}
]
},
"source": {
"advisory": "GHSA-mv73-f69x-444p",
"discovery": "UNKNOWN"
},
"impact": {
"cvss": [
{
"attackComplexity": "LOW",
"attackVector": "NETWORK",
"availabilityImpact": "LOW",
"baseScore": 8.6,
"baseSeverity": "HIGH",
"confidentialityImpact": "LOW",
"integrityImpact": "HIGH",
"privilegesRequired": "NONE",
"scope": "UNCHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L",
"version": "3.1"
}
]
}
}
-- 2023/45xxx/CVE-2023-45283.json --
{
"data_version": "4.0",
"data_type": "CVE",
"data_format": "MITRE",
"CVE_data_meta": {
"ID": "CVE-2023-45283",
"ASSIGNER": "security@golang.org",
"STATE": "PUBLIC"
},
"description": {
"description_data": [
{
"lang": "eng",
"value": "The filepath package does not recognize paths with a \\??\\ prefix as special. On Windows, a path beginning with \\??\\ is a Root Local Device path equivalent to a path beginning with \\\\?\\. Paths with a \\??\\ prefix may be used to access arbitrary locations on the system. For example, the path \\??\\c:\\x is equivalent to the more common path c:\\x. Before fix, Clean could convert a rooted path such as \\a\\..\\??\\b into the root local device path \\??\\b. Clean will now convert this to .\\??\\b. Similarly, Join(\\, ??, b) could convert a seemingly innocent sequence of path elements into the root local device path \\??\\b. Join will now convert this to \\.\\??\\b. In addition, with fix, IsAbs now correctly reports paths beginning with \\??\\ as absolute, and VolumeName correctly reports the \\??\\ prefix as a volume name. UPDATE: Go 1.20.11 and Go 1.21.4 inadvertently changed the definition of the volume name in Windows paths starting with \\?, resulting in filepath.Clean(\\?\\c:) returning \\?\\c: rather than \\?\\c:\\ (among other effects). The previous behavior has been restored."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "CWE-41: Improper Resolution of Path Equivalence"
}
]
}
]
},
"affects": {
"vendor": {
"vendor_data": [
{
"vendor_name": "Go standard library",
"product": {
"product_data": [
{
"product_name": "path/filepath",
"version": {
"version_data": [
{
"version_affected": "<",
"version_name": "0",
"version_value": "1.20.11"
},
{
"version_affected": "<",
"version_name": "1.21.0-0",
"version_value": "1.21.4"
},
{
"version_affected": "<",
"version_name": "1.20.11",
"version_value": "1.20.12"
},
{
"version_affected": "<",
"version_name": "1.21.4",
"version_value": "1.21.5"
}
]
}
},
{
"product_name": "internal/safefilepath",
"version": {
"version_data": [
{
"version_affected": "<",
"version_name": "0",
"version_value": "1.20.11"
},
{
"version_affected": "<",
"version_name": "1.21.0-0",
"version_value": "1.21.4"
}
]
}
}
]
}
}
]
}
},
"references": {
"reference_data": [
{
"url": "https://go.dev/issue/63713",
"refsource": "MISC",
"name": "https://go.dev/issue/63713"
},
{
"url": "https://go.dev/cl/540277",
"refsource": "MISC",
"name": "https://go.dev/cl/540277"
},
{
"url": "https://groups.google.com/g/golang-announce/c/4tU8LZfBFkY",
"refsource": "MISC",
"name": "https://groups.google.com/g/golang-announce/c/4tU8LZfBFkY"
},
{
"url": "https://go.dev/issue/64028",
"refsource": "MISC",
"name": "https://go.dev/issue/64028"
},
{
"url": "https://go.dev/cl/541175",
"refsource": "MISC",
"name": "https://go.dev/cl/541175"
},
{
"url": "https://groups.google.com/g/golang-dev/c/6ypN5EjibjM/m/KmLVYH_uAgAJ",
"refsource": "MISC",
"name": "https://groups.google.com/g/golang-dev/c/6ypN5EjibjM/m/KmLVYH_uAgAJ"
},
{
"url": "https://pkg.go.dev/vuln/GO-2023-2185",
"refsource": "MISC",
"name": "https://pkg.go.dev/vuln/GO-2023-2185"
},
{
"url": "http://www.openwall.com/lists/oss-security/2023/12/05/2",
"refsource": "MISC",
"name": "http://www.openwall.com/lists/oss-security/2023/12/05/2"
}
]
}
}
-- 2023/45xxx/CVE-2023-45285.json --
{
"data_version": "4.0",
"data_type": "CVE",
"data_format": "MITRE",
"CVE_data_meta": {
"ID": "CVE-2023-45285",
"ASSIGNER": "security@golang.org",
"STATE": "PUBLIC"
},
"description": {
"description_data": [
{
"lang": "eng",
"value": "Using go get to fetch a module with the \".git\" suffix may unexpectedly fallback to the insecure \"git://\" protocol if the module is unavailable via the secure \"https://\" and \"git+ssh://\" protocols, even if GOINSECURE is not set for said module. This only affects users who are not using the module proxy and are fetching modules directly (i.e. GOPROXY=off)."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "CWE-636: Not Failing Securely ('Failing Open')"
}
]
}
]
},
"affects": {
"vendor": {
"vendor_data": [
{
"vendor_name": "Go toolchain",
"product": {
"product_data": [
{
"product_name": "cmd/go",
"version": {
"version_data": [
{
"version_affected": "<",
"version_name": "0",
"version_value": "1.20.12"
},
{
"version_affected": "<",
"version_name": "1.21.0-0",
"version_value": "1.21.5"
}
]
}
}
]
}
}
]
}
},
"references": {
"reference_data": [
{
"url": "https://groups.google.com/g/golang-dev/c/6ypN5EjibjM/m/KmLVYH_uAgAJ",
"refsource": "MISC",
"name": "https://groups.google.com/g/golang-dev/c/6ypN5EjibjM/m/KmLVYH_uAgAJ"
},
{
"url": "https://go.dev/issue/63845",
"refsource": "MISC",
"name": "https://go.dev/issue/63845"
},
{
"url": "https://go.dev/cl/540257",
"refsource": "MISC",
"name": "https://go.dev/cl/540257"
},
{
"url": "https://pkg.go.dev/vuln/GO-2023-2383",
"refsource": "MISC",
"name": "https://pkg.go.dev/vuln/GO-2023-2383"
}
]
},
"credits": [
{
"lang": "en",
"value": "David Leadbeater"
}
]
}
-- 2023/45xxx/CVE-2023-45286.json --
{
"data_version": "4.0",
"data_type": "CVE",
"data_format": "MITRE",
"CVE_data_meta": {
"ID": "CVE-2023-45286",
"ASSIGNER": "security@golang.org",
"STATE": "PUBLIC"
},
"description": {
"description_data": [
{
"lang": "eng",
"value": "A race condition in go-resty can result in HTTP request body disclosure across requests. This condition can be triggered by calling sync.Pool.Put with the same *bytes.Buffer more than once, when request retries are enabled and a retry occurs. The call to sync.Pool.Get will then return a bytes.Buffer that hasn't had bytes.Buffer.Reset called on it. This dirty buffer will contain the HTTP request body from an unrelated request, and go-resty will append the current HTTP request body to it, sending two bodies in one request. The sync.Pool in question is defined at package level scope, so a completely unrelated server could receive the request body."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "CWE-200: Exposure of Sensitive Information to an Unauthorized Actor"
}
]
}
]
},
"affects": {
"vendor": {
"vendor_data": [
{
"vendor_name": "github.com/go-resty/resty/v2",
"product": {
"product_data": [
{
"product_name": "github.com/go-resty/resty/v2",
"version": {
"version_data": [
{
"version_value": "not down converted",
"x_cve_json_5_version_data": {
"versions": [
{
"version": "0",
"lessThan": "2.10.0",
"status": "unaffected",
"versionType": "semver"
}
],
"defaultStatus": "affected"
}
}
]
}
}
]
}
}
]
}
},
"references": {
"reference_data": [
{
"url": "https://github.com/go-resty/resty/issues/743",
"refsource": "MISC",
"name": "https://github.com/go-resty/resty/issues/743"
},
{
"url": "https://github.com/go-resty/resty/issues/739",
"refsource": "MISC",
"name": "https://github.com/go-resty/resty/issues/739"
},
{
"url": "https://github.com/go-resty/resty/pull/745",
"refsource": "MISC",
"name": "https://github.com/go-resty/resty/pull/745"
},
{
"url": "https://pkg.go.dev/vuln/GO-2023-2328",
"refsource": "MISC",
"name": "https://pkg.go.dev/vuln/GO-2023-2328"
}
]
},
"credits": [
{
"lang": "en",
"value": "Logan Attwood (@lattwood)"
}
]
}
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/testdata/cve/TestToReport/CVE-2023-45141.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2023-45141.
-- CVE-2023-45141 --
id: GO-ID-PENDING
modules:
- module: github.com/gofiber/fiber
vulnerable_at: 1.14.6
summary: CVE-2023-45141 in github.com/gofiber/fiber
cves:
- CVE-2023-45141
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2023-45141
- web: https://github.com/gofiber/fiber/security/advisories/GHSA-mv73-f69x-444p
source:
id: CVE-2023-45141
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/testdata/cve/TestToReport/CVE-2023-45283.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2023-45283.
-- CVE-2023-45283 --
id: GO-ID-PENDING
modules:
- module: std
packages:
- package: path/filepath
summary: CVE-2023-45283 in path/filepath
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2023-45283
- fix: https://go.dev/cl/540277
- fix: https://go.dev/cl/541175
- report: https://go.dev/issue/63713
- report: https://go.dev/issue/64028
- web: http://www.openwall.com/lists/oss-security/2023/12/05/2
- web: https://groups.google.com/g/golang-announce/c/4tU8LZfBFkY
- web: https://groups.google.com/g/golang-dev/c/6ypN5EjibjM/m/KmLVYH_uAgAJ
cve_metadata:
id: CVE-2023-45283
cwe: 'CWE-41: Improper Resolution of Path Equivalence'
notes:
- fix: 'std: could not add vulnerable_at: not implemented for std/cmd'
- lint: 'description: missing (reports with Go CVEs must have a description)'
- lint: 'modules[0] "std": packages[0] "path/filepath": at least one of vulnerable_at and skip_fix must be set'
- lint: 'references[0] "https://nvd.nist.gov/vuln/detail/CVE-2023-45283": "https://nvd.nist.gov/vuln/detail/CVE-2023-45283": advisory reference must not be set for first-party issues'
- lint: 'references[5] "http://www.openwall.com/lists/oss-security/2023/12/05/2": "http://www.openwall.com/lists/oss-security/2023/12/05/2": web reference must match regex "https://groups.google.com/g/golang-(announce|dev|nuts)/c/([^/]+)"'
source:
id: CVE-2023-45283
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/testdata/cve/TestToReport/CVE-2023-45285.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2023-45285.
-- CVE-2023-45285 --
id: GO-ID-PENDING
modules:
- module: std
packages:
- package: cmd/go
summary: CVE-2023-45285 in cmd/go
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2023-45285
- fix: https://go.dev/cl/540257
- report: https://go.dev/issue/63845
- web: https://groups.google.com/g/golang-dev/c/6ypN5EjibjM/m/KmLVYH_uAgAJ
cve_metadata:
id: CVE-2023-45285
cwe: 'CWE-636: Not Failing Securely (''Failing Open'')'
notes:
- fix: 'std: could not add vulnerable_at: not implemented for std/cmd'
- lint: 'description: missing (reports with Go CVEs must have a description)'
- lint: 'modules[0] "std": packages[0] "cmd/go": at least one of vulnerable_at and skip_fix must be set'
- lint: 'modules[0] "std": packages[0] "cmd/go": must be in module cmd'
- lint: 'references[0] "https://nvd.nist.gov/vuln/detail/CVE-2023-45285": "https://nvd.nist.gov/vuln/detail/CVE-2023-45285": advisory reference must not be set for first-party issues'
source:
id: CVE-2023-45285
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/testdata/cve/TestToReport/CVE-2023-29407.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2023-29407.
-- CVE-2023-29407 --
id: GO-ID-PENDING
modules:
- module: golang.org/x/image
vulnerable_at: 0.18.0
summary: CVE-2023-29407 in golang.org/x/image
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2023-29407
- fix: https://go.dev/cl/514897
- report: https://go.dev/issue/61581
- web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KO54NBDUJXKAZNGCFOEYL2LKK2RQP6K6/
- web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XWH6Q7NVM4MV3GWFEU4PA67AWZHVFJQ2/
- web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XZTEP6JYILRBNDTNWTEQ5D4QUUVQBESK/
- web: https://security.netapp.com/advisory/ntap-20230831-0009/
cve_metadata:
id: CVE-2023-29407
cwe: 'CWE-834: Excessive Iteration'
notes:
- lint: 'description: missing (reports with Go CVEs must have a description)'
source:
id: CVE-2023-29407
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/testdata/cve/TestToReport/CVE-2021-3115.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2021-3115.
-- CVE-2021-3115 --
id: GO-ID-PENDING
modules:
- module: std
packages:
- package: cmd/go
summary: CVE-2021-3115 in cmd/go
cves:
- CVE-2021-3115
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2021-3115
- web: https://blog.go.dev/path-security
- web: https://groups.google.com/g/golang-announce/c/mperVMGa98w
- web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YWAYJGXWC232SG3UR3TR574E6BP3OSQQ/
- web: https://security.gentoo.org/glsa/202208-02
- web: https://security.netapp.com/advisory/ntap-20210219-0001/
notes:
- fix: 'std: could not add vulnerable_at: not implemented for std/cmd'
- lint: 'modules[0] "std": packages[0] "cmd/go": at least one of vulnerable_at and skip_fix must be set'
- lint: 'modules[0] "std": packages[0] "cmd/go": must be in module cmd'
- lint: 'references: must contain at least one fix'
- lint: 'references: must contain at least one report'
- lint: 'references[0] "https://nvd.nist.gov/vuln/detail/CVE-2021-3115": "https://nvd.nist.gov/vuln/detail/CVE-2021-3115": advisory reference must not be set for first-party issues'
- lint: 'references[1] "https://blog.go.dev/path-security": "https://blog.go.dev/path-security": web reference must match regex "https://groups.google.com/g/golang-(announce|dev|nuts)/c/([^/]+)"'
- lint: 'references[3] "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YWAYJGXWC232SG3UR3TR574E6BP3OSQQ/": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YWAYJGXWC232SG3UR3TR574E6BP3OSQQ/": web reference must match regex "https://groups.google.com/g/golang-(announce|dev|nuts)/c/([^/]+)"'
- lint: 'references[4] "https://security.gentoo.org/glsa/202208-02": "https://security.gentoo.org/glsa/202208-02": web reference must match regex "https://groups.google.com/g/golang-(announce|dev|nuts)/c/([^/]+)"'
- lint: 'references[5] "https://security.netapp.com/advisory/ntap-20210219-0001/": "https://security.netapp.com/advisory/ntap-20210219-0001/": web reference must match regex "https://groups.google.com/g/golang-(announce|dev|nuts)/c/([^/]+)"'
source:
id: CVE-2021-3115
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/testdata/cve/TestToReport/CVE-2023-45286.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2023-45286.
-- CVE-2023-45286 --
id: GO-ID-PENDING
modules:
- module: github.com/go-resty/resty
vulnerable_at: 1.12.0
- module: github.com/go-resty/resty/v2
vulnerable_at: 2.13.1
summary: CVE-2023-45286 in github.com/go-resty/resty
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2023-45286
- fix: https://github.com/go-resty/resty/pull/745
- report: https://github.com/go-resty/resty/issues/739
- report: https://github.com/go-resty/resty/issues/743
cve_metadata:
id: CVE-2023-45286
cwe: 'CWE-200: Exposure of Sensitive Information to an Unauthorized Actor'
notes:
- lint: 'description: missing (reports with Go CVEs must have a description)'
source:
id: CVE-2023-45286
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/testdata/cve/TestToReport/CVE-2021-27919.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2021-27919.
-- CVE-2021-27919 --
id: GO-ID-PENDING
modules:
- module: std
packages:
- package: archive/zip
summary: CVE-2021-27919 in archive/zip
cves:
- CVE-2021-27919
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2021-27919
- web: https://groups.google.com/g/golang-announce/c/MfiLYjG-RAw
- web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2MU47VKTNXX33ZDLTI2ORRUY3KLJKU6G/
- web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HM7U5JNS5WU66Q3S26PFIU2ITB2ATTQ4/
- web: https://security.gentoo.org/glsa/202208-02
notes:
- fix: 'std: could not add vulnerable_at: not implemented for std/cmd'
- lint: 'modules[0] "std": packages[0] "archive/zip": at least one of vulnerable_at and skip_fix must be set'
- lint: 'references: must contain at least one fix'
- lint: 'references: must contain at least one report'
- lint: 'references[0] "https://nvd.nist.gov/vuln/detail/CVE-2021-27919": "https://nvd.nist.gov/vuln/detail/CVE-2021-27919": advisory reference must not be set for first-party issues'
- lint: 'references[2] "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2MU47VKTNXX33ZDLTI2ORRUY3KLJKU6G/": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2MU47VKTNXX33ZDLTI2ORRUY3KLJKU6G/": web reference must match regex "https://groups.google.com/g/golang-(announce|dev|nuts)/c/([^/]+)"'
- lint: 'references[3] "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HM7U5JNS5WU66Q3S26PFIU2ITB2ATTQ4/": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HM7U5JNS5WU66Q3S26PFIU2ITB2ATTQ4/": web reference must match regex "https://groups.google.com/g/golang-(announce|dev|nuts)/c/([^/]+)"'
- lint: 'references[4] "https://security.gentoo.org/glsa/202208-02": "https://security.gentoo.org/glsa/202208-02": web reference must match regex "https://groups.google.com/g/golang-(announce|dev|nuts)/c/([^/]+)"'
source:
id: CVE-2021-27919
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/testdata/cve/TestToReport/CVE-2022-39213.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2022-39213.
-- CVE-2022-39213 --
id: GO-ID-PENDING
modules:
- module: github.com/pandatix/go-cvss
vulnerable_at: 0.6.2
summary: CVE-2022-39213 in github.com/pandatix/go-cvss
cves:
- CVE-2022-39213
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2022-39213
- fix: https://github.com/pandatix/go-cvss/commit/d9d478ff0c13b8b09ace030db9262f3c2fe031f4
- web: https://github.com/pandatix/go-cvss/blob/master/SECURITY.md
- web: https://github.com/pandatix/go-cvss/security/advisories/GHSA-xhmf-mmv2-4hhx
source:
id: CVE-2022-39213
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/testdata/cve/TestToReport/CVE-2020-9283.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2020-9283.
-- CVE-2020-9283 --
id: GO-ID-PENDING
modules:
- module: golang.org/x/crypto
vulnerable_at: 0.24.0
summary: CVE-2020-9283 in golang.org/x/crypto
cves:
- CVE-2020-9283
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2020-9283
- web: http://packetstormsecurity.com/files/156480/Go-SSH-0.0.2-Denial-Of-Service.html
- web: https://groups.google.com/forum/#!topic/golang-announce/3L45YRc91SY
- web: https://lists.debian.org/debian-lts-announce/2020/10/msg00014.html
- web: https://lists.debian.org/debian-lts-announce/2020/11/msg00027.html
- web: https://lists.debian.org/debian-lts-announce/2020/11/msg00031.html
- web: https://lists.debian.org/debian-lts-announce/2023/06/msg00017.html
source:
id: CVE-2020-9283
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve4/testdata/cve/TestToReport/CVE-2023-44378.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2023-44378.
-- CVE-2023-44378 --
id: GO-ID-PENDING
modules:
- module: github.com/Consensys/gnark
vulnerable_at: 0.10.0
summary: CVE-2023-44378 in github.com/Consensys/gnark
cves:
- CVE-2023-44378
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2023-44378
- fix: https://github.com/Consensys/gnark/commit/59a4087261a6c73f13e80d695c17b398c3d0934f
- report: https://github.com/zkopru-network/zkopru/issues/116
- web: https://github.com/Consensys/gnark/security/advisories/GHSA-498w-5j49-vqjg
source:
id: CVE-2023-44378
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/proxy/proxy_test.go
|
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package proxy
import (
"errors"
"flag"
"net/http"
"testing"
"github.com/google/go-cmp/cmp"
)
var realProxy = flag.Bool("proxy", false, "if true, contact the real module proxy and update expected responses")
func TestCanonicalModulePath(t *testing.T) {
c, err := NewTestClient(t, *realProxy)
if err != nil {
t.Fatal(err)
}
tcs := []struct {
name string
path string
version string
want string
}{
{
name: "non-canonical",
path: "github.com/golang/vulndb",
version: "0.0.0-20230522180520-0cbf4ffdb4e7",
want: "golang.org/x/vulndb",
},
{
name: "canonical",
path: "golang.org/x/vulndb",
version: "0.0.0-20230522180520-0cbf4ffdb4e7",
want: "golang.org/x/vulndb",
},
{
name: "module needs to be escaped",
path: "github.com/RobotsAndPencils/go-saml",
version: "0.0.0-20230606195814-29020529affc",
want: "github.com/RobotsAndPencils/go-saml",
},
}
for _, tc := range tcs {
t.Run(tc.name, func(t *testing.T) {
got, err := c.CanonicalModulePath(tc.path, tc.version)
if err != nil {
t.Fatal(err)
}
if got != tc.want {
t.Errorf("CanonicalModulePath() = %v, want %v", got, tc.want)
}
})
}
}
func TestCanonicalModuleVersion(t *testing.T) {
c, err := NewTestClient(t, *realProxy)
if err != nil {
t.Fatal(err)
}
tcs := []struct {
name string
path string
version string
want string
}{
{
name: "tagged version already canonical",
path: "golang.org/x/vuln",
version: "0.1.0",
want: "0.1.0",
},
{
name: "pseudo-version already canonical",
path: "golang.org/x/vulndb",
version: "0.0.0-20230522180520-0cbf4ffdb4e7",
want: "0.0.0-20230522180520-0cbf4ffdb4e7",
},
{
name: "commit hash",
path: "golang.org/x/vulndb",
version: "0cbf4ffdb4e70fce663ec8d59198745b04e7801b",
want: "0.0.0-20230522180520-0cbf4ffdb4e7",
},
{
name: "module needs to be escaped",
path: "github.com/RobotsAndPencils/go-saml",
version: "0.0.0-20230606195814-29020529affc",
want: "0.0.0-20230606195814-29020529affc",
},
}
for _, tc := range tcs {
t.Run(tc.name, func(t *testing.T) {
got, err := c.CanonicalModuleVersion(tc.path, tc.version)
if err != nil {
t.Fatal(err)
}
if got != tc.want {
t.Errorf("CanonicalModuleVersion() = %v, want %v", got, tc.want)
}
})
}
}
func TestModuleExistsAtTaggedVersion(t *testing.T) {
c, err := NewTestClient(t, *realProxy)
if err != nil {
t.Fatal(err)
}
tcs := []struct {
name string
path string
version string
want bool
}{
{
name: "exists",
path: "golang.org/x/vuln",
version: "0.1.0",
want: true,
},
{
name: "non-canonical module ok",
path: "github.com/golang/vuln",
version: "0.1.0",
want: true,
},
{
name: "module needs to be escaped",
path: "github.com/Masterminds/squirrel",
version: "1.5.4",
want: true,
},
{
name: "non-canonical version not OK",
path: "golang.org/x/vulndb",
version: "0cbf4ffdb4e70fce663ec8d59198745b04e7801b",
want: false,
},
{
name: "module exists, version does not",
path: "golang.org/x/vulndb",
version: "1.0.0",
want: false,
},
{
name: "neither exist",
path: "golang.org/x/notamod",
version: "1.0.0",
want: false,
},
}
for _, tc := range tcs {
t.Run(tc.name, func(t *testing.T) {
if got := c.ModuleExistsAtTaggedVersion(tc.path, tc.version); got != tc.want {
t.Errorf("ModuleExistsAtTaggedVersion() = %v, want %v", got, tc.want)
}
})
}
}
func TestVersions(t *testing.T) {
c, err := NewTestClient(t, *realProxy)
if err != nil {
t.Fatal(err)
}
tcs := []struct {
name string
path string
want []string
}{
{
name: "no tagged versions",
path: "golang.org/x/vulndb",
want: nil,
},
{
name: "tagged versions",
path: "golang.org/x/vuln",
want: []string{
"0.1.0",
"0.2.0",
"1.0.0",
"1.0.1",
},
},
{
name: "module needs to be escaped",
path: "github.com/RobotsAndPencils/go-saml",
want: nil, // no tagged versions
},
}
for _, tc := range tcs {
t.Run(tc.name, func(t *testing.T) {
got, err := c.Versions(tc.path)
if err != nil {
t.Fatal(err)
}
if diff := cmp.Diff(tc.want, got); diff != "" {
t.Errorf("Versions() mismatch (-want +got):\n%s", diff)
}
})
}
}
func TestLatest(t *testing.T) {
c, err := NewTestClient(t, *realProxy)
if err != nil {
t.Fatal(err)
}
tcs := []struct {
path string
want string
}{
{
path: "golang.org/x/vulndb",
want: "0.0.0-20230911193511-c7cbbd05f085",
},
{
path: "golang.org/x/vuln",
want: "1.0.1",
},
{
// module needs to be escaped
path: "github.com/RobotsAndPencils/go-saml",
want: "0.0.0-20230606195814-29020529affc",
},
}
for _, tc := range tcs {
t.Run(tc.path, func(t *testing.T) {
got, err := c.Latest(tc.path)
if err != nil {
t.Fatal(err)
}
if got != tc.want {
t.Errorf("Latest() = %v, want %v", got, tc.want)
}
})
}
}
func TestFindModule(t *testing.T) {
c, err := NewTestClient(t, *realProxy)
if err != nil {
t.Fatal(err)
}
tcs := []struct {
name string
path string
want string
wantErr error
}{
{
name: "module is a prefix of path",
path: "k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/server",
want: "k8s.io/kubernetes/staging/src/k8s.io/apiserver",
},
{
name: "path is a module",
path: "k8s.io/kubernetes/staging/src/k8s.io/apiserver",
want: "k8s.io/kubernetes/staging/src/k8s.io/apiserver",
},
{
name: "no module",
path: "example.co.io/module/package/src/versions/v8",
wantErr: errNoModuleFound,
},
{
name: "module needs to be escaped",
path: "github.com/RobotsAndPencils/go-saml/util",
want: "github.com/RobotsAndPencils/go-saml",
},
}
for _, tc := range tcs {
t.Run(tc.name, func(t *testing.T) {
got, err := c.FindModule(tc.path)
if !errors.Is(err, tc.wantErr) {
t.Errorf("FindModule() error = %v, want err containing %v", err, tc.wantErr)
} else if got != tc.want {
t.Errorf("FindModule() = %v, want %v", got, tc.want)
}
})
}
}
func TestModuleExists(t *testing.T) {
c, err := NewTestClient(t, *realProxy)
if err != nil {
t.Fatal(err)
}
tcs := []struct {
name string
path string
want bool
}{
{
name: "exists",
path: "k8s.io/kubernetes",
want: true,
},
{
name: "exists (needs escape)",
path: "github.com/RobotsAndPencils/go-saml",
want: true,
},
{
name: "does not exist",
path: "example.com/not/a/module",
want: false,
},
}
for _, tc := range tcs {
t.Run(tc.name, func(t *testing.T) {
got := c.ModuleExists(tc.path)
if got != tc.want {
t.Errorf("ModuleExists() = %v, want %v", got, tc.want)
}
})
}
}
func TestCacheAndErrors(t *testing.T) {
okEndpoint, notFoundEndpoint := "endpoint", "not/found"
okResponse := "response"
responses := map[string]*response{
okEndpoint: {
Body: okResponse,
StatusCode: http.StatusOK,
},
notFoundEndpoint: {
Body: "",
StatusCode: http.StatusNotFound,
},
}
c, cleanup := fakeClient(responses)
t.Cleanup(cleanup)
wantHits := 3
for i := 0; i < wantHits+1; i++ {
b, err := c.lookup(okEndpoint)
if err != nil {
t.Fatal(err)
}
if got, want := string(b), okResponse; got != want {
t.Errorf("lookup(%q) = %s, want %s", okEndpoint, got, want)
}
}
if c.cache.hits != wantHits {
t.Errorf("cache hits = %d, want %d", c.cache.hits, wantHits)
}
if _, err := c.lookup(notFoundEndpoint); err == nil {
t.Errorf("lookup(%q) succeeded, want error", notFoundEndpoint)
}
want, got := responses, c.responses()
if diff := cmp.Diff(want, got); diff != "" {
t.Errorf("Responses() unexpected diff (want-, got+):\n%s", diff)
}
}
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/proxy/test_framework.go
|
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package proxy
import (
"encoding/json"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"sync"
"testing"
)
// NewTestClient creates a new client for testing.
// If update is true, the returned client contacts the real
// proxy and updates the file "testdata/proxy/<TestName>.json" with
// the responses it saw.
// If update is false, the returned client is a fake that
// reads saved responses from "testdata/proxy/<TestName>.json".
func NewTestClient(t *testing.T, update bool) (*Client, error) {
t.Helper()
fpath := responsesFile(t)
if update {
// Set up a real proxy and register a function to write the responses
// after the test runs.
pc := NewClient(http.DefaultClient, ProxyURL)
t.Cleanup(func() {
if err := os.MkdirAll(filepath.Dir(fpath), os.ModePerm); err != nil {
t.Error(err)
return
}
if err := pc.writeResponses(fpath); err != nil {
t.Error(err)
}
})
return pc, nil
}
// Get the fake client from the saved responses.
b, err := os.ReadFile(fpath)
if err != nil {
return nil, err
}
var responses map[string]*response
err = json.Unmarshal(b, &responses)
if err != nil {
return nil, err
}
c, cleanup := fakeClient(responses)
t.Cleanup(cleanup)
return c, nil
}
// response is a representation of an HTTP response used to
// facilitate testing.
type response struct {
Body string `json:"body,omitempty"`
StatusCode int `json:"status_code"`
}
// fakeClient creates a client that returns hard-coded responses.
// endpointsToResponses is a map from proxy endpoints
// (with no server url, and no leading '/'), to their desired responses.
func fakeClient(endpointsToResponses map[string]*response) (c *Client, cleanup func()) {
handler := func(w http.ResponseWriter, r *http.Request) {
for endpoint, response := range endpointsToResponses {
if r.Method == http.MethodGet &&
r.URL.Path == "/"+endpoint {
if response.StatusCode == http.StatusOK {
_, _ = w.Write([]byte(response.Body))
} else {
w.WriteHeader(response.StatusCode)
}
return
}
}
w.WriteHeader(http.StatusBadRequest)
}
s := httptest.NewServer(http.HandlerFunc(handler))
return NewClient(s.Client(), s.URL), func() { s.Close() }
}
func responsesFile(t *testing.T) string {
return filepath.Join("testdata", "proxy", t.Name()+".json")
}
// responses returns a map from endpoints to the latest response received for each endpoint.
//
// Intended for testing: the output can be passed to NewTestClient to create a fake client
// that returns the same responses.
func (c *Client) responses() map[string]*response {
m := make(map[string]*response)
for key, status := range c.errLog.getData() {
m[key] = &response{StatusCode: status}
}
for key, b := range c.cache.getData() {
m[key] = &response{Body: string(b), StatusCode: http.StatusOK}
}
return m
}
func (pc *Client) writeResponses(filepath string) error {
responses, err := json.MarshalIndent(pc.responses(), "", "\t")
if err != nil {
return err
}
return os.WriteFile(filepath, responses, 0644)
}
// An in-memory store of the errors seen so far.
// Used by the responses() function, for testing.
type errLog struct {
data map[string]int
mu sync.Mutex
}
func newErrLog() *errLog {
return &errLog{data: make(map[string]int)}
}
func (e *errLog) set(key string, status int) {
e.mu.Lock()
defer e.mu.Unlock()
e.data[key] = status
}
func (e *errLog) getData() map[string]int {
e.mu.Lock()
defer e.mu.Unlock()
return e.data
}
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/proxy/proxy.go
|
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package proxy provides a client and utilities for accessing the Go module proxy.
// Queries about the Go standard library and toolchain are not supported.
package proxy
import (
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"os"
urlpath "path"
"sort"
"strings"
"sync"
"golang.org/x/exp/slices"
"golang.org/x/mod/modfile"
"golang.org/x/mod/module"
"golang.org/x/vulndb/internal/derrors"
"golang.org/x/vulndb/internal/version"
)
// Client is a client for reading from the proxy.
//
// It uses a simple in-memory cache that does not expire,
// which is acceptable because we use this Client in a short-lived
// context (~1 day at most, in the case of the worker, and a few seconds
// in the case of the vulnreport command), and module/version data does
// not change often enough to be a problem for our use cases.
type Client struct {
*http.Client
url string
cache *cache
errLog *errLog // for testing
}
func NewClient(c *http.Client, url string) *Client {
return &Client{
Client: c,
url: url,
cache: newCache(),
errLog: newErrLog(),
}
}
const ProxyURL = "https://proxy.golang.org"
func NewDefaultClient() *Client {
proxyURL := ProxyURL
if proxy, ok := os.LookupEnv("GOPROXY"); ok {
proxyURL = proxy
}
return NewClient(http.DefaultClient, proxyURL)
}
func (c *Client) lookup(urlSuffix string) ([]byte, error) {
url := fmt.Sprintf("%s/%s", c.url, urlSuffix)
if b, found := c.cache.get(urlSuffix); found {
return b, nil
}
req, err := http.NewRequest(http.MethodGet, url, nil)
if err != nil {
return nil, err
}
resp, err := c.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
c.errLog.set(urlSuffix, resp.StatusCode)
return nil, fmt.Errorf("HTTP GET /%s returned status %v", urlSuffix, resp.Status)
}
b, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
c.cache.set(urlSuffix, b)
return b, nil
}
func (c *Client) list(path string) ([]byte, error) {
escaped, err := module.EscapePath(path)
if err != nil {
return nil, err
}
return c.lookup(fmt.Sprintf("%s/@v/list", escaped))
}
func (c *Client) latest(path string) ([]byte, error) {
escaped, err := module.EscapePath(path)
if err != nil {
return nil, err
}
return c.lookup(fmt.Sprintf("%s/@latest", escaped))
}
func (c *Client) info(path string, ver string) ([]byte, error) {
// module.Check does not accept commit hash versions,
// but the proxy does (for "info" requests).
if !version.IsCommitHash(ver) {
if err := module.Check(path, vv(ver)); err != nil {
return nil, err
}
}
ep, ev, err := escapePathAndVersion(path, ver)
if err != nil {
return nil, err
}
return c.lookup(fmt.Sprintf("%s/@v/%v.info", ep, ev))
}
func (c *Client) mod(path string, ver string) ([]byte, error) {
if err := module.Check(path, vv(ver)); err != nil {
return nil, err
}
ep, ev, err := escapePathAndVersion(path, ver)
if err != nil {
return nil, err
}
return c.lookup(fmt.Sprintf("%s/@v/%v.mod", ep, ev))
}
// escapePathAndVersion escapes the module path and version.
func escapePathAndVersion(path, ver string) (ePath, eVersion string, err error) {
vv := vv(ver)
if ePath, err = module.EscapePath(path); err != nil {
return "", "", err
}
if eVersion, err = module.EscapeVersion(vv); err != nil {
return "", "", err
}
return ePath, eVersion, err
}
func vv(ver string) string {
// The proxy does not expect a "v" prefix for commit hashes.
if version.IsCommitHash(ver) {
return ver
}
return "v" + ver
}
// CanonicalAtLatest finds the canonical module path for the given module path
// at the latest version.
func (c *Client) CanonicalAtLatest(path string) (_ string, err error) {
v, err := c.Latest(path)
if err != nil {
return "", nil
}
return c.CanonicalModulePath(path, v)
}
func (c *Client) CanonicalModulePath(path, version string) (_ string, err error) {
b, err := c.mod(path, version)
if err != nil {
return "", err
}
m, err := modfile.ParseLax("go.mod", b, nil)
if err != nil {
return "", err
}
if m.Module == nil {
return "", fmt.Errorf("unable to retrieve module information for %s", path)
}
return m.Module.Mod.Path, nil
}
// ModuleExistsAtTaggedVersion returns whether the given module path exists
// at the given version.
// The module need not be canonical, but the version must be an unprefixed
// canonical tagged version (e.g. 1.2.3 or 1.2.3+incompatible).
func (c *Client) ModuleExistsAtTaggedVersion(path, version string) bool {
// Use this strategy to take advantage of caching.
// Some reports would cause this function to be called for many versions
// on the same module.
vs, err := c.versions(path)
if err != nil {
return false
}
return slices.Contains(vs, version)
}
// CanonicalModuleVersion returns the canonical version string (with no leading "v" prefix)
// for the given module path and version string.
func (c *Client) CanonicalModuleVersion(path, ver string) (_ string, err error) {
b, err := c.info(path, ver)
if err != nil {
return "", err
}
var val map[string]any
if err := json.Unmarshal(b, &val); err != nil {
return "", err
}
v, ok := val["Version"].(string)
if !ok {
return "", fmt.Errorf("unable to retrieve canonical version for %s", ver)
}
return version.TrimPrefix(v), nil
}
// Latest returns the latest version of the module, with no leading "v"
// prefix.
func (c *Client) Latest(path string) (string, error) {
b, err := c.latest(path)
if err != nil {
return "", err
}
var v map[string]any
if err := json.Unmarshal(b, &v); err != nil {
return "", err
}
ver, ok := v["Version"].(string)
if !ok {
return "", fmt.Errorf("unable to retrieve latest version for %s", path)
}
return version.TrimPrefix(ver), nil
}
// Versions returns a list of module versions (with no leading "v" prefix),
// sorted in ascending order.
func (c *Client) Versions(path string) ([]string, error) {
vs, err := c.versions(path)
if err != nil {
return nil, err
}
sort.SliceStable(vs, func(i, j int) bool {
return version.Before(vs[i], vs[j])
})
return vs, nil
}
// versions returns an unsorted list of module versions (with no leading "v" prefix).
func (c *Client) versions(path string) ([]string, error) {
b, err := c.list(path)
if err != nil {
return nil, err
}
if len(b) == 0 {
return nil, nil
}
var vs []string
for _, v := range strings.Split(strings.TrimSpace(string(b)), "\n") {
vs = append(vs, version.TrimPrefix(v))
}
return vs, nil
}
var errNoModuleFound = errors.New("no module found")
// FindModule returns the longest directory prefix of path that
// is a module, or "" if no such prefix is found.
func (c *Client) FindModule(path string) (modPath string, err error) {
derrors.Wrap(&err, "FindModule(%s)", path)
for candidate := path; candidate != "."; candidate = urlpath.Dir(candidate) {
if c.ModuleExists(candidate) {
return candidate, nil
}
}
return "", errNoModuleFound
}
// ModuleExists returns true if path is a recognized module
// with at least one associated version.
func (c *Client) ModuleExists(path string) bool {
_, err := c.latest(path)
if err != nil {
// If latest doesn't work, fall back to checking
// if list succeeds and is non-empty.
b, err := c.list(path)
return err == nil && len(b) != 0
}
return true
}
// A simple in-memory cache that never expires.
type cache struct {
data map[string][]byte
hits int // for testing
mu sync.Mutex
}
func newCache() *cache {
return &cache{data: make(map[string][]byte)}
}
func (c *cache) get(key string) ([]byte, bool) {
c.mu.Lock()
defer c.mu.Unlock()
if b, ok := c.data[key]; ok {
c.hits++
return b, true
}
return nil, false
}
func (c *cache) set(key string, val []byte) {
c.mu.Lock()
defer c.mu.Unlock()
c.data[key] = val
}
func (c *cache) getData() map[string][]byte {
c.mu.Lock()
defer c.mu.Unlock()
return c.data
}
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/proxy/testdata/proxy/TestCanonicalModulePath.json
|
{
"github.com/!robots!and!pencils/go-saml/@v/v0.0.0-20230606195814-29020529affc.mod": {
"body": "module github.com/RobotsAndPencils/go-saml\n",
"status_code": 200
},
"github.com/golang/vulndb/@v/v0.0.0-20230522180520-0cbf4ffdb4e7.mod": {
"body": "module golang.org/x/vulndb\n\ngo 1.18\n\nrequire (\n\tgolang.org/x/vuln v0.0.0-20230217204342-b91abcc5ae3c\n\tgolang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect\n)\n\nrequire (\n\tcloud.google.com/go/errorreporting v0.1.0\n\tcloud.google.com/go/firestore v1.6.1\n\tgithub.com/GoogleCloudPlatform/opentelemetry-operations-go v1.0.0\n\tgithub.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.26.0\n\tgithub.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.0.0\n\tgithub.com/client9/misspell v0.3.4\n\tgithub.com/go-git/go-billy/v5 v5.3.1\n\tgithub.com/go-git/go-git/v5 v5.4.2\n\tgithub.com/google/go-cmp v0.5.8\n\tgithub.com/google/go-github/v41 v41.0.0\n\tgithub.com/google/safehtml v0.0.2\n\tgithub.com/jba/templatecheck v0.6.0\n\tgithub.com/shurcooL/githubv4 v0.0.0-20220115235240-a14260e6f8a2\n\tgo.opentelemetry.io/otel v1.4.0\n\tgo.opentelemetry.io/otel/sdk v1.4.0\n\tgolang.org/x/exp v0.0.0-20220722155223-a9213eeb770e\n\tgolang.org/x/exp/event v0.0.0-20220218215828-6cf2b201936e\n\tgolang.org/x/mod v0.10.0\n\tgolang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8\n\tgolang.org/x/sync v0.2.0\n\tgolang.org/x/time v0.0.0-20191024005414-555d28b269f0\n\tgolang.org/x/tools v0.9.1\n\tgoogle.golang.org/api v0.70.0\n\tgoogle.golang.org/grpc v1.44.0\n\tgopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c\n\thonnef.co/go/tools v0.2.2\n\tmvdan.cc/unparam v0.0.0-20220926085101-66de63301820\n)\n\nrequire (\n\tcloud.google.com/go v0.100.2 // indirect\n\tcloud.google.com/go/compute v1.3.0 // indirect\n\tcloud.google.com/go/monitoring v1.2.0 // indirect\n\tcloud.google.com/go/trace v1.0.0 // indirect\n\tgithub.com/BurntSushi/toml v0.3.1 // indirect\n\tgithub.com/Microsoft/go-winio v0.4.16 // indirect\n\tgithub.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect\n\tgithub.com/acomagu/bufpipe v1.0.3 // indirect\n\tgithub.com/emirpasic/gods v1.12.0 // indirect\n\tgithub.com/go-git/gcfg v1.5.0 // indirect\n\tgithub.com/go-logr/logr v1.2.2 // indirect\n\tgithub.com/go-logr/stdr v1.2.2 // indirect\n\tgithub.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect\n\tgithub.com/golang/protobuf v1.5.2 // indirect\n\tgithub.com/google/go-querystring v1.1.0 // indirect\n\tgithub.com/googleapis/gax-go/v2 v2.1.1 // indirect\n\tgithub.com/imdario/mergo v0.3.12 // indirect\n\tgithub.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect\n\tgithub.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect\n\tgithub.com/mitchellh/go-homedir v1.1.0 // indirect\n\tgithub.com/sergi/go-diff v1.1.0 // indirect\n\tgithub.com/shurcooL/graphql v0.0.0-20200928012149-18c5c3165e3a // indirect\n\tgithub.com/xanzy/ssh-agent v0.3.0 // indirect\n\tgo.opencensus.io v0.23.0 // indirect\n\tgo.opentelemetry.io/otel/internal/metric v0.27.0 // indirect\n\tgo.opentelemetry.io/otel/metric v0.27.0 // indirect\n\tgo.opentelemetry.io/otel/sdk/export/metric v0.26.0 // indirect\n\tgo.opentelemetry.io/otel/sdk/metric v0.26.0 // indirect\n\tgo.opentelemetry.io/otel/trace v1.4.0 // indirect\n\tgolang.org/x/crypto v0.1.0 // indirect\n\tgolang.org/x/net v0.10.0 // indirect\n\tgolang.org/x/sys v0.8.0 // indirect\n\tgolang.org/x/text v0.9.0 // indirect\n\tgoogle.golang.org/appengine v1.6.7 // indirect\n\tgoogle.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf // indirect\n\tgoogle.golang.org/protobuf v1.27.1 // indirect\n\tgopkg.in/warnings.v0 v0.1.2 // indirect\n)\n",
"status_code": 200
},
"golang.org/x/vulndb/@v/v0.0.0-20230522180520-0cbf4ffdb4e7.mod": {
"body": "module golang.org/x/vulndb\n\ngo 1.18\n\nrequire (\n\tgolang.org/x/vuln v0.0.0-20230217204342-b91abcc5ae3c\n\tgolang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect\n)\n\nrequire (\n\tcloud.google.com/go/errorreporting v0.1.0\n\tcloud.google.com/go/firestore v1.6.1\n\tgithub.com/GoogleCloudPlatform/opentelemetry-operations-go v1.0.0\n\tgithub.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.26.0\n\tgithub.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.0.0\n\tgithub.com/client9/misspell v0.3.4\n\tgithub.com/go-git/go-billy/v5 v5.3.1\n\tgithub.com/go-git/go-git/v5 v5.4.2\n\tgithub.com/google/go-cmp v0.5.8\n\tgithub.com/google/go-github/v41 v41.0.0\n\tgithub.com/google/safehtml v0.0.2\n\tgithub.com/jba/templatecheck v0.6.0\n\tgithub.com/shurcooL/githubv4 v0.0.0-20220115235240-a14260e6f8a2\n\tgo.opentelemetry.io/otel v1.4.0\n\tgo.opentelemetry.io/otel/sdk v1.4.0\n\tgolang.org/x/exp v0.0.0-20220722155223-a9213eeb770e\n\tgolang.org/x/exp/event v0.0.0-20220218215828-6cf2b201936e\n\tgolang.org/x/mod v0.10.0\n\tgolang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8\n\tgolang.org/x/sync v0.2.0\n\tgolang.org/x/time v0.0.0-20191024005414-555d28b269f0\n\tgolang.org/x/tools v0.9.1\n\tgoogle.golang.org/api v0.70.0\n\tgoogle.golang.org/grpc v1.44.0\n\tgopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c\n\thonnef.co/go/tools v0.2.2\n\tmvdan.cc/unparam v0.0.0-20220926085101-66de63301820\n)\n\nrequire (\n\tcloud.google.com/go v0.100.2 // indirect\n\tcloud.google.com/go/compute v1.3.0 // indirect\n\tcloud.google.com/go/monitoring v1.2.0 // indirect\n\tcloud.google.com/go/trace v1.0.0 // indirect\n\tgithub.com/BurntSushi/toml v0.3.1 // indirect\n\tgithub.com/Microsoft/go-winio v0.4.16 // indirect\n\tgithub.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect\n\tgithub.com/acomagu/bufpipe v1.0.3 // indirect\n\tgithub.com/emirpasic/gods v1.12.0 // indirect\n\tgithub.com/go-git/gcfg v1.5.0 // indirect\n\tgithub.com/go-logr/logr v1.2.2 // indirect\n\tgithub.com/go-logr/stdr v1.2.2 // indirect\n\tgithub.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect\n\tgithub.com/golang/protobuf v1.5.2 // indirect\n\tgithub.com/google/go-querystring v1.1.0 // indirect\n\tgithub.com/googleapis/gax-go/v2 v2.1.1 // indirect\n\tgithub.com/imdario/mergo v0.3.12 // indirect\n\tgithub.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect\n\tgithub.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect\n\tgithub.com/mitchellh/go-homedir v1.1.0 // indirect\n\tgithub.com/sergi/go-diff v1.1.0 // indirect\n\tgithub.com/shurcooL/graphql v0.0.0-20200928012149-18c5c3165e3a // indirect\n\tgithub.com/xanzy/ssh-agent v0.3.0 // indirect\n\tgo.opencensus.io v0.23.0 // indirect\n\tgo.opentelemetry.io/otel/internal/metric v0.27.0 // indirect\n\tgo.opentelemetry.io/otel/metric v0.27.0 // indirect\n\tgo.opentelemetry.io/otel/sdk/export/metric v0.26.0 // indirect\n\tgo.opentelemetry.io/otel/sdk/metric v0.26.0 // indirect\n\tgo.opentelemetry.io/otel/trace v1.4.0 // indirect\n\tgolang.org/x/crypto v0.1.0 // indirect\n\tgolang.org/x/net v0.10.0 // indirect\n\tgolang.org/x/sys v0.8.0 // indirect\n\tgolang.org/x/text v0.9.0 // indirect\n\tgoogle.golang.org/appengine v1.6.7 // indirect\n\tgoogle.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf // indirect\n\tgoogle.golang.org/protobuf v1.27.1 // indirect\n\tgopkg.in/warnings.v0 v0.1.2 // indirect\n)\n",
"status_code": 200
}
}
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/proxy/testdata/proxy/TestVersions.json
|
{
"github.com/!robots!and!pencils/go-saml/@v/list": {
"status_code": 200
},
"golang.org/x/vuln/@v/list": {
"body": "v1.0.0\nv0.1.0\nv1.0.1\nv0.2.0\n",
"status_code": 200
},
"golang.org/x/vulndb/@v/list": {
"status_code": 200
}
}
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/proxy/testdata/proxy/TestModuleExists.json
|
{
"example.com/not/a/module/@latest": {
"status_code": 404
},
"github.com/!robots!and!pencils/go-saml/@latest": {
"body": "{\"Version\":\"v0.0.0-20230606195814-29020529affc\",\"Time\":\"2023-06-06T19:58:14Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/RobotsAndPencils/go-saml\",\"Hash\":\"29020529affcd0311cd1db1f517819ae8e12d6a5\"}}",
"status_code": 200
},
"k8s.io/kubernetes/@latest": {
"body": "{\"Version\":\"v1.30.2\",\"Time\":\"2024-06-11T20:20:59Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/kubernetes/kubernetes\",\"Ref\":\"refs/tags/v1.30.2\",\"Hash\":\"39683505b630ff2121012f3c5b16215a1449d5ed\"}}",
"status_code": 200
}
}
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/proxy/testdata/proxy/TestFindModule.json
|
{
"example.co.io/@latest": {
"status_code": 404
},
"example.co.io/module/@latest": {
"status_code": 404
},
"example.co.io/module/package/@latest": {
"status_code": 404
},
"example.co.io/module/package/src/@latest": {
"status_code": 404
},
"example.co.io/module/package/src/versions/@latest": {
"status_code": 404
},
"example.co.io/module/package/src/versions/v8/@latest": {
"status_code": 404
},
"github.com/!robots!and!pencils/go-saml/@latest": {
"body": "{\"Version\":\"v0.0.0-20230606195814-29020529affc\",\"Time\":\"2023-06-06T19:58:14Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/RobotsAndPencils/go-saml\",\"Hash\":\"29020529affcd0311cd1db1f517819ae8e12d6a5\"}}",
"status_code": 200
},
"github.com/!robots!and!pencils/go-saml/util/@latest": {
"status_code": 404
},
"k8s.io/kubernetes/staging/src/k8s.io/apiserver/@latest": {
"body": "{\"Version\":\"v0.0.0-20240627144517-41f21823f5c4\",\"Time\":\"2024-06-27T14:45:17Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/kubernetes/kubernetes\",\"Subdir\":\"staging/src/k8s.io/apiserver\",\"Hash\":\"41f21823f5c41528cbbe7cd39827afe25fa28c1e\"}}",
"status_code": 200
},
"k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/@latest": {
"status_code": 404
},
"k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/server/@latest": {
"status_code": 404
}
}
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/proxy/testdata/proxy/TestModuleExistsAtTaggedVersion.json
|
{
"github.com/!masterminds/squirrel/@v/list": {
"body": "v1.3.0\nv1.5.1\nv1.5.0\nv1.5.2\nv1.5.4\nv1.4.0\nv1.2.0\nv1.5.3\nv1.1.0\n",
"status_code": 200
},
"github.com/golang/vuln/@v/list": {
"body": "v1.0.2\nv1.0.0\nv1.1.1\nv1.0.3\nv1.1.2\nv1.0.4\nv0.1.0\nv1.0.1\nv1.1.0\nv0.2.0\n",
"status_code": 200
},
"golang.org/x/notamod/@v/list": {
"status_code": 404
},
"golang.org/x/vuln/@v/list": {
"body": "v1.0.2\nv1.0.0\nv1.1.1\nv1.0.3\nv1.1.2\nv1.0.4\nv0.1.0\nv1.0.1\nv1.1.0\nv0.2.0\n",
"status_code": 200
},
"golang.org/x/vulndb/@v/list": {
"status_code": 200
}
}
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/proxy/testdata/proxy/TestLatest.json
|
{
"github.com/!robots!and!pencils/go-saml/@latest": {
"body": "{\"Version\":\"v0.0.0-20230606195814-29020529affc\",\"Time\":\"2023-06-06T19:58:14Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/RobotsAndPencils/go-saml\",\"Hash\":\"29020529affcd0311cd1db1f517819ae8e12d6a5\"}}",
"status_code": 200
},
"golang.org/x/vuln/@latest": {
"body": "{\"Version\":\"v1.0.1\",\"Time\":\"2023-08-17T17:30:53Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/vuln\",\"Ref\":\"refs/tags/v1.0.1\",\"Hash\":\"da4b74a5408a0116e9a2dde953659a7b0956dc56\"}}",
"status_code": 200
},
"golang.org/x/vulndb/@latest": {
"body": "{\"Version\":\"v0.0.0-20230911193511-c7cbbd05f085\",\"Time\":\"2023-09-11T19:35:11Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/vulndb\",\"Hash\":\"c7cbbd05f085e3127d7d29048cdfd474d42964f0\"}}",
"status_code": 200
}
}
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/proxy/testdata/proxy/TestCanonicalModuleVersion.json
|
{
"github.com/!robots!and!pencils/go-saml/@v/v0.0.0-20230606195814-29020529affc.info": {
"body": "{\"Version\":\"v0.0.0-20230606195814-29020529affc\",\"Time\":\"2023-06-06T19:58:14Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/RobotsAndPencils/go-saml\",\"Hash\":\"29020529affcd0311cd1db1f517819ae8e12d6a5\"}}",
"status_code": 200
},
"golang.org/x/vuln/@v/v0.1.0.info": {
"body": "{\"Version\":\"v0.1.0\",\"Time\":\"2023-04-24T18:46:43Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/vuln\",\"Ref\":\"refs/tags/v0.1.0\",\"Hash\":\"b43f5afc876383b2adc0ec0d3ff1998fe58eeda0\"}}",
"status_code": 200
},
"golang.org/x/vulndb/@v/0cbf4ffdb4e70fce663ec8d59198745b04e7801b.info": {
"body": "{\"Version\":\"v0.0.0-20230522180520-0cbf4ffdb4e7\",\"Time\":\"2023-05-22T18:05:20Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/vulndb\",\"Hash\":\"0cbf4ffdb4e70fce663ec8d59198745b04e7801b\"}}",
"status_code": 200
},
"golang.org/x/vulndb/@v/v0.0.0-20230522180520-0cbf4ffdb4e7.info": {
"body": "{\"Version\":\"v0.0.0-20230522180520-0cbf4ffdb4e7\",\"Time\":\"2023-05-22T18:05:20Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/vulndb\",\"Hash\":\"0cbf4ffdb4e70fce663ec8d59198745b04e7801b\"}}",
"status_code": 200
}
}
|
stdlib
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/stdlib/stdlib.go
|
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package stdlib contains functionality relevant to the Go Standard Library.
package stdlib
import (
"strings"
"golang.org/x/mod/module"
)
const (
// ModulePath is the name of the Go standard library module.
ModulePath = "std"
// ToolchainModulePath is the name of the module containing Go
// toolchain binaries.
ToolchainModulePath = "cmd"
)
// Contains reports whether the given import path could be part of the Go
// standard library, by reporting whether the first component lacks a '.'.
func Contains(path string) bool {
if err := module.CheckImportPath(path); err != nil {
return false
}
if i := strings.IndexByte(path, '/'); i != -1 {
path = path[:i]
}
return !strings.Contains(path, ".")
}
func IsStdModule(path string) bool {
return path == ModulePath
}
func IsCmdModule(path string) bool {
return path == ToolchainModulePath
}
func IsXModule(path string) bool {
return strings.HasPrefix(path, "golang.org/x/")
}
|
stdlib
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/stdlib/stdlib_test.go
|
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package stdlib
import "testing"
func TestContains(t *testing.T) {
for _, test := range []struct {
in string
want bool
}{
{"", false},
{"math/crypto", true},
{"github.com/pkg/errors", false},
{"Path is unknown", false},
} {
got := Contains(test.in)
if got != test.want {
t.Errorf("%q: got %t, want %t", test.in, got, test.want)
}
}
}
|
cve5
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/cveschema5.go
|
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// package cve5 contains the schema for a CVE Record in CVE JSON 5.0
// format. The package implements a subset of the schema needed to
// publish reports for the vulnerability database.
//
// https://github.com/CVEProject/cve-schema/blob/master/schema/v5.0/CVE_JSON_5.0_schema.json
// contains the full JSON schema and documentation for each field.
package cve5
import (
"encoding/json"
"os"
)
type CVERecord struct {
DataType string `json:"dataType"`
DataVersion string `json:"dataVersion"`
Metadata Metadata `json:"cveMetadata"`
Containers Containers `json:"containers"`
}
type State string
const (
StateReserved State = "RESERVED"
StatePublished State = "PUBLISHED"
StateRejected State = "REJECTED"
)
type Metadata struct {
ID string `json:"cveId"`
OrgID string `json:"assignerOrgId,omitempty"`
Serial int `json:"serial,omitempty"`
State State `json:"state,omitempty"`
}
type Containers struct {
CNAContainer CNAPublishedContainer `json:"cna"`
}
type CNAPublishedContainer struct {
ProviderMetadata ProviderMetadata `json:"providerMetadata"`
Title string `json:"title,omitempty"`
Descriptions []Description `json:"descriptions"`
Affected []Affected `json:"affected"`
ProblemTypes []ProblemType `json:"problemTypes,omitempty"`
References []Reference `json:"references"`
Credits []Credit `json:"credits,omitempty"`
}
type ProviderMetadata struct {
OrgID string `json:"orgId"`
}
type Description struct {
Lang string `json:"lang"`
Value string `json:"value"`
}
type Affected struct {
Vendor string `json:"vendor,omitempty"`
Product string `json:"product,omitempty"`
CollectionURL string `json:"collectionURL,omitempty"`
PackageName string `json:"packageName,omitempty"`
Versions []VersionRange `json:"versions,omitempty"`
Platforms []string `json:"platforms,omitempty"`
ProgramRoutines []ProgramRoutine `json:"programRoutines,omitempty"`
DefaultStatus VersionStatus `json:"defaultStatus,omitempty"`
}
type ProblemType struct {
Descriptions []ProblemTypeDescription `json:"descriptions"`
}
type ProblemTypeDescription struct {
Lang string `json:"lang"`
Description string `json:"description"`
}
type Reference struct {
URL string `json:"url"`
Tags []string `json:"tags,omitempty"`
}
type Credit struct {
Lang string `json:"lang"`
Value string `json:"value"`
}
type VersionRange struct {
Introduced Version `json:"version"`
Fixed Version `json:"lessThan"`
Status VersionStatus `json:"status"`
VersionType string `json:"versionType"`
// Not used in Go CVEs, but supported in the schema.
LessThanOrEqual Version `json:"lessThanOrEqual,omitempty"`
}
type VersionStatus string
const (
StatusAffected VersionStatus = "affected"
StatusUnaffected VersionStatus = "unaffected"
StatusUnknown VersionStatus = "unknown"
)
type Version string
type ProgramRoutine struct {
Name string `json:"name"`
}
// Read unmarshals the JSON CVE Record in `filename` into a CVE Record.
func Read(filename string) (*CVERecord, error) {
b, err := os.ReadFile(filename)
if err != nil {
return nil, err
}
var record CVERecord
err = json.Unmarshal(b, &record)
if err != nil {
return nil, err
}
return &record, nil
}
// ReadForPublish reads the portion of a CVE record that can be published
// via the CVE Services API from filename.
func ReadForPublish(filename string) (cveID string, toPublish *Containers, err error) {
record, err := Read(filename)
if err != nil {
return "", nil, err
}
return record.Metadata.ID, &record.Containers, nil
}
|
cve5
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/fetch.go
|
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cve5
import (
"context"
"golang.org/x/vulndb/internal/report"
)
// Fetch returns the CVE record associated with the ID.
// It is intended one-off (non-batch) requests, and
// is much faster than cvelistrepo.FetchCVE.
func Fetch(id string) (*CVERecord, error) {
c := NewClient(Config{
Endpoint: ProdEndpoint,
})
return c.RetrieveRecord(id)
}
type cve5Fetcher struct{}
var _ report.Fetcher = &cve5Fetcher{}
func NewFetcher() report.Fetcher {
return &cve5Fetcher{}
}
func (*cve5Fetcher) Fetch(ctx context.Context, id string) (report.Source, error) {
return Fetch(id)
}
|
cve5
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/report.go
|
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cve5
import (
"errors"
"fmt"
"regexp"
"slices"
"strings"
"golang.org/x/vulndb/internal/derrors"
"golang.org/x/vulndb/internal/idstr"
"golang.org/x/vulndb/internal/osv"
"golang.org/x/vulndb/internal/report"
"golang.org/x/vulndb/internal/stdlib"
"golang.org/x/vulndb/internal/version"
)
var (
// The universal unique identifier for the Go Project CNA, which
// needs to be included CVE JSON 5.0 records.
GoOrgUUID = "1bb62c36-49e3-4200-9d77-64a1400537cc"
)
// FromReport creates a CVE in 5.0 format from a YAML report file.
func FromReport(r *report.Report) (_ *CVERecord, err error) {
defer derrors.Wrap(&err, "FromReport(%q)", r.ID)
if r.CVEMetadata == nil {
return nil, errors.New("report missing cve_metadata section")
}
if r.CVEMetadata.ID == "" {
return nil, errors.New("report missing CVE ID")
}
description := r.CVEMetadata.Description
if description == "" {
description = r.Description.String()
}
if r.CVEMetadata.CWE == "" {
return nil, errors.New("report missing CWE")
}
c := &CNAPublishedContainer{
ProviderMetadata: ProviderMetadata{
OrgID: GoOrgUUID,
},
Title: report.RemoveNewlines(r.Summary.String()),
Descriptions: []Description{
{
Lang: "en",
Value: report.RemoveNewlines(description),
},
},
ProblemTypes: []ProblemType{
{
Descriptions: []ProblemTypeDescription{
{
Lang: "en",
Description: r.CVEMetadata.CWE,
},
},
},
},
}
for _, m := range r.Modules {
versions, defaultStatus := versionsToVersionRanges(m.Versions)
for _, p := range m.Packages {
affected := Affected{
Vendor: report.Vendor(m.Module),
Product: p.Package,
CollectionURL: "https://pkg.go.dev",
PackageName: p.Package,
Versions: versions,
DefaultStatus: defaultStatus,
Platforms: p.GOOS,
}
for _, symbol := range p.AllSymbols() {
affected.ProgramRoutines = append(affected.ProgramRoutines, ProgramRoutine{Name: symbol})
}
c.Affected = append(c.Affected, affected)
}
}
for _, ref := range r.References {
c.References = append(c.References, Reference{URL: ref.URL})
}
c.References = append(c.References, Reference{
URL: idstr.GoAdvisory(r.ID),
})
for _, ref := range r.CVEMetadata.References {
c.References = append(c.References, Reference{URL: ref})
}
for _, credit := range r.Credits {
c.Credits = append(c.Credits, Credit{
Lang: "en",
Value: credit,
})
}
return &CVERecord{
DataType: "CVE_RECORD",
DataVersion: "5.0",
Metadata: Metadata{
ID: r.CVEMetadata.ID,
},
Containers: Containers{
CNAContainer: *c,
},
}, nil
}
const (
typeSemver = "semver"
versionZero = "0"
)
func versionsToVersionRanges(vs report.Versions) ([]VersionRange, VersionStatus) {
if len(vs) == 0 {
// If there are no recorded versions affected, we assume all versions are affected.
return nil, StatusAffected
}
var vrs []VersionRange
// If there is no final fixed version, then the default status is
// "affected" and we express the versions in terms of which ranges
// are *unaffected*. This is due to the fact that the CVE schema
// does not allow us to express a range as "version X.X.X and above are affected".
if vs[len(vs)-1].Type != report.VersionTypeFixed {
current := &VersionRange{}
for _, vr := range vs {
if vr.IsIntroduced() {
if current.Introduced == "" {
current.Introduced = versionZero
}
current.Fixed = Version(vr.Version)
current.Status = StatusUnaffected
current.VersionType = typeSemver
vrs = append(vrs, *current)
current = &VersionRange{}
} else if vr.IsFixed() {
current.Introduced = Version(vr.Version)
}
}
return vrs, StatusAffected
}
// Otherwise, express the version ranges normally as affected ranges,
// with a default status of "unaffected".
var current *VersionRange
for _, vr := range vs {
if vr.IsIntroduced() {
if current == nil {
current = &VersionRange{
Status: StatusAffected,
VersionType: typeSemver,
Introduced: Version(vr.Version),
}
}
}
if vr.IsFixed() {
if current == nil {
current = &VersionRange{
Status: StatusAffected,
VersionType: typeSemver,
Introduced: versionZero,
}
}
current.Fixed = Version(vr.Version)
vrs = append(vrs, *current)
current = nil
}
}
return vrs, StatusUnaffected
}
var _ report.Source = &CVERecord{}
func (c *CVERecord) ToReport(modulePath string) *report.Report {
return cve5ToReport(c, modulePath)
}
func (c *CVERecord) SourceID() string {
return c.Metadata.ID
}
func (c *CVERecord) ReferenceURLs() []string {
var result []string
for _, r := range c.Containers.CNAContainer.References {
result = append(result, r.URL)
}
return result
}
func cve5ToReport(c *CVERecord, modulePath string) *report.Report {
cna := c.Containers.CNAContainer
var description report.Description
for _, d := range cna.Descriptions {
if d.Lang == "en" {
description += report.Description(d.Value + "\n")
}
}
var credits []string
for _, c := range cna.Credits {
credits = append(credits, c.Value)
}
var refs []*report.Reference
for _, ref := range c.Containers.CNAContainer.References {
refs = append(refs, convertRef(ref))
}
r := &report.Report{
Modules: affectedToModules(cna.Affected, modulePath),
Summary: report.Summary(cna.Title),
Description: description,
Credits: credits,
References: refs,
}
r.AddCVE(c.Metadata.ID, getCWE5(&cna), isGoCNA5(&cna))
return r
}
func convertRef(ref Reference) *report.Reference {
if t := typeFromTags(ref.Tags); t != osv.ReferenceTypeWeb {
return &report.Reference{
Type: t,
URL: ref.URL,
}
}
return report.ReferenceFromUrl(ref.URL)
}
const (
refTagIssue = "issue-tracking"
refTagMailingList = "mailing-list"
refTagPatch = "patch"
refTagReleaseNotes = "release-notes"
refTag3PAdvisory = "third-party-advisory"
refTagVendorAdvisory = "vendor-advisory"
refTagVdbEntry = "vdb-entry"
refTagMedia = "media-coverage"
refTagTechnical = "technical-description"
refTagRelated = "related"
refTagGovt = "government resource"
refTagMitigation = "mitigation"
// uncategorized:
// "broken-link"
// "customer-entitlement"
// "not-applicable"
// "permissions-required"
// "product"
// "signature"
)
func tagToType(tag string) osv.ReferenceType {
switch tag {
case refTagVendorAdvisory:
return osv.ReferenceTypeAdvisory
case refTagIssue:
return osv.ReferenceTypeReport
case refTagPatch:
return osv.ReferenceTypeFix
}
return defaultType
}
var order = []osv.ReferenceType{
osv.ReferenceTypeAdvisory,
osv.ReferenceTypeFix,
osv.ReferenceTypeReport,
osv.ReferenceTypeWeb,
}
var defaultType = osv.ReferenceTypeWeb
func bestType(types []osv.ReferenceType) osv.ReferenceType {
if len(types) == 0 {
return defaultType
} else if len(types) == 1 {
return types[0]
}
slices.SortStableFunc(types, func(a, b osv.ReferenceType) int {
if a == b {
return 0
}
for _, t := range order {
if a == t {
return -1
}
if b == t {
return 1
}
}
return 0
})
return types[0]
}
func typeFromTags(tags []string) osv.ReferenceType {
var types []osv.ReferenceType
for _, tag := range tags {
if t := tagToType(tag); t != "" {
types = append(types, t)
}
}
return bestType(types)
}
func getCWE5(c *CNAPublishedContainer) string {
if len(c.ProblemTypes) == 0 || len(c.ProblemTypes[0].Descriptions) == 0 {
return ""
}
return c.ProblemTypes[0].Descriptions[0].Description
}
func isGoCNA5(c *CNAPublishedContainer) bool {
return c.ProviderMetadata.OrgID == GoOrgUUID
}
func affectedToModules(as []Affected, modulePath string) []*report.Module {
// Use a placeholder module if there is no information on
// modules/packages in the CVE.
if len(as) == 0 {
return []*report.Module{{
Module: modulePath,
}}
}
var modules []*report.Module
for _, a := range as {
modules = append(modules, affectedToModule(&a, modulePath))
}
return modules
}
func affectedToModule(a *Affected, modulePath string) *report.Module {
var pkgPath string
isSet := func(s string) bool {
const na = "n/a"
return s != "" && s != na
}
switch {
case isSet(a.PackageName):
pkgPath = a.PackageName
case isSet(a.Product):
pkgPath = a.Product
case isSet(a.Vendor):
pkgPath = a.Vendor
default:
pkgPath = modulePath
}
// If the package path is just a suffix of the modulePath,
// it is probably not useful.
if strings.HasSuffix(modulePath, pkgPath) {
pkgPath = modulePath
}
// If the package path doesn't have any slashes, it probably
// is not useful.
if !strings.Contains(pkgPath, "/") {
pkgPath = modulePath
}
if stdlib.Contains(modulePath) && stdlib.Contains(pkgPath) {
if strings.HasPrefix(pkgPath, stdlib.ToolchainModulePath) {
modulePath = stdlib.ToolchainModulePath
} else {
modulePath = stdlib.ModulePath
}
}
vs, uvs := convertVersions(a.Versions, a.DefaultStatus)
// Add a package if we have any meaningful package-level data.
var pkgs []*report.Package
if pkgPath != modulePath || len(a.ProgramRoutines) != 0 || len(a.Platforms) != 0 {
var symbols []string
for _, s := range a.ProgramRoutines {
symbols = append(symbols, s.Name)
}
pkgs = []*report.Package{
{
Package: pkgPath,
Symbols: symbols,
GOOS: a.Platforms,
},
}
}
return &report.Module{
Module: modulePath,
Versions: vs,
UnsupportedVersions: uvs,
Packages: pkgs,
}
}
func convertVersions(vrs []VersionRange, defaultStatus VersionStatus) (vs report.Versions, uvs report.Versions) {
for _, vr := range vrs {
// Version ranges starting with "n/a" don't have any meaningful data.
if vr.Introduced == "n/a" {
continue
}
v, ok := toVersions(&vr, defaultStatus)
if ok {
vs = append(vs, v...)
continue
}
uvs = append(uvs, toUnsupported(&vr, defaultStatus))
}
return vs, uvs
}
var (
// Regex for matching version strings like "<= X, < Y".
introducedFixedRE = regexp.MustCompile(`^>= (.+), < (.+)$`)
// Regex for matching version strings like "< Y".
fixedRE = regexp.MustCompile(`^< (.+)$`)
)
func toVersions(cvr *VersionRange, defaultStatus VersionStatus) (report.Versions, bool) {
intro, fixed := version.TrimPrefix(string(cvr.Introduced)), version.TrimPrefix(string(cvr.Fixed))
// Handle special cases where the info is not quite correctly encoded but
// we can still figure out the intent.
// Case one: introduced version is of the form "<= X, < Y".
if m := introducedFixedRE.FindStringSubmatch(intro); len(m) == 3 {
return report.Versions{
report.Introduced(m[1]),
report.Fixed(m[2]),
}, true
}
// Case two: introduced version is of the form "< Y".
if m := fixedRE.FindStringSubmatch(intro); len(m) == 2 {
return report.Versions{
report.Fixed(m[1]),
}, true
}
// For now, don't attempt to fix any other messed up cases.
if cvr.VersionType != typeSemver ||
cvr.LessThanOrEqual != "" ||
!version.IsValid(intro) ||
!version.IsValid(fixed) ||
cvr.Status != StatusAffected ||
defaultStatus != StatusUnaffected {
return nil, false
}
if intro == "0" {
return report.Versions{
report.Fixed(fixed),
}, true
}
return report.Versions{
report.Introduced(intro), report.Fixed(fixed),
}, true
}
func toUnsupported(cvr *VersionRange, defaultStatus VersionStatus) *report.Version {
var version string
switch {
case cvr.Fixed != "":
version = fmt.Sprintf("%s from %s before %s", cvr.Status, cvr.Introduced, cvr.Fixed)
case cvr.LessThanOrEqual != "":
version = fmt.Sprintf("%s from %s to %s", cvr.Status, cvr.Introduced, cvr.LessThanOrEqual)
default:
version = fmt.Sprintf("%s at %s", cvr.Status, cvr.Introduced)
}
if defaultStatus != "" {
version = fmt.Sprintf("%s (default: %s)", version, defaultStatus)
}
return &report.Version{
Version: version,
Type: "cve_version_range",
}
}
|
cve5
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/cveclient.go
|
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cve5
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
"time"
)
const (
// ProdEndpoint is the production endpoint
ProdEndpoint = "https://cveawg.mitre.org"
// TestEndpoint is the test endpoint
TestEndpoint = "https://cveawg-test.mitre.org"
// DevEndpoint is the dev endpoint
DevEndpoint = "https://cveawg-dev.mitre.org"
// WebURL is the URL to view production CVE records on the web.
WebURL = "https://www.cve.org"
// TestWebURL is the URL to view test CVE records on the web.
TestWebURL = "https://test.cve.org"
)
// Client is a MITRE CVE Services API client,
// as described at https://cveawg.mitre.org/api-docs/openapi.json.
type Client struct {
Config
c *http.Client
}
// WebURL returns the URL that can be used to view a published
// CVE record on the web.
func (c *Client) WebURL(cveID string) string {
baseURL := WebURL
if c.Config.Endpoint == TestEndpoint {
baseURL = TestWebURL
}
return fmt.Sprintf("%s/CVERecord?id=%s", baseURL, cveID)
}
// Config contains client configuration data.
type Config struct {
// Endpoint is the endpoint to access when making API calls. Required.
Endpoint string
// Org is the shortname for the organization that is authenticated when
// making API calls. Required.
Org string
// Key is the user's API key. Required.
Key string
// User is the username for the account that is making API calls. Required.
User string
}
// NewClient returns an initialized client configured via cfg.
func NewClient(cfg Config) *Client {
return &Client{cfg, http.DefaultClient}
}
// AssignedCVE contains information about an assigned CVE.
type AssignedCVE struct {
ID string `json:"cve_id"`
Year string `json:"cve_year"`
State State `json:"state"`
CNA string `json:"owning_cna"`
Reserved time.Time `json:"reserved"`
RequestedBy RequestedBy `json:"requested_by"`
}
// RequestedBy indicates the requesting user and organization for a CVE.
type RequestedBy struct {
CNA string `json:"cna"`
User string `json:"user"`
}
func (c AssignedCVE) String() string {
return fmt.Sprintf("%s: state=%s, cna=%s, requester=%s", c.ID, c.State, c.CNA, c.RequestedBy.User)
}
// AssignedCVEList is a list of AssignedCVEs.
type AssignedCVEList []AssignedCVE
// ShortString outputs a formatted string of newline-separated CVE IDs.
func (cs AssignedCVEList) ShortString() string {
strs := []string{}
for _, c := range cs {
strs = append(strs, c.ID)
}
return strings.Join(strs, "\n")
}
// String outputs a formatted string of newline-separated CVE data.
func (cs AssignedCVEList) String() string {
strs := []string{}
for _, c := range cs {
strs = append(strs, c.String())
}
return strings.Join(strs, "\n")
}
// ReserveOptions contains the configuration options for reserving new
// CVE IDs.
type ReserveOptions struct {
// NumIDs is the number of CVE IDs to reserve. Required.
NumIDs int
// Year is the CVE ID year for new IDs, indicating the year the
// vulnerability was discovered. Required.
Year int
// Mode indicates whether the block of CVEs should be in sequence.
// Relevant only if NumIDs > 1.
Mode RequestType
}
// RequestType is the type of CVE ID reserve request.
type RequestType string
const (
// SequentialRequest requests CVE IDs be reserved in a sequential fashion.
SequentialRequest RequestType = "sequential"
// NonsequentialRequest requests CVE IDs be reserved in a nonsequential fashion.
NonsequentialRequest RequestType = "nonsequential"
)
func (o *ReserveOptions) urlParams(org string) url.Values {
params := url.Values{}
params.Set("amount", fmt.Sprint(o.NumIDs))
if o.Year != 0 {
params.Set("cve_year", strconv.Itoa(o.Year))
}
params.Set("short_name", org)
if o.NumIDs > 1 {
params.Set("batch_type", string(o.Mode))
}
return params
}
func (c *Client) createReserveIDsRequest(opts ReserveOptions) (*http.Request, error) {
req, err := c.createRequest(http.MethodPost,
c.requestURL(cveIDTarget), nil)
if err != nil {
return nil, err
}
req.URL.RawQuery = opts.urlParams(c.Org).Encode()
return req, err
}
type rejectReason struct {
Container container `json:"cnaContainer"`
}
type container struct {
Reasons []Description `json:"rejectedReasons"`
}
func (c *Client) Reject(id, reason string) error {
reqBody := rejectReason{
Container: container{
Reasons: []Description{{
Lang: "en",
Value: reason,
}},
},
}
var resp CVERecord
return c.queryAPI(http.MethodPost, c.requestURL(cveTarget, id, rejectTarget), reqBody, &resp)
}
type reserveIDsResponse struct {
CVEs AssignedCVEList `json:"cve_ids"`
}
// ReserveIDs sends a request to the CVE API to reserve a block of CVE IDs.
// Returns a list of the reserved CVE IDs and their associated data.
// There may be fewer IDs than requested if, for example, the organization's
// quota is reached.
func (c *Client) ReserveIDs(opts ReserveOptions) (AssignedCVEList, error) {
req, err := c.createReserveIDsRequest(opts)
if err != nil {
return nil, err
}
var assigned reserveIDsResponse
checkStatus := func(s int) bool {
return s == http.StatusOK || s == http.StatusPartialContent
}
err = c.sendRequest(req, checkStatus, &assigned)
if err != nil {
return nil, err
}
return assigned.CVEs, nil
}
// Quota contains information about an organizations reservation quota.
type Quota struct {
Quota int `json:"id_quota"`
Reserved int `json:"total_reserved"`
Available int `json:"available"`
}
// RetrieveQuota queries the API for the organizations reservation quota.
func (c *Client) RetrieveQuota() (q *Quota, err error) {
err = c.queryAPI(http.MethodGet, c.requestURL(orgTarget, c.Org, quotaTarget), nil, &q)
return
}
// RetrieveID requests information about an assigned CVE ID.
func (c *Client) RetrieveID(id string) (cve *AssignedCVE, err error) {
err = c.queryAPI(http.MethodGet, c.requestURL(cveIDTarget, id), nil, &cve)
return
}
// RetrieveRecord requests a CVE record.
func (c *Client) RetrieveRecord(id string) (cve *CVERecord, err error) {
err = c.queryAPI(http.MethodGet, c.requestURL(cveTarget, id), nil, &cve)
return
}
func (c *Client) cveRecordEndpoint(cveID string) string {
return c.requestURL(cveTarget, cveID, cnaTarget)
}
type recordRequestBody struct {
CNAContainer CNAPublishedContainer `json:"cnaContainer"`
}
type createResponse struct {
Created CVERecord `json:"created"`
}
func (c *Client) CreateRecord(id string, record *Containers) (*CVERecord, error) {
requestBody := recordRequestBody{
CNAContainer: record.CNAContainer,
}
var response createResponse
err := c.queryAPI(http.MethodPost, c.cveRecordEndpoint(id), requestBody, &response)
if err != nil {
return nil, err
}
return &response.Created, nil
}
type updateResponse struct {
Updated CVERecord `json:"updated"`
}
func (c *Client) UpdateRecord(id string, record *Containers) (*CVERecord, error) {
requestBody := recordRequestBody{
CNAContainer: record.CNAContainer,
}
var response updateResponse
err := c.queryAPI(http.MethodPut, c.cveRecordEndpoint(id), requestBody, &response)
if err != nil {
return nil, err
}
return &response.Updated, nil
}
type Org struct {
Name string `json:"name"`
ShortName string `json:"short_name"`
UUID string `json:"UUID"`
}
// RetrieveOrg requests information about an organization.
func (c *Client) RetrieveOrg() (org *Org, err error) {
err = c.queryAPI(http.MethodGet, c.requestURL(orgTarget, c.Org), nil, &org)
return
}
// ListOptions contains filters to be used when requesting a list of
// assigned CVEs.
type ListOptions struct {
State State
Year int
ReservedBefore *time.Time
ReservedAfter *time.Time
ModifiedBefore *time.Time
ModifiedAfter *time.Time
}
func (o ListOptions) String() string {
var s []string
if o.State != "" {
s = append(s, fmt.Sprintf("state=%s", o.State))
}
if o.Year != 0 {
s = append(s, fmt.Sprintf("year=%d", o.Year))
}
if o.ReservedBefore != nil {
s = append(s, fmt.Sprintf("reserved_before=%s", o.ReservedBefore.Format(time.RFC3339)))
}
if o.ReservedAfter != nil {
s = append(s, fmt.Sprintf("reserved_after=%s", o.ReservedAfter.Format(time.RFC3339)))
}
if o.ModifiedBefore != nil {
s = append(s, fmt.Sprintf("modified_before=%s", o.ModifiedBefore.Format(time.RFC3339)))
}
if o.ModifiedAfter != nil {
s = append(s, fmt.Sprintf("modified_after=%s", o.ModifiedAfter.Format(time.RFC3339)))
}
return strings.Join(s, ", ")
}
func (o *ListOptions) urlParams() url.Values {
params := url.Values{}
if o == nil {
return params
}
if o.State != "" {
params.Set("state", string(o.State))
}
if o.Year != 0 {
params.Set("cve_id_year", strconv.Itoa(o.Year))
}
if o.ReservedBefore != nil {
params.Set("time_reserved.lt", o.ReservedBefore.Format(time.RFC3339))
}
if o.ReservedAfter != nil {
params.Set("time_reserved.gt", o.ReservedAfter.Format(time.RFC3339))
}
if o.ModifiedBefore != nil {
params.Set("time_modified.lt", o.ModifiedBefore.Format(time.RFC3339))
}
if o.ModifiedAfter != nil {
params.Set("time_modified.gt", o.ModifiedAfter.Format(time.RFC3339))
}
return params
}
type listOrgCVEsResponse struct {
CurrentPage int `json:"currentPage"`
NextPage int `json:"nextPage"`
CVEs AssignedCVEList `json:"cve_ids"`
}
func (c Client) createListOrgCVEsRequest(opts *ListOptions, page int) (req *http.Request, err error) {
req, err = c.createRequest(http.MethodGet, c.requestURL(cveIDTarget), nil)
if err != nil {
return nil, err
}
params := opts.urlParams()
if page > 0 {
params.Set("page", fmt.Sprint(page))
}
req.URL.RawQuery = params.Encode()
return
}
// ListOrgCVEs requests information about the CVEs the organization has been
// assigned. This list can be filtered by setting the fields in opts.
func (c *Client) ListOrgCVEs(opts *ListOptions) (AssignedCVEList, error) {
var cves []AssignedCVE
page := 0
for {
req, err := c.createListOrgCVEsRequest(opts, page)
if err != nil {
return nil, err
}
var result listOrgCVEsResponse
err = c.sendRequest(req, nil, &result)
if err != nil {
return nil, err
}
cves = append(cves, result.CVEs...)
if result.NextPage <= result.CurrentPage {
break
}
page = result.NextPage
}
return cves, nil
}
func (c *Client) queryAPI(method, url string, requestBody any, response any) error {
req, err := c.createRequest(method, url, requestBody)
if err != nil {
return err
}
err = c.sendRequest(req, nil, response)
if err != nil {
return err
}
return nil
}
var (
headerApiUser = "CVE-API-USER"
headerApiOrg = "CVE-API-ORG"
headerApiKey = "CVE-API-KEY"
)
// createRequest creates a new HTTP request and sets the header fields.
func (c *Client) createRequest(method, url string, body any) (*http.Request, error) {
var r io.Reader
if body != nil {
b, err := json.Marshal(body)
if err != nil {
return nil, err
}
r = bytes.NewReader(b)
}
req, err := http.NewRequest(method, url, r)
if err != nil {
return nil, err
}
req.Header.Set(headerApiUser, c.User)
req.Header.Set(headerApiOrg, c.Org)
req.Header.Set(headerApiKey, c.Key)
req.Header.Set("Content-Type", "application/json")
return req, nil
}
// sendRequest sends an HTTP request, checks the returned status via
// checkStatus, and attempts to unmarshal the response into result.
// if checkStatus is nil, checks for http.StatusOK.
func (c *Client) sendRequest(req *http.Request, checkStatus func(int) bool, result any) (err error) {
resp, err := c.c.Do(req)
if err != nil {
return fmt.Errorf("could not send HTTP request: %v", err)
}
defer resp.Body.Close()
if checkStatus == nil {
checkStatus = func(s int) bool {
return s == http.StatusOK
}
}
if !checkStatus(resp.StatusCode) {
return fmt.Errorf("HTTP request %s %q returned error: %v", req.Method, req.URL, extractError(resp))
}
body, err := io.ReadAll(resp.Body)
if err != nil {
return err
}
if err := json.Unmarshal(body, result); err != nil {
return err
}
return nil
}
var (
cveTarget = "cve"
cveIDTarget = "cve-id"
orgTarget = "org"
quotaTarget = "id_quota"
cnaTarget = "cna"
rejectTarget = "reject"
)
func (c *Client) requestURL(targets ...string) string {
return fmt.Sprintf("%s/api/%s", c.Endpoint, strings.Join(targets, "/"))
}
type apiError struct {
Error string `json:"error"`
Message string `json:"message"`
Detail apiErrorDetail `json:"details"`
}
type apiErrorDetail struct {
Errors []apiErrorInner `json:"errors"`
}
type apiErrorInner struct {
InstancePath string `json:"instancePath"`
Message string `json:"message"`
}
// extractError extracts additional error messages from the HTTP response
// if available, and wraps them into a single error.
func extractError(resp *http.Response) error {
errMsg := resp.Status
body, err := io.ReadAll(resp.Body)
if err != nil {
return fmt.Errorf("%s: could not read error data: %s", errMsg, err)
}
var apiErr apiError
if err := json.Unmarshal(body, &apiErr); err != nil {
return fmt.Errorf("%s: could not unmarshal error: %s", errMsg, err)
}
// Append the error and message text if they add extra information
// beyond the HTTP status text.
statusText := strings.ToLower(http.StatusText(resp.StatusCode))
for _, errText := range []string{apiErr.Error, apiErr.Message} {
if errText != "" && strings.ToLower(errText) != statusText {
errMsg = fmt.Sprintf("%s: %s", errMsg, errText)
}
}
for _, detail := range apiErr.Detail.Errors {
errMsg = fmt.Sprintf("%s\n %s: %s", errMsg, detail.InstancePath, detail.Message)
}
return fmt.Errorf(errMsg)
}
|
cve5
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/cveschema5_test.go
|
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cve5
import (
"reflect"
"testing"
)
var basicExampleRecord = &CVERecord{
DataType: "CVE_RECORD",
DataVersion: "5.0",
Metadata: Metadata{
ID: "CVE-2022-0000",
OrgID: "b3476cb9-2e3d-41a6-98d0-0f47421a65b6",
State: StatePublished,
},
Containers: Containers{
CNAContainer: CNAPublishedContainer{
ProviderMetadata: ProviderMetadata{
OrgID: "b3476cb9-2e3d-41a6-98d0-0f47421a65b6",
},
ProblemTypes: []ProblemType{
{
Descriptions: []ProblemTypeDescription{
{
Lang: "en",
Description: "CWE-78 OS Command Injection",
},
},
},
},
Descriptions: []Description{
{
Lang: "en",
Value: "OS Command Injection vulnerability parseFilename function of example.php in the Web Management Interface of Example.org Example Enterprise on Windows, MacOS and XT-4500 allows remote unauthenticated attackers to escalate privileges.\n\nThis issue affects:\n * 1.0 versions before 1.0.6\n * 2.1 versions from 2.16 until 2.1.9.",
},
},
Affected: []Affected{
{
Vendor: "Example.org",
Product: "Example Enterprise",
Versions: []VersionRange{
{
Introduced: "1.0.0",
Fixed: "1.0.6",
Status: StatusAffected,
VersionType: "semver",
},
},
DefaultStatus: StatusUnaffected,
},
},
References: []Reference{
{
URL: "https://example.org/ESA-22-11-CVE-2022-0000",
},
},
},
},
}
func TestRead(t *testing.T) {
f := "testdata/basic_example.json"
record, err := Read("testdata/basic-example.json")
if err != nil {
t.Fatalf("Read(%s) failed unexpectedly; err=%v", f, err)
}
if got, want := record, basicExampleRecord; !reflect.DeepEqual(got, want) {
t.Errorf("Read(%s) = %v\n want %v", f, got, want)
}
}
|
cve5
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/cveclient_test.go
|
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cve5
import (
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"net/url"
"reflect"
"strconv"
"strings"
"testing"
"time"
)
const (
testApiKey = "test_api_key"
testApiOrg = "test_api_org"
testApiUser = "test_api_user"
defaultTestCVEID = "CVE-2022-0000"
)
var (
defaultTestCVE = newTestCVE(defaultTestCVEID, StateReserved, "2022")
defaultTestCVEs = AssignedCVEList{
defaultTestCVE,
newTestCVE("CVE-2022-0001", StateReserved, "2022")}
defaultTestQuota = &Quota{
Quota: 10,
Reserved: 3,
Available: 7,
}
defaultTestOrg = &Org{
Name: "An Org",
ShortName: testApiOrg,
UUID: "000-000-000",
}
)
func readTestData(t *testing.T, filename string) *CVERecord {
record, err := Read(fmt.Sprintf("../cve5/testdata/%s", filename))
if err != nil {
t.Fatalf("could not read test data from file %s: %v", filename, err)
}
return record
}
var defaultTestCVERecord = func(t *testing.T) *CVERecord {
return readTestData(t, "basic-example.json")
}
var (
testTime2022 = time.Date(2022, 1, 1, 0, 0, 0, 0, time.UTC)
testTime2000 = time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)
testTime1999 = time.Date(1999, 1, 1, 0, 0, 0, 0, time.UTC)
testTime1992 = time.Date(1992, 1, 1, 0, 0, 0, 0, time.UTC)
)
func newTestCVE(id string, state State, year string) AssignedCVE {
return AssignedCVE{
ID: id,
Year: year,
State: state,
CNA: testApiOrg,
Reserved: testTime2022,
RequestedBy: RequestedBy{
CNA: testApiOrg,
User: testApiUser,
},
}
}
func newTestClientAndServer(handler http.HandlerFunc) (*Client, *httptest.Server) {
s := httptest.NewServer(handler)
c := NewClient(Config{
Endpoint: s.URL,
Key: testApiKey,
Org: testApiOrg,
User: testApiUser})
c.c = s.Client()
return c, s
}
func checkHeaders(t *testing.T, r *http.Request) {
if got, want := r.Header.Get(headerApiUser), testApiUser; got != want {
t.Errorf("HTTP Header %q = %s, want %s", headerApiUser, got, want)
}
if got, want := r.Header.Get(headerApiOrg), testApiOrg; got != want {
t.Errorf("HTTP Header %q = %s, want %s", headerApiOrg, got, want)
}
if got, want := r.Header.Get(headerApiKey), testApiKey; got != want {
t.Errorf("HTTP Header %q = %s, want %s", headerApiKey, got, want)
}
}
func newTestHandler(t *testing.T, mockStatus int, mockResponse any, validateRequest func(t *testing.T, r *http.Request)) http.HandlerFunc {
mr, err := json.Marshal(mockResponse)
if err != nil {
t.Fatalf("could not marshal mock response: %v", err)
}
return func(w http.ResponseWriter, r *http.Request) {
if validateRequest != nil {
validateRequest(t, r)
}
checkHeaders(t, r)
w.WriteHeader(mockStatus)
_, err := w.Write(mr)
if err != nil {
t.Errorf("could not write mock response body: %v", err)
}
}
}
func newTestHandlerMultiPage(t *testing.T, mockResponses []any, validateRequest func(t *testing.T, r *http.Request)) http.HandlerFunc {
var mrs [][]byte
for _, r := range mockResponses {
mr, err := json.Marshal(r)
if err != nil {
t.Fatalf("could not marshal mock response: %v", err)
}
mrs = append(mrs, mr)
}
return func(w http.ResponseWriter, r *http.Request) {
if validateRequest != nil {
validateRequest(t, r)
}
parsed, err := url.ParseQuery(r.URL.RawQuery)
if err != nil {
t.Errorf("could not parse URL query: %v", err)
}
var page int
if pages := parsed["page"]; len(pages) >= 1 {
page, err = strconv.Atoi(parsed["page"][0])
if err != nil {
t.Errorf("could not parse page as int: %v", err)
}
}
checkHeaders(t, r)
w.WriteHeader(http.StatusOK)
_, err = w.Write(mrs[page])
if err != nil {
t.Errorf("could not write mock response body: %v", err)
}
}
}
func TestCreateReserveIDsRequest(t *testing.T) {
tests := []struct {
opts ReserveOptions
wantParams string
}{
{
opts: ReserveOptions{
NumIDs: 1,
Year: 2000,
Mode: SequentialRequest,
},
wantParams: "amount=1&cve_year=2000&short_name=test_api_org",
},
{
opts: ReserveOptions{
NumIDs: 2,
Year: 2022,
Mode: SequentialRequest,
},
wantParams: "amount=2&batch_type=sequential&cve_year=2022&short_name=test_api_org",
},
{
opts: ReserveOptions{
NumIDs: 3,
Year: 2010,
Mode: NonsequentialRequest,
},
wantParams: "amount=3&batch_type=nonsequential&cve_year=2010&short_name=test_api_org",
},
}
for _, test := range tests {
t.Run(fmt.Sprintf("NumIDs=%d/Year=%d/Mode=%s", test.opts.NumIDs, test.opts.Year, test.opts.Mode), func(t *testing.T) {
c, s := newTestClientAndServer(nil)
defer s.Close()
req, err := c.createReserveIDsRequest(test.opts)
if err != nil {
t.Fatalf("unexpected error getting reserve ID request: %v", err)
}
if got, want := req.URL.RawQuery, test.wantParams; got != want {
t.Errorf("incorrect request params: got %v, want %v", got, want)
}
})
}
}
type queryFunc func(t *testing.T, c *Client) (any, error)
var (
reserveIDsQuery = func(t *testing.T, c *Client) (any, error) {
return c.ReserveIDs(ReserveOptions{
NumIDs: 2,
Year: 2002,
Mode: SequentialRequest,
})
}
retrieveQuotaQuery = func(t *testing.T, c *Client) (any, error) {
return c.RetrieveQuota()
}
retrieveIDQuery = func(t *testing.T, c *Client) (any, error) {
return c.RetrieveID(defaultTestCVERecord(t).Metadata.ID)
}
retrieveRecordQuery = func(t *testing.T, c *Client) (any, error) {
return c.RetrieveRecord(defaultTestCVERecord(t).Metadata.ID)
}
createRecordQuery = func(t *testing.T, c *Client) (any, error) {
return c.CreateRecord(defaultTestCVE.ID, &defaultTestCVERecord(t).Containers)
}
updateRecordQuery = func(t *testing.T, c *Client) (any, error) {
return c.UpdateRecord(defaultTestCVE.ID, &defaultTestCVERecord(t).Containers)
}
retrieveOrgQuery = func(t *testing.T, c *Client) (any, error) {
return c.RetrieveOrg()
}
listOrgCVEsQuery = func(t *testing.T, c *Client) (any, error) {
return c.ListOrgCVEs(&ListOptions{})
}
)
func TestAllSuccess(t *testing.T) {
defaultTestCVERecord := defaultTestCVERecord(t)
tests := []struct {
name string
mockStatus int
mockResponse any
query queryFunc
wantHTTPMethod string
wantPath string
want any
}{
{
name: "ReserveIDs",
query: reserveIDsQuery,
mockStatus: http.StatusOK,
mockResponse: reserveIDsResponse{
CVEs: defaultTestCVEs},
wantHTTPMethod: http.MethodPost,
wantPath: "/api/cve-id",
want: defaultTestCVEs,
},
{
name: "ReserveIDs/partial content ok",
query: reserveIDsQuery,
mockStatus: http.StatusPartialContent,
mockResponse: reserveIDsResponse{
CVEs: AssignedCVEList{defaultTestCVE}},
wantHTTPMethod: http.MethodPost,
wantPath: "/api/cve-id",
want: AssignedCVEList{defaultTestCVE},
},
{
name: "RetrieveQuota",
query: retrieveQuotaQuery,
mockStatus: http.StatusOK,
mockResponse: defaultTestQuota,
wantHTTPMethod: http.MethodGet,
wantPath: "/api/org/test_api_org/id_quota",
want: defaultTestQuota,
},
{
name: "RetrieveID",
query: retrieveIDQuery,
mockStatus: http.StatusOK,
mockResponse: defaultTestCVE,
wantHTTPMethod: http.MethodGet,
wantPath: "/api/cve-id/CVE-2022-0000",
want: &defaultTestCVE,
},
{
name: "RetrieveRecord",
query: retrieveRecordQuery,
mockStatus: http.StatusOK,
mockResponse: defaultTestCVERecord,
wantHTTPMethod: http.MethodGet,
wantPath: "/api/cve/CVE-2022-0000",
want: defaultTestCVERecord,
},
{
name: "CreateRecord",
query: createRecordQuery,
mockStatus: http.StatusOK,
mockResponse: createResponse{*defaultTestCVERecord},
wantHTTPMethod: http.MethodPost,
wantPath: "/api/cve/CVE-2022-0000/cna",
want: defaultTestCVERecord,
},
{
name: "UpdateRecord",
query: updateRecordQuery,
mockStatus: http.StatusOK,
mockResponse: updateResponse{*defaultTestCVERecord},
wantHTTPMethod: http.MethodPut,
wantPath: "/api/cve/CVE-2022-0000/cna",
want: defaultTestCVERecord,
},
{
name: "RetrieveOrg",
query: retrieveOrgQuery,
mockStatus: http.StatusOK,
mockResponse: defaultTestOrg,
wantHTTPMethod: http.MethodGet,
wantPath: "/api/org/test_api_org",
want: defaultTestOrg,
},
{
name: "ListOrgCVEs/single page",
query: listOrgCVEsQuery,
mockStatus: http.StatusOK,
mockResponse: listOrgCVEsResponse{
CurrentPage: 0,
NextPage: -1,
CVEs: defaultTestCVEs,
},
wantHTTPMethod: http.MethodGet,
wantPath: "/api/cve-id",
want: defaultTestCVEs,
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
validateRequest := func(t *testing.T, r *http.Request) {
if got, want := r.Method, test.wantHTTPMethod; got != want {
t.Errorf("incorrect HTTP method: got %v, want %v", got, want)
}
if got, want := r.URL.Path, test.wantPath; got != want {
t.Errorf("incorrect request URL path: got %v, want %v", got, want)
}
}
c, s := newTestClientAndServer(
newTestHandler(t, test.mockStatus, test.mockResponse, validateRequest))
defer s.Close()
got, err := test.query(t, c)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if want := test.want; !reflect.DeepEqual(got, want) {
t.Errorf("got %v, want %v", got, want)
}
})
}
}
func TestAllFail(t *testing.T) {
tests := []struct {
name string
query queryFunc
}{
{
name: "ReserveIDs",
query: reserveIDsQuery,
},
{
name: "RetrieveQuota",
query: retrieveQuotaQuery,
},
{
name: "RetrieveID",
query: retrieveIDQuery,
},
{
name: "RetrieveRecord",
query: retrieveRecordQuery,
},
{
name: "CreateRecord",
query: createRecordQuery,
},
{
name: "UpdateRecord",
query: updateRecordQuery,
},
{
name: "RetrieveOrg",
query: retrieveOrgQuery,
},
{
name: "ListOrgCVEs",
query: listOrgCVEsQuery,
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
mockStatus := http.StatusUnauthorized
mockResponse := apiError{
Error: "more info",
Message: "even more info",
}
c, s := newTestClientAndServer(newTestHandler(t, mockStatus, mockResponse, nil))
defer s.Close()
want := "401 Unauthorized: more info: even more info"
_, err := test.query(t, c)
if err == nil {
t.Fatalf("unexpected success: want err %v", want)
}
if got := err.Error(); !strings.Contains(got, want) {
t.Errorf("unexpected error string: got %v, want %v", got, want)
}
})
}
}
func TestCreateListOrgCVEsRequest(t *testing.T) {
tests := []struct {
opts ListOptions
page int
wantParams string
}{
{
opts: ListOptions{
State: StateReserved,
Year: 2000,
ReservedBefore: &testTime2022,
ReservedAfter: &testTime1999,
ModifiedBefore: &testTime2000,
ModifiedAfter: &testTime1992,
},
page: 0,
wantParams: "cve_id_year=2000&state=RESERVED&time_modified.gt=1992-01-01T00%3A00%3A00Z&time_modified.lt=2000-01-01T00%3A00%3A00Z&time_reserved.gt=1999-01-01T00%3A00%3A00Z&time_reserved.lt=2022-01-01T00%3A00%3A00Z",
},
{
opts: ListOptions{
State: StateRejected,
Year: 1999,
ReservedBefore: &testTime1999,
ReservedAfter: &testTime2000,
ModifiedBefore: &testTime1992,
ModifiedAfter: &testTime2022,
},
page: 1,
wantParams: "cve_id_year=1999&page=1&state=REJECTED&time_modified.gt=2022-01-01T00%3A00%3A00Z&time_modified.lt=1992-01-01T00%3A00%3A00Z&time_reserved.gt=2000-01-01T00%3A00%3A00Z&time_reserved.lt=1999-01-01T00%3A00%3A00Z",
},
{
opts: ListOptions{
State: StatePublished,
Year: 2000,
},
page: 2,
wantParams: "cve_id_year=2000&page=2&state=PUBLISHED",
},
}
for _, test := range tests {
t.Run(fmt.Sprintf("State=%s/Year=%d/ReservedBefore=%s/ReservedAfter=%s/ModifiedBefore=%s/ModifiedAfter=%s", test.opts.State, test.opts.Year, test.opts.ReservedBefore, test.opts.ReservedAfter, test.opts.ModifiedBefore, test.opts.ModifiedAfter), func(t *testing.T) {
c, s := newTestClientAndServer(nil)
defer s.Close()
req, err := c.createListOrgCVEsRequest(&test.opts, test.page)
if err != nil {
t.Fatalf("unexpected error creating ListOrgCVEs request: %v", err)
}
if got, want := req.URL.RawQuery, test.wantParams; got != want {
t.Errorf("incorrect request params: got %v, want %v", got, want)
}
})
}
}
func TestListOrgCVEsMultiPage(t *testing.T) {
extraCVE := newTestCVE("CVE-2000-1234", StateReserved, "2000")
mockResponses := []any{
listOrgCVEsResponse{
CurrentPage: 0,
NextPage: 1,
CVEs: defaultTestCVEs,
},
listOrgCVEsResponse{
CurrentPage: 1,
NextPage: -1,
CVEs: AssignedCVEList{extraCVE},
},
}
c, s := newTestClientAndServer(
newTestHandlerMultiPage(t, mockResponses, nil))
defer s.Close()
got, err := c.ListOrgCVEs(nil)
if err != nil {
t.Fatalf("unexpected error listing org cves: %v", err)
}
want := append(defaultTestCVEs, extraCVE)
if !reflect.DeepEqual(got, want) {
t.Errorf("got %v, want %v", got, want)
}
}
|
cve5
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/report_test.go
|
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cve5
import (
"context"
"flag"
"reflect"
"testing"
"github.com/google/go-cmp/cmp"
"golang.org/x/vulndb/internal/cvelistrepo"
"golang.org/x/vulndb/internal/report"
)
var (
updateTxtarRepo = flag.Bool("update-repo", false, "update the test repo (cvelist.txtar) with real CVE data - this takes a while")
update = flag.Bool("update", false, "update golden files")
realProxy = flag.Bool("proxy", false, "if true, contact the real module proxy and update expected responses")
)
var (
testStdLibRecord = &CVERecord{
DataType: "CVE_RECORD",
DataVersion: "5.0",
Metadata: Metadata{
ID: "CVE-9999-0001",
},
Containers: Containers{
CNAContainer: CNAPublishedContainer{
ProviderMetadata: ProviderMetadata{
OrgID: GoOrgUUID,
},
Descriptions: []Description{
{
Lang: "en",
Value: `A description`,
},
},
Affected: []Affected{
{
Vendor: "Go standard library",
Product: "crypto/rand",
CollectionURL: "https://pkg.go.dev",
PackageName: "crypto/rand",
Versions: []VersionRange{
{
Introduced: "0",
Fixed: "1.17.11",
Status: StatusAffected,
VersionType: "semver",
},
{
Introduced: "1.18.0",
Fixed: "1.18.3",
Status: StatusAffected,
VersionType: "semver",
},
},
Platforms: []string{
"windows",
},
ProgramRoutines: []ProgramRoutine{
{
Name: "TestSymbol",
},
},
DefaultStatus: StatusUnaffected,
},
},
ProblemTypes: []ProblemType{
{
Descriptions: []ProblemTypeDescription{
{
Lang: "en",
Description: "CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')",
},
},
},
},
References: []Reference{
{
URL: "https://go.dev/cl/12345",
},
{
URL: "https://go.googlesource.com/go/+/abcde",
},
{
URL: "https://go.dev/issue/12345",
},
{
URL: "https://groups.google.com/g/golang-announce/c/abcdef",
},
{
// This normally reports in the format .../vuln/GO-YYYY-XXXX, but our logic
// relies on file path so this "abnormal" formatting is so that tests pass.
URL: "https://pkg.go.dev/vuln/std-report",
},
},
Credits: []Credit{
{
Lang: "en",
Value: "A Credit",
},
},
},
},
}
testThirdPartyRecord = &CVERecord{
DataType: "CVE_RECORD",
DataVersion: "5.0",
Metadata: Metadata{
ID: "CVE-9999-0001",
},
Containers: Containers{
CNAContainer: CNAPublishedContainer{
ProviderMetadata: ProviderMetadata{
OrgID: GoOrgUUID,
},
Descriptions: []Description{
{
Lang: "en",
Value: `Unsanitized input in the default logger in github.com/gin-gonic/gin before v1.6.0 allows remote attackers to inject arbitrary log lines.`,
},
},
Affected: []Affected{
{
Vendor: "github.com/gin-gonic/gin",
Product: "github.com/gin-gonic/gin",
CollectionURL: "https://pkg.go.dev",
PackageName: "github.com/gin-gonic/gin",
Versions: []VersionRange{
{
Introduced: "0",
Fixed: "1.6.0",
Status: StatusAffected,
VersionType: "semver",
},
},
ProgramRoutines: []ProgramRoutine{
{
Name: "defaultLogFormatter",
},
},
DefaultStatus: StatusUnaffected,
},
},
ProblemTypes: []ProblemType{
{
Descriptions: []ProblemTypeDescription{
{
Lang: "en",
Description: "CWE-20: Improper Input Validation",
},
},
},
},
References: []Reference{
{
URL: "https://github.com/gin-gonic/gin/pull/2237",
},
{
URL: "https://github.com/gin-gonic/gin/commit/a71af9c144f9579f6dbe945341c1df37aaf09c0d",
},
{
// This normally reports in the format .../vuln/GO-YYYY-XXXX, but our logic
// relies on file path so this "abnormal" formatting is so that tests pass.
URL: "https://pkg.go.dev/vuln/report",
},
},
Credits: []Credit{
{
Lang: "en",
Value: "@thinkerou <thinkerou@gmail.com>",
},
},
},
},
}
testNoVersionsRecord = &CVERecord{
DataType: "CVE_RECORD",
DataVersion: "5.0",
Metadata: Metadata{
ID: "CVE-9999-0001",
},
Containers: Containers{
CNAContainer: CNAPublishedContainer{
ProviderMetadata: ProviderMetadata{
OrgID: GoOrgUUID,
},
Descriptions: []Description{
{
Lang: "en",
Value: `Unsanitized input in the default logger in github.com/gin-gonic/gin before v1.6.0 allows remote attackers to inject arbitrary log lines.`,
},
},
Affected: []Affected{
{
Vendor: "github.com/gin-gonic/gin",
Product: "github.com/gin-gonic/gin",
CollectionURL: "https://pkg.go.dev",
PackageName: "github.com/gin-gonic/gin",
Versions: nil,
ProgramRoutines: []ProgramRoutine{
{
Name: "defaultLogFormatter",
},
},
DefaultStatus: StatusAffected,
},
},
ProblemTypes: []ProblemType{
{
Descriptions: []ProblemTypeDescription{
{
Lang: "en",
Description: "CWE-20: Improper Input Validation",
},
},
},
},
References: []Reference{
{
URL: "https://github.com/gin-gonic/gin/pull/2237",
},
{
URL: "https://github.com/gin-gonic/gin/commit/a71af9c144f9579f6dbe945341c1df37aaf09c0d",
},
{
// This normally reports in the format .../vuln/GO-YYYY-XXXX, but our logic
// relies on file path so this "abnormal" formatting is so that tests pass.
URL: "https://pkg.go.dev/vuln/no-versions",
},
},
Credits: []Credit{
{
Lang: "en",
Value: "@thinkerou <thinkerou@gmail.com>",
},
},
},
},
}
)
func TestFromReport(t *testing.T) {
tests := []struct {
name string
filename string
want *CVERecord
}{
{
name: "Standard Library Report",
filename: "testdata/std-report.yaml",
want: testStdLibRecord,
},
{
name: "Third Party Report",
filename: "testdata/report.yaml",
want: testThirdPartyRecord,
},
{
name: "No Versions Report",
filename: "testdata/no-versions.yaml",
want: testNoVersionsRecord,
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
r, err := report.Read(test.filename)
if err != nil {
t.Fatal(err)
}
got, err := FromReport(r)
if err != nil {
t.Fatalf("FromReport() failed unexpectedly; err=%v", err)
}
if diff := cmp.Diff(test.want, got); diff != "" {
t.Fatalf("FromReport(): unexpected diffs (-want,+got):\n%v", diff)
}
})
}
}
func TestVersionRangeToVersionRange(t *testing.T) {
tests := []struct {
name string
versions report.Versions
wantRange []VersionRange
wantDefault VersionStatus
}{
{
name: "nil",
versions: nil,
wantRange: nil,
wantDefault: StatusAffected,
},
{
name: "empty",
versions: report.Versions{},
wantRange: nil,
wantDefault: StatusAffected,
},
{
name: "basic",
versions: report.Versions{
report.Introduced("1.0.0"),
report.Fixed("1.0.1"),
report.Introduced("1.2.0"),
report.Fixed("1.2.3"),
},
wantRange: []VersionRange{
{
Introduced: "1.0.0",
Fixed: "1.0.1",
Status: StatusAffected,
VersionType: typeSemver,
},
{
Introduced: "1.2.0",
Fixed: "1.2.3",
Status: StatusAffected,
VersionType: typeSemver,
},
},
wantDefault: StatusUnaffected,
},
{
name: "no initial introduced",
versions: report.Versions{
report.Fixed("1.0.1"),
report.Introduced("1.2.0"),
report.Fixed("1.2.3"),
},
wantRange: []VersionRange{
{
Introduced: "0",
Fixed: "1.0.1",
Status: StatusAffected,
VersionType: typeSemver,
},
{
Introduced: "1.2.0",
Fixed: "1.2.3",
Status: StatusAffected,
VersionType: typeSemver,
},
},
wantDefault: StatusUnaffected,
},
{
name: "no fix",
versions: report.Versions{
report.Introduced("1.0.0"),
},
wantRange: []VersionRange{
{
Introduced: "0",
Fixed: "1.0.0",
Status: StatusUnaffected,
VersionType: typeSemver,
},
},
wantDefault: StatusAffected,
},
{
name: "no final fix",
versions: report.Versions{
report.Introduced("1.0.0"),
report.Fixed("1.0.3"),
report.Introduced("1.1.0"),
},
wantRange: []VersionRange{
{
Introduced: "0",
Fixed: "1.0.0",
Status: StatusUnaffected,
VersionType: typeSemver,
},
{
Introduced: "1.0.3",
Fixed: "1.1.0",
Status: StatusUnaffected,
VersionType: typeSemver,
},
},
wantDefault: StatusAffected,
},
{
name: "no initial introduced and no final fix",
versions: report.Versions{
report.Fixed("1.0.3"),
report.Introduced("1.0.5"),
report.Fixed("1.0.7"),
report.Introduced("1.1.0"),
},
wantRange: []VersionRange{
{
Introduced: "1.0.3",
Fixed: "1.0.5",
Status: StatusUnaffected,
VersionType: typeSemver,
},
{
Introduced: "1.0.7",
Fixed: "1.1.0",
Status: StatusUnaffected,
VersionType: typeSemver,
},
},
wantDefault: StatusAffected,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
gotRange, gotStatus := versionsToVersionRanges(tt.versions)
if !reflect.DeepEqual(gotRange, tt.wantRange) {
t.Errorf("versionRangeToVersionRange() got version range = %v, want %v", gotRange, tt.wantRange)
}
if !reflect.DeepEqual(gotStatus, tt.wantDefault) {
t.Errorf("versionRangeToVersionRange() got default status = %v, want %v", gotStatus, tt.wantDefault)
}
})
}
}
func TestToReport(t *testing.T) {
if *updateTxtarRepo {
cvelistrepo.UpdateTxtar(context.Background(), t, cvelistrepo.URLv5)
}
if err := cvelistrepo.TestToReport[*CVERecord](t, *update, *realProxy); err != nil {
t.Fatal(err)
}
}
|
testdata
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/basic-example.json
|
{
"dataType": "CVE_RECORD",
"dataVersion": "5.0",
"cveMetadata": {
"cveId": "CVE-2022-0000",
"assignerOrgId": "b3476cb9-2e3d-41a6-98d0-0f47421a65b6",
"state": "PUBLISHED"
},
"containers": {
"cna": {
"providerMetadata": {
"orgId": "b3476cb9-2e3d-41a6-98d0-0f47421a65b6"
},
"problemTypes": [
{
"descriptions": [
{
"lang": "en",
"description": "CWE-78 OS Command Injection"
}
]
}
],
"affected": [
{
"vendor": "Example.org",
"product": "Example Enterprise",
"versions": [
{
"version": "1.0.0",
"status": "affected",
"lessThan": "1.0.6",
"versionType": "semver"
}
],
"defaultStatus": "unaffected"
}
],
"descriptions": [
{
"lang": "en",
"value": "OS Command Injection vulnerability parseFilename function of example.php in the Web Management Interface of Example.org Example Enterprise on Windows, MacOS and XT-4500 allows remote unauthenticated attackers to escalate privileges.\n\nThis issue affects:\n * 1.0 versions before 1.0.6\n * 2.1 versions from 2.16 until 2.1.9."
}
],
"references": [
{
"url": "https://example.org/ESA-22-11-CVE-2022-0000"
}
]
}
}
}
|
testdata
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/std-report.yaml
|
# Copyright 2022 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
id: std-report
modules:
- module: std
versions:
- fixed: 1.17.11
- introduced: 1.18.0
- fixed: 1.18.3
packages:
- package: crypto/rand
goos:
- windows
symbols:
- TestSymbol
description: |
On Windows, TestSymbol will hang indefinitely if passed a large buffer.
cve_metadata:
id: CVE-9999-0001
cwe: "CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')"
description: |
A description
credits:
- A Credit
references:
- fix: https://go.dev/cl/12345
- fix: https://go.googlesource.com/go/+/abcde
- report: https://go.dev/issue/12345
- web: https://groups.google.com/g/golang-announce/c/abcdef
|
testdata
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/unknown-field.yaml
|
id: unknown-field
module: github.com/gin-gonic/gin
unknown: 1
|
testdata
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/no-versions.yaml
|
id: no-versions
modules:
- module: github.com/gin-gonic/gin
packages:
- package: github.com/gin-gonic/gin
symbols:
- defaultLogFormatter
description: |
The default Formatter for the Logger middleware (LoggerConfig.Formatter),
which is included in the Default engine, allows attackers to inject arbitrary
log entries by manipulating the request path.
credits:
- '@thinkerou <thinkerou@gmail.com>'
references:
- fix: https://github.com/gin-gonic/gin/pull/2237
- fix: https://github.com/gin-gonic/gin/commit/a71af9c144f9579f6dbe945341c1df37aaf09c0d
cve_metadata:
id: CVE-9999-0001
cwe: 'CWE-20: Improper Input Validation'
description: |
Unsanitized input in the default logger in github.com/gin-gonic/gin before v1.6.0
allows remote attackers to inject arbitrary log lines.
|
testdata
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/report.yaml
|
id: report
modules:
- module: github.com/gin-gonic/gin
versions:
- fixed: 1.6.0
packages:
- package: github.com/gin-gonic/gin
symbols:
- defaultLogFormatter
description: |
The default Formatter for the Logger middleware (LoggerConfig.Formatter),
which is included in the Default engine, allows attackers to inject arbitrary
log entries by manipulating the request path.
credits:
- '@thinkerou <thinkerou@gmail.com>'
references:
- fix: https://github.com/gin-gonic/gin/pull/2237
- fix: https://github.com/gin-gonic/gin/commit/a71af9c144f9579f6dbe945341c1df37aaf09c0d
cve_metadata:
id: CVE-9999-0001
cwe: 'CWE-20: Improper Input Validation'
description: |
Unsanitized input in the default logger in github.com/gin-gonic/gin before v1.6.0
allows remote attackers to inject arbitrary log lines.
|
proxy
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/proxy/TestToReport.json
|
{
"github.com/!consensys/gnark/@latest": {
"body": "{\"Version\":\"v0.10.0\",\"Time\":\"2024-04-22T13:57:16Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/Consensys/gnark\",\"Ref\":\"refs/tags/v0.10.0\",\"Hash\":\"b2dfec74eae2578fdebd2c63be6da390f2aad564\"}}",
"status_code": 200
},
"github.com/!consensys/gnark/@v/v0.9.0.mod": {
"body": "module github.com/consensys/gnark\n\ngo 1.19\n\nrequire (\n\tgithub.com/bits-and-blooms/bitset v1.8.0\n\tgithub.com/blang/semver/v4 v4.0.0\n\tgithub.com/consensys/bavard v0.1.13\n\tgithub.com/consensys/gnark-crypto v0.11.2\n\tgithub.com/fxamacker/cbor/v2 v2.5.0\n\tgithub.com/google/go-cmp v0.5.9\n\tgithub.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b\n\tgithub.com/leanovate/gopter v0.2.9\n\tgithub.com/rs/zerolog v1.30.0\n\tgithub.com/stretchr/testify v1.8.4\n\tgolang.org/x/crypto v0.12.0\n\tgolang.org/x/exp v0.0.0-20230817173708-d852ddb80c63\n\tgolang.org/x/sys v0.11.0\n)\n\nrequire (\n\tgithub.com/kr/text v0.2.0 // indirect\n\tgithub.com/rogpeppe/go-internal v1.11.0 // indirect\n)\n\nrequire (\n\tgithub.com/davecgh/go-spew v1.1.1 // indirect\n\tgithub.com/mattn/go-colorable v0.1.13 // indirect\n\tgithub.com/mattn/go-isatty v0.0.19 // indirect\n\tgithub.com/mmcloughlin/addchain v0.4.0 // indirect\n\tgithub.com/pmezard/go-difflib v1.0.0 // indirect\n\tgithub.com/x448/float16 v0.8.4 // indirect\n\tgopkg.in/yaml.v3 v3.0.1 // indirect\n\trsc.io/tmplfunc v0.0.3 // indirect\n)\n",
"status_code": 200
},
"github.com/amlweems/xzbot/@latest": {
"body": "{\"Version\":\"v0.0.0-20240403045847-8ae5b706fb2c\",\"Time\":\"2024-04-03T04:58:47Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/amlweems/xzbot\",\"Hash\":\"8ae5b706fb2c6040a91b233ea6ce39f9f09441d5\"}}",
"status_code": 200
},
"github.com/consensys/gnark/@latest": {
"body": "{\"Version\":\"v0.10.0\",\"Time\":\"2024-04-22T13:57:16Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/consensys/gnark\",\"Ref\":\"refs/tags/v0.10.0\",\"Hash\":\"b2dfec74eae2578fdebd2c63be6da390f2aad564\"}}",
"status_code": 200
},
"github.com/consensys/gnark/@v/list": {
"body": "v0.2.0-alpha\nv0.5.1-hotfixes\nv0.7.0\nv0.8.1\nv0.3.8\nv0.3.0\nv0.5.2\nv0.3.6\nv0.6.1\nv0.3.4\nv0.8.0\nv0.6.0\nv0.3.7\nv0.10.0\nv0.6.2\nv0.5.0\nv0.3.5\nv0.2.1-alpha\nv0.3.3\nv0.9.0\nv0.6.5\nv0.4.0\nv0.5.1\nv0.3.1\nv0.7.1\nv0.9.1\nv0.6.3\nv0.3.0-alpha\nv0.9.0-alpha\nv0.1.0-alpha\nv0.6.4\nv0.3.2\n",
"status_code": 200
},
"github.com/consensys/gnark/@v/v0.9.0.mod": {
"body": "module github.com/consensys/gnark\n\ngo 1.19\n\nrequire (\n\tgithub.com/bits-and-blooms/bitset v1.8.0\n\tgithub.com/blang/semver/v4 v4.0.0\n\tgithub.com/consensys/bavard v0.1.13\n\tgithub.com/consensys/gnark-crypto v0.11.2\n\tgithub.com/fxamacker/cbor/v2 v2.5.0\n\tgithub.com/google/go-cmp v0.5.9\n\tgithub.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b\n\tgithub.com/leanovate/gopter v0.2.9\n\tgithub.com/rs/zerolog v1.30.0\n\tgithub.com/stretchr/testify v1.8.4\n\tgolang.org/x/crypto v0.12.0\n\tgolang.org/x/exp v0.0.0-20230817173708-d852ddb80c63\n\tgolang.org/x/sys v0.11.0\n)\n\nrequire (\n\tgithub.com/kr/text v0.2.0 // indirect\n\tgithub.com/rogpeppe/go-internal v1.11.0 // indirect\n)\n\nrequire (\n\tgithub.com/davecgh/go-spew v1.1.1 // indirect\n\tgithub.com/mattn/go-colorable v0.1.13 // indirect\n\tgithub.com/mattn/go-isatty v0.0.19 // indirect\n\tgithub.com/mmcloughlin/addchain v0.4.0 // indirect\n\tgithub.com/pmezard/go-difflib v1.0.0 // indirect\n\tgithub.com/x448/float16 v0.8.4 // indirect\n\tgopkg.in/yaml.v3 v3.0.1 // indirect\n\trsc.io/tmplfunc v0.0.3 // indirect\n)\n",
"status_code": 200
},
"github.com/go-resty/resty/@latest": {
"body": "{\"Version\":\"v1.12.0\",\"Time\":\"2019-02-28T07:26:48Z\"}",
"status_code": 200
},
"github.com/go-resty/resty/v2/@latest": {
"body": "{\"Version\":\"v2.13.1\",\"Time\":\"2024-05-11T01:40:23Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/go-resty/resty\",\"Ref\":\"refs/tags/v2.13.1\",\"Hash\":\"baf7c1219b781803557018eba206ad8fa544941f\"}}",
"status_code": 200
},
"github.com/go-resty/resty/v2/@v/list": {
"body": "v2.3.0\nv2.13.1\nv2.2.0\nv2.9.1\nv2.6.0\nv2.0.0-rc.3\nv2.13.0\nv2.3.0-rc.1\nv2.0.0-rc.1\nv2.0.0-rc.4\nv2.0.0\nv2.4.0\nv2.10.0-rc.1\nv2.12.0\nv2.8.0\nv2.7.0\nv2.10.0-rc.3\nv2.1.0\nv2.10.0\nv2.11.0\nv2.9.0\nv2.0.0-rc.2\nv2.3.0-rc.2\nv2.5.0\nv2.10.0-rc.2\n",
"status_code": 200
},
"github.com/go-resty/resty/v2/@v/v2.10.0.mod": {
"body": "module github.com/go-resty/resty/v2\n\ngo 1.16\n\nrequire (\n\tgolang.org/x/net v0.17.0\n\tgolang.org/x/time v0.3.0\n)\n",
"status_code": 200
},
"github.com/go-resty/resty/v2/@v/v2.11.0.mod": {
"body": "module github.com/go-resty/resty/v2\n\ngo 1.16\n\nrequire (\n\tgolang.org/x/net v0.17.0\n\tgolang.org/x/time v0.3.0\n)\n",
"status_code": 200
},
"github.com/gofiber/fiber/@latest": {
"body": "{\"Version\":\"v1.14.6\",\"Time\":\"2020-09-11T18:56:02Z\"}",
"status_code": 200
},
"github.com/gofiber/fiber/v2/@latest": {
"body": "{\"Version\":\"v2.52.4\",\"Time\":\"2024-03-26T21:40:09Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/gofiber/fiber\",\"Ref\":\"refs/tags/v2.52.4\",\"Hash\":\"fd811cf84af282db8ec50adedce01a5886d5fd46\"}}",
"status_code": 200
},
"github.com/gofiber/fiber/v2/@v/list": {
"body": "v2.38.1\nv2.37.0-rc.1\nv2.3.0\nv2.33.0\nv2.2.0\nv2.37.0\nv2.30.0\nv2.24.0\nv2.6.0\nv2.22.0\nv2.13.0\nv2.42.0\nv2.31.0\nv2.0.2\nv2.27.0\nv2.0.3\nv2.29.0\nv2.2.4\nv2.49.0\nv2.52.2\nv2.1.2\nv2.49.2\nv2.0.4\nv2.34.0-rc.1\nv2.38.0\nv2.52.1\nv2.25.0\nv2.14.0\nv2.2.5\nv2.35.0\nv2.40.1\nv2.20.2\nv2.28.0\nv2.36.0\nv2.19.0\nv2.0.0\nv2.0.5\nv2.51.0\nv2.34.0\nv2.2.1\nv2.1.3\nv2.4.0\nv2.18.0\nv2.52.0\nv2.12.0\nv2.2.2\nv2.7.1\nv2.8.0\nv2.3.2\nv2.46.0\nv2.34.1\nv2.40.0\nv2.4.1\nv2.39.0\nv2.43.0\nv2.23.0\nv2.48.0\nv2.7.0\nv2.15.0\nv2.26.0\nv2.47.0\nv2.41.0\nv2.1.0\nv2.3.3\nv2.0.1\nv2.50.0\nv2.1.4\nv2.10.0\nv2.3.1\nv2.52.4\nv2.11.0\nv2.9.0\nv2.20.1\nv2.32.0\nv2.49.1\nv2.17.0\nv2.1.1\nv2.2.3\nv2.16.0\nv2.52.3\nv2.21.0\nv2.0.6\nv2.5.0\nv2.44.0\nv2.37.1\nv2.20.0\nv2.45.0\n",
"status_code": 200
},
"github.com/gofiber/fiber/v2/@v/v2.50.0.mod": {
"body": "module github.com/gofiber/fiber/v2\n\ngo 1.20\n\nrequire (\n\tgithub.com/google/uuid v1.3.1\n\tgithub.com/mattn/go-colorable v0.1.13\n\tgithub.com/mattn/go-isatty v0.0.19\n\tgithub.com/mattn/go-runewidth v0.0.15\n\tgithub.com/tinylib/msgp v1.1.8\n\tgithub.com/valyala/bytebufferpool v1.0.0\n\tgithub.com/valyala/fasthttp v1.50.0\n\tgolang.org/x/sys v0.13.0\n)\n\nrequire (\n\tgithub.com/andybalholm/brotli v1.0.5 // indirect\n\tgithub.com/klauspost/compress v1.16.7 // indirect\n\tgithub.com/philhofer/fwd v1.1.2 // indirect\n\tgithub.com/rivo/uniseg v0.2.0 // indirect\n\tgithub.com/valyala/tcplisten v1.0.0 // indirect\n)\n",
"status_code": 200
},
"github.com/gvalkov/tailon/@latest": {
"body": "{\"Version\":\"v1.1.0\",\"Time\":\"2019-02-07T22:36:09Z\"}",
"status_code": 200
},
"github.com/pandatix/go-cvss/@latest": {
"body": "{\"Version\":\"v0.6.2\",\"Time\":\"2023-10-29T09:33:31Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://github.com/pandatix/go-cvss\",\"Ref\":\"refs/tags/v0.6.2\",\"Hash\":\"c469bad96b51674ff275fa1a76fcd9fa409c180a\"}}",
"status_code": 200
},
"github.com/pandatix/go-cvss/@v/list": {
"body": "v0.3.0\nv0.5.2\nv0.6.1\nv0.6.0\nv0.6.2\nv0.5.0\nv0.4.0\nv0.4.1\nv0.5.1\nv0.1.0\nv0.1.1\nv0.2.0\nv0.4.2\n",
"status_code": 200
},
"github.com/pandatix/go-cvss/@v/v0.2.0.mod": {
"body": "module github.com/pandatix/go-cvss\n\ngo 1.18\n\nrequire github.com/stretchr/testify v1.7.5\n\nrequire (\n\tgithub.com/davecgh/go-spew v1.1.1 // indirect\n\tgithub.com/pmezard/go-difflib v1.0.0 // indirect\n\tgopkg.in/yaml.v3 v3.0.1 // indirect\n)\n",
"status_code": 200
},
"github.com/pandatix/go-cvss/@v/v0.4.0.mod": {
"body": "module github.com/pandatix/go-cvss\n\ngo 1.19\n\nrequire github.com/stretchr/testify v1.8.0\n\nrequire (\n\tgithub.com/davecgh/go-spew v1.1.1 // indirect\n\tgithub.com/pmezard/go-difflib v1.0.0 // indirect\n\tgopkg.in/yaml.v3 v3.0.1 // indirect\n)\n",
"status_code": 200
},
"github.com/projectcalico/calico/@latest": {
"body": "{\"Version\":\"v2.6.12+incompatible\",\"Time\":\"2018-11-09T21:09:06Z\"}",
"status_code": 200
},
"github.com/projectcalico/calico/@v/list": {
"body": "v1.3.1-cni-plugin\nv3.15.2-calico+incompatible\nv3.2.3-pod2daemon+incompatible\nv0.6.3-typha\nv2.0.0-calicoctl+incompatible\nv3.2.0-pod2daemon+incompatible\nv3.4.2-calicoctl+incompatible\nv3.4.3-app-policy+incompatible\nv3.6.0-0.dev-pod2daemon+incompatible\nv0.1.2-rc3-confd\nv2.0.3-calicoctl+incompatible\nv3.17.6-networking-calico+incompatible\nv3.5.8-pod2daemon+incompatible\nv3.7.5-felix+incompatible\nv2.6.7-calico+incompatible\nv3.10.3+incompatible\nv1.6.1-calicoctl\nv1.11.8-cni-plugin\nv3.2.0-app-policy+incompatible\nv3.6.0-0.dev-confd+incompatible\nv0.5.1-kube-controllers\nv1.11.6-cni-plugin\nv2.0.7-cni-plugin+incompatible\nv3.5.6-typha+incompatible\nv3.5.7-kube-controllers+incompatible\nv3.2.1-calicoctl+incompatible\nv1.1.0-libcalico-go\nv3.5.0-pod2daemon+incompatible\nv3.3.3+incompatible\nv0.4.7-calicoctl\nv1.5.2-cni-plugin\nv3.8.8-typha+incompatible\nv1.1.3-calicoctl\nv2.6.5+incompatible\nv3.7.1-typha+incompatible\nv1.0.0-rc2-kube-controllers\nv3.13.3-calico+incompatible\nv3.7.0-0.dev-typha+incompatible\nv3.2.4-kube-controllers+incompatible\nv3.6.3-calicoctl+incompatible\nv3.7.2-node+incompatible\nv2.0.0-alpha1-kube-controllers+incompatible\nv0.6.0-beta1-typha\nv3.7.5-node+incompatible\nv1.11.5-cni-plugin\nv1.2.1-calicoctl\nv2.0.4-calicoctl+incompatible\nv1.1.0-rc1-libcalico-go\nv3.6.0+incompatible\nv3.3.6+incompatible\nv3.5.3-pod2daemon+incompatible\nv0.6.2-confd\nv0.10.0-confd\nv1.6.2-calicoctl\nv3.2.2-pod2daemon+incompatible\nv3.5.6-kube-controllers+incompatible\nv3.3.1-node+incompatible\nv1.4.0-rc2-cni-plugin\nv1.2.1-rc5-libcalico-go\nv3.7.3-felix+incompatible\nv3.5.0-0.dev-confd+incompatible\nv3.1.3-cni-plugin+incompatible\nv3.4.4+incompatible\nv3.1.6-felix+incompatible\nv3.19.2+incompatible\nv3.8.5-pod2daemon+incompatible\nv3.4.2-cni-plugin+incompatible\nv3.2.0-calicoctl+incompatible\nv0.5.0-beta1-confd\nv3.7.0-0.dev-pod2daemon+incompatible\nv0.11.0-calicoctl\nv3.20.2+incompatible\nv3.0.10+incompatible\nv3.8.7-networking-calico+incompatible\nv3.2.8-typha+incompatible\nv1.7.2-libcalico-go\nv1.0.3-confd\nv3.5.8-node+incompatible\nv3.7.1-pod2daemon+incompatible\nv2.6.7+incompatible\nv3.16.10+incompatible\nv3.8.4+incompatible\nv3.15.0-python2-networking-calico+incompatible\nv3.8.7-node+incompatible\nv0.4.0-typha\nv3.1.4+incompatible\nv3.2.4-cni-plugin+incompatible\nv2.6.1-calico+incompatible\nv0.10.0-scale-confd\nv3.3.5-cni-plugin+incompatible\nv1.2.0-rc2-calicoctl\nv3.5.0-felix+incompatible\nv3.5.0-beta.0-felix+incompatible\nv3.3.0-0.dev-node+incompatible\nv3.9.0-calico+incompatible\nv3.2.3-calicoctl+incompatible\nv3.3.5-kube-controllers+incompatible\nv3.15.5-python2-networking-calico+incompatible\nv3.1.4-calicoctl+incompatible\nv3.7.5-calicoctl+incompatible\nv2.0.3-kube-controllers+incompatible\nv2.5.1-calico+incompatible\nv3.8.5-typha+incompatible\nv3.12.3-networking-calico+incompatible\nv2.0.4-cni-plugin+incompatible\nv3.6.3-node+incompatible\nv3.7.0-cni-plugin+incompatible\nv3.1.5-confd+incompatible\nv3.6.0-0.dev-app-policy+incompatible\nv3.6.4-calicoctl+incompatible\nv2.0.5-calicoctl+incompatible\nv2.6.6-calico+incompatible\nv3.3.4-calicoctl+incompatible\nv3.3.6-app-policy+incompatible\nv3.8.2+incompatible\nv3.5.0-beta.0-typha+incompatible\nv3.2.7-calicoctl+incompatible\nv3.14.0-calico+incompatible\nv3.16.2+incompatible\nv3.4.1-app-policy+incompatible\nv3.8.0-kube-controllers+incompatible\nv0.5.4-rc2-typha\nv3.16.1-networking-calico+incompatible\nv0.7.1-typha\nv2.4.1+incompatible\nv3.6.3-cni-plugin+incompatible\nv1.1.0-cni-plugin\nv0.1.1-rc1-confd\nv0.4.1-confd\nv3.6.2-calicoctl+incompatible\nv1.3.0-cni-plugin\nv3.17.3+incompatible\nv3.2.1+incompatible\nv3.6.4-node+incompatible\nv3.13.4+incompatible\nv3.2.3-typha+incompatible\nv3.0.2+incompatible\nv0.6.1-confd\nv3.21.1-networking-calico+incompatible\nv3.17.4-networking-calico+incompatible\nv3.9.0-0.dev-typha+incompatible\nv3.21.1-calico+incompatible\nv3.2.0-node+incompatible\nv3.18.0+incompatible\nv3.6.1-pod2daemon+incompatible\nv0.2.0-beta1-confd\nv3.2.7+incompatible\nv3.16.5-networking-calico+incompatible\nv3.6.0-calicoctl+incompatible\nv3.0.10-kube-controllers+incompatible\nv3.17.3-calico+incompatible\nv3.7.0-0.dev-felix+incompatible\nv2.5.1+incompatible\nv0.6.0-alpha1-confd\nv0.7.0-confd\nv3.15.4-networking-calico+incompatible\nv2.6.0+incompatible\nv3.8.7-felix+incompatible\nv3.4.4-kube-controllers+incompatible\nv3.1.7-confd+incompatible\nv3.7.2-typha+incompatible\nv3.8.6-calicoctl+incompatible\nv1.9.1-cni-plugin\nv3.1.2-cni-plugin+incompatible\nv3.1.1-cni-plugin+incompatible\nv3.2.0-typha+incompatible\nv0.7.0-beta1-confd\nv3.2.2-calicoctl+incompatible\nv1.10.0-cni-plugin\nv3.3.2-app-policy+incompatible\nv3.8.8-1-node+incompatible\nv3.15.1-networking-calico+incompatible\nv3.9.0-0.dev-kube-controllers+incompatible\nv2.0.6-calicoctl+incompatible\nv3.8.1-calico+incompatible\nv0.0.1-calicoctl\nv3.21.0+incompatible\nv2.6.4-rc1-calico+incompatible\nv3.1.4-cni-plugin+incompatible\nv3.1.2-calico+incompatible\nv3.12.2-calico+incompatible\nv3.16.4-networking-calico+incompatible\nv3.5.5-felix+incompatible\nv3.5.0-kube-controllers+incompatible\nv1.1.0-rc4-calicoctl\nv3.8.1-calicoctl+incompatible\nv2.6.4+incompatible\nv1.0.0-beta-rc5-calicoctl\nv3.7.0-0.dev-kube-controllers+incompatible\nv3.5.2-app-policy+incompatible\nv3.15.1-python2-networking-calico+incompatible\nv3.8.9-cni-plugin+incompatible\nv3.2.8-cni-plugin+incompatible\nv2.4.0-rc1-calico+incompatible\nv0.1.0-beta-confd\nv3.19.0-calico+incompatible\nv3.19.0-networking-calico+incompatible\nv3.4.2-node+incompatible\nv3.13.0+incompatible\nv3.6.0-0.dev-calicoctl+incompatible\nv3.5.1-typha+incompatible\nv2.0.0-kube-controllers+incompatible\nv3.5.4-cni-plugin+incompatible\nv3.0.1-calico+incompatible\nv3.5.4-calicoctl+incompatible\nv3.19.3+incompatible\nv3.7.0-pod2daemon+incompatible\nv3.17.1-networking-calico+incompatible\nv3.18.4-networking-calico+incompatible\nv1.0.4-confd\nv3.1.7-kube-controllers+incompatible\nv3.6.2-cni-plugin+incompatible\nv3.4.1-typha+incompatible\nv3.7.3-node+incompatible\nv0.2.3-pre1-typha\nv3.14.1-networking-calico+incompatible\nv3.4.1+incompatible\nv3.5.7-felix+incompatible\nv3.19.1+incompatible\nv1.0.0-beta-rc4-calicoctl\nv2.0.2-calicoctl+incompatible\nv3.8.7-cni-plugin+incompatible\nv3.8.0-0.dev-felix+incompatible\nv1.5.2-libcalico-go\nv1.2.1-libcalico-go\nv3.0.11-kube-controllers+incompatible\nv3.8.3-calico+incompatible\nv3.6.0-kube-controllers+incompatible\nv3.5.4-felix+incompatible\nv3.0.2-calico+incompatible\nv3.20.1-calico+incompatible\nv3.8.8-calicoctl+incompatible\nv3.3.6-cni-plugin+incompatible\nv0.5.6-typha\nv0.6.5-typha\nv3.8.3-cni-plugin+incompatible\nv1.4.2-libcalico-go\nv3.3.7-typha+incompatible\nv0.6.1-typha\nv3.2.7-app-policy+incompatible\nv3.10.0+incompatible\nv3.7.3-app-policy+incompatible\nv0.2.0-confd\nv3.2.3+incompatible\nv3.8.9-app-policy+incompatible\nv0.7.0-typha\nv3.0.10-felix+incompatible\nv3.1.1-confd+incompatible\nv3.15.1-python2.1-networking-calico+incompatible\nv0.1.2-cni-plugin\nv3.7.4-typha+incompatible\nv3.3.6-felix+incompatible\nv3.17.0-networking-calico+incompatible\nv3.3.7-felix+incompatible\nv3.4.3-calicoctl+incompatible\nv1.9.0-cni-plugin\nv3.20.0-0.dev-networking-calico+incompatible\nv3.6.0-app-policy+incompatible\nv3.15.4-python2-networking-calico+incompatible\nv1.0.0-beta-libcalico-go\nv3.3.1-felix+incompatible\nv3.3.4-kube-controllers+incompatible\nv3.19.4+incompatible\nv1.5.0-cni-plugin\nv3.15.4+incompatible\nv0.5.4-kube-controllers\nv2.5.0+incompatible\nv3.2.2-typha+incompatible\nv3.2.8-pod2daemon+incompatible\nv3.8.5-calicoctl+incompatible\nv3.13.0-calico+incompatible\nv3.3.3-app-policy+incompatible\nv3.5.4-kube-controllers+incompatible\nv1.2.1-rc3-libcalico-go\nv1.4.3-cni-plugin\nv3.2.4-felix+incompatible\nv0.12.1-calico-0.4.4-confd\nv3.3.4+incompatible\nv2.6.10-calico+incompatible\nv3.5.6-calicoctl+incompatible\nv2.6.8+incompatible\nv3.2.6-felix+incompatible\nv3.3.6-pod2daemon+incompatible\nv3.3.1-kube-controllers+incompatible\nv3.6.5-kube-controllers+incompatible\nv2.0.6-kube-controllers+incompatible\nv3.16.9+incompatible\nv0.6.6-typha\nv3.6.2-felix+incompatible\nv3.9.5+incompatible\nv2.5.0-rc2+incompatible\nv3.13.0-networking-calico+incompatible\nv3.2.3-felix+incompatible\nv3.7.2-calicoctl+incompatible\nv0.0.1-alpha-confd\nv3.21.2-networking-calico+incompatible\nv3.9.0-0.dev-pod2daemon+incompatible\nv3.7.0-0.dev-app-policy+incompatible\nv3.7.1-kube-controllers+incompatible\nv3.13.3-networking-calico+incompatible\nv3.9.0-0.dev-libcalico-go+incompatible\nv1.6.3-rc1-calicoctl\nv3.3.2-pod2daemon+incompatible\nv3.5.3-cni-plugin+incompatible\nv3.2.1-kube-controllers+incompatible\nv3.2.5-pod2daemon+incompatible\nv3.15.0-calico+incompatible\nv3.1.7-felix+incompatible\nv2.6.3-calico+incompatible\nv3.3.6-calicoctl+incompatible\nv3.16.8-networking-calico+incompatible\nv3.18.2+incompatible\nv3.7.0-0.dev-node+incompatible\nv3.9.4+incompatible\nv3.9.0-0.dev-node+incompatible\nv3.3.2-felix+incompatible\nv3.17.4+incompatible\nv1.4.5-libcalico-go\nv3.1.7-calicoctl+incompatible\nv3.3.4-felix+incompatible\nv1.0.0-confd\nv3.8.5-cni-plugin+incompatible\nv3.5.0-node+incompatible\nv3.3.2-cni-plugin+incompatible\nv3.2.2-felix+incompatible\nv3.0.3-calico+incompatible\nv3.7.1-calico+incompatible\nv1.5.3-libcalico-go\nv3.18.4+incompatible\nv3.1.0-rc1-calico+incompatible\nv1.0.1-libcalico-go\nv1.6.4-calicoctl\nv1.0.0-rc1-kube-controllers\nv3.5.7-typha+incompatible\nv3.2.8-calicoctl+incompatible\nv1.4.0-calicoctl\nv3.3.0-felix+incompatible\nv0.7.2-typha\nv3.8.1-app-policy+incompatible\nv0.2.3-typha\nv3.11.2-calico+incompatible\nv3.3.5-node+incompatible\nv3.9.6-networking-calico+incompatible\nv3.17.0-calico+incompatible\nv3.1.3-calicoctl+incompatible\nv3.16.10-calico+incompatible\nv0.1.1-beta3-confd\nv0.6.1-kube-controllers\nv3.5.8-typha+incompatible\nv2.5.0-rc2-calico+incompatible\nv3.0.7+incompatible\nv1.11.0-cni-plugin\nv3.8.4-cni-plugin+incompatible\nv3.3.2+incompatible\nv3.8.4-pod2daemon+incompatible\nv3.1.6-confd+incompatible\nv3.2.6-kube-controllers+incompatible\nv3.8.8-node+incompatible\nv3.5.8-felix+incompatible\nv1.0.0-alpha1-confd\nv3.7.2-cni-plugin+incompatible\nv0.5.4-typha\nv1.0.0-kube-controllers\nv3.0.11-cni-plugin+incompatible\nv3.4.1-pod2daemon+incompatible\nv3.1.3+incompatible\nv2.5.0-rc1-calico+incompatible\nv3.7.0-typha+incompatible\nv0.0.2-calicoctl\nv3.5.3-typha+incompatible\nv3.4.4-node+incompatible\nv0.9.0-confd\nv0.12.1-calico-0.4.0-confd\nv3.4.3-pod2daemon+incompatible\nv3.8.0-0.dev-pod2daemon+incompatible\nv3.8.6-cni-plugin+incompatible\nv3.5.0-0.dev-typha+incompatible\nv3.8.1+incompatible\nv3.4.0-0.dev-typha+incompatible\nv3.2.1-pod2daemon+incompatible\nv3.5.3-app-policy+incompatible\nv3.2.0-kube-controllers+incompatible\nv3.11.3-networking-calico+incompatible\nv3.18.5-networking-calico+incompatible\nv3.6.2+incompatible\nv3.5.0-0.dev-felix+incompatible\nv3.0.0-alpha1+incompatible\nv3.2.4-app-policy+incompatible\nv3.4.0-typha+incompatible\nv3.3.1+incompatible\nv3.4.4-calicoctl+incompatible\nv3.18.0-calico+incompatible\nv2.6.1+incompatible\nv3.6.5-node+incompatible\nv3.8.2-typha+incompatible\nv3.8.9-felix+incompatible\nv3.18.3+incompatible\nv3.0.11-typha+incompatible\nv3.16.8+incompatible\nv3.14.0-networking-calico+incompatible\nv3.2.3-node+incompatible\nv3.9.1+incompatible\nv3.16.0-networking-calico+incompatible\nv3.7.3-pod2daemon+incompatible\nv3.1.0-dev-node+incompatible\nv1.0.0-rc2-calicoctl\nv3.5.1-cni-plugin+incompatible\nv3.7.4-felix+incompatible\nv3.6.2-kube-controllers+incompatible\nv3.8.1-kube-controllers+incompatible\nv3.7.1-app-policy+incompatible\nv3.8.7+incompatible\nv3.1.0-calicoctl+incompatible\nv0.5.3-typha\nv3.8.0-calico+incompatible\nv3.2.4+incompatible\nv3.8.9+incompatible\nv1.0.0-rc4-libcalico-go\nv3.6.3-kube-controllers+incompatible\nv3.8.3+incompatible\nv1.0.0-beta-rc2-libcalico-go\nv3.8.6-calico+incompatible\nv3.6.0-cni-plugin+incompatible\nv0.2.2-typha\nv3.2.6-typha+incompatible\nv3.0.10-cni-plugin+incompatible\nv3.3.1-pod2daemon+incompatible\nv3.21.0-networking-calico+incompatible\nv2.0.0-beta1-cni-plugin+incompatible\nv0.1.0-typha\nv3.4.1-node+incompatible\nv3.4.0-kube-controllers+incompatible\nv3.5.7+incompatible\nv2.1.0-rc1-cni-plugin+incompatible\nv3.0.6+incompatible\nv3.0.9-calico+incompatible\nv0.1.2-kube-controllers\nv1.6.0-cni-plugin\nv3.1.0-rc1+incompatible\nv1.11.7-cni-plugin\nv3.5.0-beta.0-node+incompatible\nv1.1.0-rc7-calicoctl\nv2.6.12+incompatible\nv3.7.5-pod2daemon+incompatible\nv0.1.2-rc4-confd\nv1.0.0-rc1-calicoctl\nv3.6.0-0.dev-typha+incompatible\nv0.3.0-typha\nv3.0.7-calico+incompatible\nv3.8.3-app-policy+incompatible\nv3.5.0-0.dev-libcalico-go+incompatible\nv2.0.0-alpha1-calicoctl+incompatible\nv3.3.5-calicoctl+incompatible\nv3.2.0-felix+incompatible\nv3.8.6-kube-controllers+incompatible\nv1.0.1-confd\nv2.0.0-alpha1-rc2-calicoctl+incompatible\nv1.0.0-rc4-calicoctl\nv3.8.0-cni-plugin+incompatible\nv3.1.5-cni-plugin+incompatible\nv3.8.5+incompatible\nv3.7.1-node+incompatible\nv3.4.0-node+incompatible\nv0.6.0-alpha1-rc1-typha\nv3.6.0-pod2daemon+incompatible\nv3.8.3-kube-controllers+incompatible\nv3.2.1-node+incompatible\nv2.0.0-alpha1-rc1-cni-plugin+incompatible\nv3.7.3-calicoctl+incompatible\nv3.20.2-calico+incompatible\nv3.5.0-0.dev-app-policy+incompatible\nv2.6.6+incompatible\nv3.9.1-calico+incompatible\nv3.8.2-felix+incompatible\nv3.2.6-node+incompatible\nv3.6.3-pod2daemon+incompatible\nv1.1.0-rc2-calicoctl\nv3.8.0-0.dev-confd+incompatible\nv3.1.5-kube-controllers+incompatible\nv3.8.3-felix+incompatible\nv1.5.1-libcalico-go\nv1.1.2-rc1-calicoctl\nv3.15.4-python2.1-networking-calico+incompatible\nv3.3.3-typha+incompatible\nv1.6.3-calicoctl\nv0.8.0-confd\nv3.3.4-app-policy+incompatible\nv3.7.0-calico+incompatible\nv3.1.0-calico+incompatible\nv3.6.3-typha+incompatible\nv1.1.0-rc9-calicoctl\nv1.0.6-confd\nv3.13.5-networking-calico+incompatible\nv2.0.7-calicoctl+incompatible\nv3.17.2+incompatible\nv3.6.0-node+incompatible\nv3.15.5-networking-calico+incompatible\nv3.9.6-calico+incompatible\nv3.0.12-typha+incompatible\nv3.2.7-pod2daemon+incompatible\nv2.5.0-rc1+incompatible\nv3.9.2-calico+incompatible\nv3.2.2+incompatible\nv3.1.7-cni-plugin+incompatible\nv1.8.3-cni-plugin\nv3.8.8-pod2daemon+incompatible\nv3.3.1-cni-plugin+incompatible\nv3.7.4-kube-controllers+incompatible\nv3.7.5-cni-plugin+incompatible\nv3.5.0-0.dev-cni-plugin+incompatible\nv3.7.3-cni-plugin+incompatible\nv3.8.8-1-cni-plugin+incompatible\nv3.4.0-0.dev-app-policy+incompatible\nv3.6.1-kube-controllers+incompatible\nv3.3.3-felix+incompatible\nv0.12.0-confd\nv0.5.0-confd\nv3.2.5-node+incompatible\nv0.4.8-powerstrip-calicoctl\nv3.16.1+incompatible\nv0.5.5-typha\nv3.8.0-0.dev-app-policy+incompatible\nv3.14.1+incompatible\nv1.0.2-libcalico-go\nv3.5.1-app-policy+incompatible\nv3.10.4+incompatible\nv3.3.4-pod2daemon+incompatible\nv3.9.2+incompatible\nv3.8.7-kube-controllers+incompatible\nv3.3.3-kube-controllers+incompatible\nv3.7.2-kube-controllers+incompatible\nv3.8.5-calico+incompatible\nv3.8.9-calicoctl+incompatible\nv3.0.0-beta1-calico+incompatible\nv3.7.0-0.dev-calicoctl+incompatible\nv3.5.7-calico+incompatible\nv3.8.7-pod2daemon+incompatible\nv3.6.3-app-policy+incompatible\nv3.3.7-cni-plugin+incompatible\nv3.4.4-felix+incompatible\nv3.3.3-calicoctl+incompatible\nv3.5.1-felix+incompatible\nv0.1.2-typha\nv3.8.2-node+incompatible\nv3.2.4-calicoctl+incompatible\nv3.2.3-kube-controllers+incompatible\nv3.15.3-networking-calico+incompatible\nv3.7.0-0.dev-cni-plugin+incompatible\nv3.3.1-calicoctl+incompatible\nv3.8.1-felix+incompatible\nv3.0.12-kube-controllers+incompatible\nv3.8.4-node+incompatible\nv0.6.7-typha\nv0.2.0-alpha1-confd\nv3.14.2-networking-calico+incompatible\nv3.16.2-networking-calico+incompatible\nv3.5.1-kube-controllers+incompatible\nv0.5.2-calicoctl\nv3.1.6-typha+incompatible\nv3.4.2+incompatible\nv2.6.0-rc1+incompatible\nv3.1.1-kube-controllers+incompatible\nv2.6.4-rc2+incompatible\nv3.8.6+incompatible\nv3.2.1-felix+incompatible\nv3.5.2+incompatible\nv3.16.3+incompatible\nv1.7.1-libcalico-go\nv3.8.9-networking-calico+incompatible\nv3.1.6-calico+incompatible\nv1.0.0-rc6-libcalico-go\nv3.0.10-typha+incompatible\nv2.5.0-calico+incompatible\nv2.0.2-cni-plugin+incompatible\nv3.2.8-felix+incompatible\nv1.6.1-cni-plugin\nv3.6.5+incompatible\nv1.6.0-libcalico-go\nv3.5.6-felix+incompatible\nv0.5.0-typha\nv3.15.4-calico+incompatible\nv3.6.1-app-policy+incompatible\nv3.2.1-typha+incompatible\nv3.7.2-pod2daemon+incompatible\nv3.3.0-pod2daemon+incompatible\nv3.2.7-node+incompatible\nv3.14.1-calico+incompatible\nv3.5.6-app-policy+incompatible\nv3.6.5-cni-plugin+incompatible\nv1.4.0-rc2-calicoctl\nv3.2.3-app-policy+incompatible\nv3.1.5-calicoctl+incompatible\nv3.3.4-cni-plugin+incompatible\nv3.2.7-typha+incompatible\nv3.4.0-0.dev-pod2daemon+incompatible\nv3.6.3+incompatible\nv0.16.0-calicoctl\nv3.6.5-felix+incompatible\nv1.3.0-rc2-calicoctl\nv3.0.10-calicoctl+incompatible\nv1.6.2-cni-plugin\nv3.8.0-app-policy+incompatible\nv0.1.1-beta-confd\nv0.7.4-typha\nv0.5.8-typha\nv3.5.0-0.dev-calicoctl+incompatible\nv3.7.1-felix+incompatible\nv3.15.0-networking-calico+incompatible\nv2.6.4-rc1+incompatible\nv2.6.2-calico+incompatible\nv3.6.1-calicoctl+incompatible\nv3.14.0-0.dev-networking-calico+incompatible\nv3.13.1+incompatible\nv0.1.3-kube-controllers\nv3.6.1+incompatible\nv1.8.0-cni-plugin\nv2.0.4-kube-controllers+incompatible\nv3.5.5-pod2daemon+incompatible\nv3.6.0-0.dev-felix+incompatible\nv3.16.7-calico+incompatible\nv3.2.7-felix+incompatible\nv3.17.6+incompatible\nv3.6.2-calico+incompatible\nv1.0.5-confd\nv3.8.4-felix+incompatible\nv3.0.8-calico+incompatible\nv3.14.0+incompatible\nv3.2.4-calico+incompatible\nv3.3.7-app-policy+incompatible\nv3.1.4-confd+incompatible\nv0.12.1-calico-0.4.3-rc1-confd\nv3.11.3+incompatible\nv3.18.1-networking-calico+incompatible\nv3.5.8+incompatible\nv3.9.4-calico+incompatible\nv3.2.5-calicoctl+incompatible\nv2.6.0-rc1-calico+incompatible\nv2.4.0-rc2-calico+incompatible\nv3.5.5+incompatible\nv3.2.2-cni-plugin+incompatible\nv3.4.0-cni-plugin+incompatible\nv3.4.0-0.dev-libcalico-go+incompatible\nv1.2.1-rc6-libcalico-go\nv3.7.4-calicoctl+incompatible\nv1.4.0-rc1-calicoctl\nv2.4.0+incompatible\nv3.6.1-felix+incompatible\nv0.1.3-typha\nv3.9.0-0.dev-cni-plugin+incompatible\nv0.1.2-rc.1-confd\nv1.3.0-calicoctl\nv3.0.0+incompatible\nv3.7.3-kube-controllers+incompatible\nv0.1.5-typha\nv1.4.2-cni-plugin\nv3.1.0-cni-plugin+incompatible\nv3.13.3+incompatible\nv3.7.0-0.dev-libcalico-go+incompatible\nv3.7.0-app-policy+incompatible\nv1.7.3-libcalico-go\nv3.2.5-cni-plugin+incompatible\nv3.8.1-cni-plugin+incompatible\nv3.7.5-kube-controllers+incompatible\nv3.2.5-app-policy+incompatible\nv3.5.6+incompatible\nv3.7.5+incompatible\nv1.1.0-rc6-calicoctl\nv3.6.5-pod2daemon+incompatible\nv3.8.5-felix+incompatible\nv1.4.3-libcalico-go\nv1.0.0-rc2-libcalico-go\nv3.8.6-app-policy+incompatible\nv0.7.0-kube-controllers\nv2.0.6-cni-plugin+incompatible\nv3.5.2-cni-plugin+incompatible\nv3.0.4+incompatible\nv3.0.12-felix+incompatible\nv3.2.1-cni-plugin+incompatible\nv1.0.0-rc1-libcalico-go\nv3.1.1-calicoctl+incompatible\nv3.20.3-calico+incompatible\nv1.1.0-rc1-confd\nv1.5.0-rc1-calicoctl\nv2.0.0-cni-plugin+incompatible\nv3.5.0+incompatible\nv3.1.3-confd+incompatible\nv3.8.5-node+incompatible\nv3.8.0-node+incompatible\nv3.16.9-networking-calico+incompatible\nv3.6.0-typha+incompatible\nv3.16.7-networking-calico+incompatible\nv3.19.3-calico+incompatible\nv3.0.11-calicoctl+incompatible\nv3.17.1+incompatible\nv3.18.6+incompatible\nv3.3.0-kube-controllers+incompatible\nv3.6.5-app-policy+incompatible\nv3.8.3-pod2daemon+incompatible\nv1.4.4-libcalico-go\nv3.1.1-calico+incompatible\nv3.7.2+incompatible\nv3.8.9-kube-controllers+incompatible\nv0.1.1-rc2-confd\nv2.1.0-rc1-kube-controllers+incompatible\nv3.6.4-typha+incompatible\nv1.4.0-libcalico-go\nv3.7.1+incompatible\nv1.1.2-rc2-calicoctl\nv3.8.4-calico+incompatible\nv3.8.9-calico+incompatible\nv3.4.3-kube-controllers+incompatible\nv3.0.12-cni-plugin+incompatible\nv3.1.6-calicoctl+incompatible\nv0.12.1-calico-0.4.3-confd\nv3.0.8+incompatible\nv3.1.7-calico+incompatible\nv3.15.0-0.dev-networking-calico+incompatible\nv3.5.0-beta.0-kube-controllers+incompatible\nv1.11.2-rc1-cni-plugin\nv3.8.3-typha+incompatible\nv3.13.4-networking-calico+incompatible\nv3.3.2-typha+incompatible\nv3.3.6-node+incompatible\nv3.1.0+incompatible\nv3.2.0-confd+incompatible\nv3.8.2-kube-controllers+incompatible\nv1.0.0-beta-rc1-libcalico-go\nv3.6.1-node+incompatible\nv3.11.1-calico+incompatible\nv3.1.2-kube-controllers+incompatible\nv3.3.5-pod2daemon+incompatible\nv1.2.2-libcalico-go\nv3.10.1-calico+incompatible\nv3.8.4-kube-controllers+incompatible\nv3.0.12-confd+incompatible\nv3.12.2+incompatible\nv3.12.1-networking-calico+incompatible\nv3.5.7-node+incompatible\nv3.8.6-felix+incompatible\nv3.8.0-0.dev-typha+incompatible\nv1.4.1-cni-plugin\nv2.0.0-alpha1-libcalico-go+incompatible\nv3.3.6-kube-controllers+incompatible\nv3.4.0-0.dev-calicoctl+incompatible\nv3.1.5+incompatible\nv3.9.3-calico+incompatible\nv1.0.2-kube-controllers\nv3.12.3+incompatible\nv3.17.6-calico+incompatible\nv0.12.1-calico0.2.0-confd\nv3.1.2+incompatible\nv3.5.7-cni-plugin+incompatible\nv0.6.0-alpha3-confd\nv1.5.4-cni-plugin\nv0.12.1-calico-0.4.5-confd\nv3.20.3-networking-calico+incompatible\nv3.2.6-pod2daemon+incompatible\nv3.15.5-calico+incompatible\nv3.16.5+incompatible\nv3.18.0-networking-calico+incompatible\nv3.18.1-calico+incompatible\nv3.6.0-0.dev-kube-controllers+incompatible\nv1.2.1-rc1-libcalico-go\nv3.4.1-cni-plugin+incompatible\nv3.17.4-calico+incompatible\nv1.0.0-rc3-kube-controllers\nv3.10.4-calico+incompatible\nv3.3.2-kube-controllers+incompatible\nv3.5.0-beta.0-app-policy+incompatible\nv3.5.3-calicoctl+incompatible\nv3.1.2-calicoctl+incompatible\nv0.4.0-beta1-confd\nv3.1.3-calico+incompatible\nv0.1.1-confd\nv0.5.7-typha\nv1.8.2-cni-plugin\nv1.0.1-kube-controllers\nv3.3.6-typha+incompatible\nv1.2.1-rc4-libcalico-go\nv3.8.5-kube-controllers+incompatible\nv3.3.7-kube-controllers+incompatible\nv3.16.6-networking-calico+incompatible\nv2.0.0-beta1-kube-controllers+incompatible\nv1.0.3-kube-controllers\nv3.6.0-0.dev-node+incompatible\nv3.8.4-typha+incompatible\nv3.8.0-0.dev-kube-controllers+incompatible\nv3.16.9-calico+incompatible\nv3.8.6-node+incompatible\nv3.8.2-calicoctl+incompatible\nv3.0.0-alpha1-calico+incompatible\nv3.16.4-calico+incompatible\nv3.4.4-typha+incompatible\nv2.6.11-calico+incompatible\nv3.6.2-node+incompatible\nv3.8.8+incompatible\nv3.16.1-calico+incompatible\nv3.12.0+incompatible\nv3.5.0-typha+incompatible\nv3.5.0-calicoctl+incompatible\nv3.0.9+incompatible\nv3.20.3+incompatible\nv3.16.8-calico+incompatible\nv0.4.0-beta2-confd\nv3.16.3-networking-calico+incompatible\nv2.4.0-rc1+incompatible\nv3.5.1-calicoctl+incompatible\nv3.8.7-calicoctl+incompatible\nv3.8.9-typha+incompatible\nv1.1.1-calicoctl\nv3.19.1-networking-calico+incompatible\nv1.2.0-calicoctl\nv2.0.1-cni-plugin+incompatible\nv3.5.8-kube-controllers+incompatible\nv3.5.6-cni-plugin+incompatible\nv3.5.5-cni-plugin+incompatible\nv3.20.1+incompatible\nv0.1.7-typha\nv1.2.1-rc2-libcalico-go\nv3.7.0-calicoctl+incompatible\nv3.8.8-calico+incompatible\nv3.2.2-node+incompatible\nv3.8.7-calico+incompatible\nv3.7.0+incompatible\nv2.6.3+incompatible\nv3.2.4-node+incompatible\nv3.18.0-0.dev-networking-calico+incompatible\nv3.12.1-calico+incompatible\nv3.7.5-app-policy+incompatible\nv3.1.7+incompatible\nv3.11.0+incompatible\nv3.4.0-0.dev-confd+incompatible\nv3.4.0-app-policy+incompatible\nv3.4.2-typha+incompatible\nv3.8.2-pod2daemon+incompatible\nv3.7.4-pod2daemon+incompatible\nv3.5.5-typha+incompatible\nv3.8.1-node+incompatible\nv3.0.5-calico+incompatible\nv3.8.5-app-policy+incompatible\nv3.4.3-typha+incompatible\nv3.15.2+incompatible\nv3.8.0-0.dev-node+incompatible\nv0.6.0-typha\nv0.7.1-confd\nv3.13.4-calico+incompatible\nv1.2.0-rc1-calicoctl\nv0.0.3-calicoctl\nv3.8.6-typha+incompatible\nv1.0.0-libcalico-go\nv3.0.11-calico+incompatible\nv3.3.0-typha+incompatible\nv0.2.0-typha\nv3.5.6-calico+incompatible\nv3.3.0+incompatible\nv0.1.2-confd\nv3.0.0-alpha1-rc1+incompatible\nv3.15.5+incompatible\nv3.7.4-cni-plugin+incompatible\nv2.0.0-alpha1-cni-plugin+incompatible\nv1.5.0-libcalico-go\nv3.18.6-networking-calico+incompatible\nv3.13.1-calico+incompatible\nv3.4.3+incompatible\nv1.11.3-cni-plugin\nv3.8.7-typha+incompatible\nv2.6.4-rc2-calico+incompatible\nv3.18.6-calico+incompatible\nv1.4.0-cni-plugin\nv3.8.1-pod2daemon+incompatible\nv3.7.4+incompatible\nv0.3.0-confd\nv3.7.3+incompatible\nv3.5.6-node+incompatible\nv3.0.12-calicoctl+incompatible\nv3.0.12+incompatible\nv3.1.0-confd+incompatible\nv3.2.4-pod2daemon+incompatible\nv1.0.0-rc5-libcalico-go\nv3.4.3-felix+incompatible\nv3.16.0+incompatible\nv3.1.5-felix+incompatible\nv2.6.8-calico+incompatible\nv3.5.2-pod2daemon+incompatible\nv3.15.3+incompatible\nv3.5.2-calicoctl+incompatible\nv3.5.6-pod2daemon+incompatible\nv3.10.3-calico+incompatible\nv3.8.0-typha+incompatible\nv3.8.0-0.dev-calicoctl+incompatible\nv1.0.2-cni-plugin\nv3.4.1-felix+incompatible\nv3.5.2-felix+incompatible\nv3.6.0-0.dev-cni-plugin+incompatible\nv1.0.0-rc4-kube-controllers\nv3.8.4-calicoctl+incompatible\nv3.2.0+incompatible\nv2.4.1-calico+incompatible\nv3.7.4-calico+incompatible\nv3.9.5-calico+incompatible\nv0.6.0-kube-controllers\nv3.18.3-networking-calico+incompatible\nv3.0.1+incompatible\nv1.3.0-libcalico-go\nv3.1.6-kube-controllers+incompatible\nv1.0.1-cni-plugin\nv3.8.3-calicoctl+incompatible\nv3.3.0-app-policy+incompatible\nv3.2.4-typha+incompatible\nv3.5.3+incompatible\nv0.0.2-alpha-confd\nv3.15.0+incompatible\nv3.8.8-1-typha+incompatible\nv3.5.0-0.dev-kube-controllers+incompatible\nv3.3.7-calicoctl+incompatible\nv3.0.10-confd+incompatible\nv1.4.1-libcalico-go\nv0.6.0-confd\nv1.0.0-cni-plugin\nv3.2.8-calico+incompatible\nv3.11.2+incompatible\nv2.4.0-rc2+incompatible\nv1.7.0-cni-plugin\nv3.5.7-calicoctl+incompatible\nv3.5.0-beta.0-cni-plugin+incompatible\nv3.8.1-typha+incompatible\nv3.16.0-0.dev-networking-calico+incompatible\nv3.2.6-calicoctl+incompatible\nv3.8.2-app-policy+incompatible\nv3.8.0-0.dev-cni-plugin+incompatible\nv3.9.0+incompatible\nv3.9.0-0.dev-confd+incompatible\nv3.1.3-kube-controllers+incompatible\nv3.21.1+incompatible\nv3.17.2-calico+incompatible\nv2.6.0-rc2+incompatible\nv3.5.7-app-policy+incompatible\nv3.1.4-kube-controllers+incompatible\nv3.7.4-node+incompatible\nv1.0.0-alpha1-rc2-confd\nv1.4.0-rc4-cni-plugin\nv3.3.1-typha+incompatible\nv3.7.0-0.dev-confd+incompatible\nv0.4.0-confd\nv1.0.0-beta1-confd\nv3.7.1-calicoctl+incompatible\nv1.5.0-calicoctl\nv3.5.0-0.dev-node+incompatible\nv1.0.0-calicoctl\nv3.6.3-felix+incompatible\nv3.18.5-calico+incompatible\nv3.10.1+incompatible\nv3.5.4-pod2daemon+incompatible\nv3.19.0-0.dev-networking-calico+incompatible\nv3.4.0-0.dev-kube-controllers+incompatible\nv2.0.3-cni-plugin+incompatible\nv3.17.0+incompatible\nv3.5.3-kube-controllers+incompatible\nv3.7.2-app-policy+incompatible\nv3.7.2-felix+incompatible\nv3.4.1-kube-controllers+incompatible\nv1.11.2-cni-plugin\nv3.13.1-networking-calico+incompatible\nv3.5.1+incompatible\nv3.18.3-calico+incompatible\nv3.2.5+incompatible\nv0.0.5-calicoctl\nv0.2.0-cni-plugin\nv3.2.8+incompatible\nv3.10.0-calico+incompatible\nv0.5.2-kube-controllers\nv3.3.3-pod2daemon+incompatible\nv3.8.8-app-policy+incompatible\nv3.8.3-node+incompatible\nv3.8.0-calicoctl+incompatible\nv2.0.5-kube-controllers+incompatible\nv3.0.11+incompatible\nv1.8.1-cni-plugin\nv3.16.6+incompatible\nv3.5.5-kube-controllers+incompatible\nv3.8.8-kube-controllers+incompatible\nv3.3.7-pod2daemon+incompatible\nv3.8.6-pod2daemon+incompatible\nv3.5.3-node+incompatible\nv1.1.0-calicoctl\nv3.5.4-app-policy+incompatible\nv0.6.0-alpha1-typha\nv3.0.5+incompatible\nv3.2.3-cni-plugin+incompatible\nv2.0.1-kube-controllers+incompatible\nv3.5.5-app-policy+incompatible\nv3.15.3-calico+incompatible\nv0.5.1-typha\nv3.3.2-calicoctl+incompatible\nv2.6.0-calico+incompatible\nv3.4.0-0.dev-felix+incompatible\nv3.0.6-calico+incompatible\nv2.0.2-kube-controllers+incompatible\nv3.1.4-typha+incompatible\nv3.21.0-calico+incompatible\nv1.0.0-rc3-libcalico-go\nv2.0.0-beta1-calicoctl+incompatible\nv2.6.11+incompatible\nv3.5.5-calicoctl+incompatible\nv3.12.2-networking-calico+incompatible\nv1.0.2-confd\nv3.17.3-networking-calico+incompatible\nv3.5.8-calicoctl+incompatible\nv3.6.4-calico+incompatible\nv0.12.1-calico-0.3.0-confd\nv3.1.5-calico+incompatible\nv3.7.5-typha+incompatible\nv3.3.7+incompatible\nv3.16.10-networking-calico+incompatible\nv2.6.5-calico+incompatible\nv3.10.4-networking-calico+incompatible\nv3.0.3+incompatible\nv1.0.2-rc1-kube-controllers\nv3.3.4-typha+incompatible\nv3.8.9-node+incompatible\nv1.0.0-alpha1-rc1-confd\nv3.6.2-app-policy+incompatible\nv3.21.0-0.dev-networking-calico+incompatible\nv3.5.0-cni-plugin+incompatible\nv1.5.1-cni-plugin\nv0.0.6-calicoctl\nv3.3.0-cni-plugin+incompatible\nv3.0.11-felix+incompatible\nv3.4.2-pod2daemon+incompatible\nv3.1.7-typha+incompatible\nv3.7.3-typha+incompatible\nv0.2.0-kube-controllers\nv3.7.0-node+incompatible\nv3.0.11-confd+incompatible\nv0.12.1-calico0.1.0-confd\nv3.5.0-beta.0-calicoctl+incompatible\nv3.4.1-calicoctl+incompatible\nv3.1.1+incompatible\nv3.6.1-cni-plugin+incompatible\nv3.3.5-typha+incompatible\nv3.6.4-app-policy+incompatible\nv1.0.7-confd\nv1.1.0-rc3-calicoctl\nv3.5.4-node+incompatible\nv3.19.0+incompatible\nv3.8.8-felix+incompatible\nv3.1.2-confd+incompatible\nv3.2.6-app-policy+incompatible\nv1.0.0-alpha1-rc3-confd\nv2.0.1-calicoctl+incompatible\nv3.5.8-cni-plugin+incompatible\nv3.9.0-0.dev-felix+incompatible\nv3.2.2-kube-controllers+incompatible\nv3.3.2-node+incompatible\nv3.5.8-app-policy+incompatible\nv3.17.5-networking-calico+incompatible\nv3.3.5+incompatible\nv0.12.1-calico-0.4.1-confd\nv3.3.0-node+incompatible\nv3.5.4-typha+incompatible\nv3.7.4-app-policy+incompatible\nv0.0.4-calicoctl\nv2.6.12-calico+incompatible\nv0.1.4-typha\nv3.16.0-calico+incompatible\nv3.6.4-pod2daemon+incompatible\nv3.4.4-pod2daemon+incompatible\nv3.4.0-0.dev-node+incompatible\nv3.5.7-pod2daemon+incompatible\nv0.6.4-typha\nv3.6.5-typha+incompatible\nv3.8.2-cni-plugin+incompatible\nv3.19.2-calico+incompatible\nv3.2.8-kube-controllers+incompatible\nv3.5.0-app-policy+incompatible\nv1.5.3-cni-plugin\nv3.3.0-calicoctl+incompatible\nv3.5.3-felix+incompatible\nv3.7.2-calico+incompatible\nv1.0.0-alpha1-rc4-confd\nv3.17.0-0.dev-networking-calico+incompatible\nv3.3.5-app-policy+incompatible\nv0.5.0-beta2-confd\nv3.20.0-networking-calico+incompatible\nv1.0.0-beta.1-libcalico-go\nv3.8.7-app-policy+incompatible\nv1.7.0-libcalico-go\nv2.6.4-rc3-calico+incompatible\nv0.4.1-typha\nv3.2.1-app-policy+incompatible\nv3.2.7-cni-plugin+incompatible\nv3.2.7-kube-controllers+incompatible\nv3.4.0+incompatible\nv3.8.0-0.dev-libcalico-go+incompatible\nv3.17.5-calico+incompatible\nv1.3.0-rc1-calicoctl\nv3.20.0+incompatible\nv1.1.0-rc8-calicoctl\nv3.5.4+incompatible\nv3.6.2-typha+incompatible\nv3.16.5-calico+incompatible\nv3.3.3-node+incompatible\nv2.6.10+incompatible\nv3.15.1+incompatible\nv1.6.0-rc1-calicoctl\nv3.8.0+incompatible\nv3.12.1+incompatible\nv3.18.2-networking-calico+incompatible\nv1.6.0-rc2-calicoctl\nv3.9.0-0.dev-app-policy+incompatible\nv2.4.0-calico+incompatible\nv3.11.3-calico+incompatible\nv3.8.8-networking-calico+incompatible\nv3.3.4-node+incompatible\nv3.4.4-cni-plugin+incompatible\nv0.5.2-typha\nv3.0.0-calico+incompatible\nv3.8.9-pod2daemon+incompatible\nv3.10.2-calico+incompatible\nv0.12.1-confd\nv3.9.6+incompatible\nv0.3.1-typha\nv0.11.2-confd\nv2.0.5-cni-plugin+incompatible\nv3.6.4+incompatible\nv2.6.9-calico+incompatible\nv2.6.0-rc2-calico+incompatible\nv3.4.4-app-policy+incompatible\nv3.13.2-networking-calico+incompatible\nv3.6.2-pod2daemon+incompatible\nv2.0.0-alpha1-rc1-calicoctl+incompatible\nv1.5.5-cni-plugin\nv3.2.5-kube-controllers+incompatible\nv3.15.3-python2-networking-calico+incompatible\nv2.1.0-rc1-calicoctl+incompatible\nv3.1.5-typha+incompatible\nv3.3.5-felix+incompatible\nv3.20.2-networking-calico+incompatible\nv1.11.1-cni-plugin\nv3.18.2-calico+incompatible\nv3.8.0-pod2daemon+incompatible\nv3.1.4-calico+incompatible\nv3.8.8-cni-plugin+incompatible\nv3.2.8-node+incompatible\nv3.0.12-calico+incompatible\nv1.6.0-calicoctl\nv3.0.0-beta1+incompatible\nv2.6.2+incompatible\nv3.19.2-networking-calico+incompatible\nv1.2.0-libcalico-go\nv3.6.0-felix+incompatible\nv3.4.2-kube-controllers+incompatible\nv3.0.4-calico+incompatible\nv3.5.0-0.dev-pod2daemon+incompatible\nv1.1.0-rc5-calicoctl\nv0.7.3-typha\nv3.5.1-node+incompatible\nv3.1.0-kube-controllers+incompatible\nv2.6.9+incompatible\nv3.3.1-app-policy+incompatible\nv3.2.6-cni-plugin+incompatible\nv3.0.10-calico+incompatible\nv1.0.5-kube-controllers\nv3.16.4+incompatible\nv3.4.0-calicoctl+incompatible\nv3.6.4-felix+incompatible\nv3.7.0-kube-controllers+incompatible\nv2.6.4-calico+incompatible\nv3.6.3-calico+incompatible\nv3.18.1+incompatible\nv3.5.2-node+incompatible\nv3.6.0-0.dev-libcalico-go+incompatible\nv3.16.7+incompatible\nv1.0.0-beta-rc3-libcalico-go\nv3.4.2-app-policy+incompatible\nv3.4.0-felix+incompatible\nv0.1.2-rc2-confd\nv0.11.0-confd\nv3.22.0-0.dev-networking-calico+incompatible\nv3.8.0-felix+incompatible\nv3.5.0-beta.0-pod2daemon+incompatible\nv3.7.1-cni-plugin+incompatible\nv3.5.1-pod2daemon+incompatible\nv3.7.0-felix+incompatible\nv3.1.6-cni-plugin+incompatible\nv3.5.2-typha+incompatible\nv3.2.5-typha+incompatible\nv1.4.0-rc1-cni-plugin\nv3.6.4-cni-plugin+incompatible\nv0.1.1-typha\nv1.0.4-kube-controllers\nv3.2.6+incompatible\nv1.0.0-beta-calicoctl\nv3.3.3-cni-plugin+incompatible\nv3.5.2-kube-controllers+incompatible\nv2.6.4-rc3+incompatible\nv3.20.1-networking-calico+incompatible\nv3.4.0-0.dev-cni-plugin+incompatible\nv3.19.3-networking-calico+incompatible\nv0.4.0-beta3-confd\nv3.17.5+incompatible\nv3.2.5-felix+incompatible\nv3.4.0-pod2daemon+incompatible\nv3.17.2-networking-calico+incompatible\nv3.9.0-0.dev-calicoctl+incompatible\nv3.2.8-app-policy+incompatible\nv1.0.0-rc3-calicoctl\nv3.6.1-typha+incompatible\nv3.3.7-node+incompatible\nv1.4.1-calicoctl\nv3.4.2-felix+incompatible\nv0.6.3-confd\nv3.4.3-node+incompatible\nv1.11.4-cni-plugin\nv3.2.2-app-policy+incompatible\nv3.11.1+incompatible\nv3.10.2+incompatible\nv0.11.1-confd\nv0.1.1-beta2-confd\nv3.0.0-alpha1-rc1-calico+incompatible\nv3.4.3-cni-plugin+incompatible\nv3.9.3+incompatible\nv0.2.1-typha\nv3.1.6+incompatible\nv3.15.2-networking-calico+incompatible\nv3.8.4-app-policy+incompatible\nv3.5.5-node+incompatible\nv0.1.0-cni-plugin\nv3.6.4-kube-controllers+incompatible\nv2.0.0-alpha1-rc1-kube-controllers+incompatible\nv0.5.4-rc1-typha\nv3.18.5+incompatible\nv0.6.2-typha\nv1.6.5-calicoctl\nv3.6.5-calicoctl+incompatible\nv3.3.7-calico+incompatible\n",
"status_code": 200
},
"github.com/projectcalico/calico/@v/v3.17.4+incompatible.mod": {
"body": "module github.com/projectcalico/calico\n",
"status_code": 200
},
"github.com/projectcalico/calico/@v/v3.18.0+incompatible.mod": {
"body": "module github.com/projectcalico/calico\n",
"status_code": 200
},
"github.com/projectcalico/calico/@v/v3.18.2+incompatible.mod": {
"body": "module github.com/projectcalico/calico\n",
"status_code": 200
},
"github.com/projectcalico/calico/v19/@latest": {
"status_code": 404
},
"github.com/projectcalico/calico/v3/@latest": {
"status_code": 404
},
"golang.org/x/crypto/@latest": {
"body": "{\"Version\":\"v0.24.0\",\"Time\":\"2024-06-04T16:30:12Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/crypto\",\"Ref\":\"refs/tags/v0.24.0\",\"Hash\":\"332fd656f4f013f66e643818fe8c759538456535\"}}",
"status_code": 200
},
"golang.org/x/image/@latest": {
"body": "{\"Version\":\"v0.17.0\",\"Time\":\"2024-06-04T16:01:12Z\",\"Origin\":{\"VCS\":\"git\",\"URL\":\"https://go.googlesource.com/image\",\"Ref\":\"refs/tags/v0.17.0\",\"Hash\":\"6c5fa462eb87ac98bad9b09ea3b041dd770fa611\"}}",
"status_code": 200
},
"golang.org/x/image/@v/list": {
"body": "v0.15.0\nv0.7.0\nv0.3.0\nv0.8.0\nv0.6.0\nv0.10.0\nv0.5.0\nv0.12.0\nv0.9.0\nv0.4.0\nv0.14.0\nv0.11.0\nv0.1.0\nv0.13.0\nv0.17.0\nv0.2.0\nv0.16.0\n",
"status_code": 200
},
"golang.org/x/image/@v/v0.10.0.mod": {
"body": "module golang.org/x/image\n\ngo 1.12\n\nrequire golang.org/x/text v0.11.0\n",
"status_code": 200
}
}
|
cve
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/cve/cvelist.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Repo in the shape of "https://github.com/CVEProject/cvelistV5".
Updated with real data 2024-06-05T20:00:00-04:00.
Auto-generated; do not edit directly.
-- README.md --
ignore me please
-- cves/2020/9xxx/CVE-2020-9283.json --
{
"dataType": "CVE_RECORD",
"dataVersion": "5.0",
"cveMetadata": {
"state": "PUBLISHED",
"cveId": "CVE-2020-9283",
"assignerOrgId": "8254265b-2729-46b6-b9e3-3dfca2d5bfca",
"assignerShortName": "mitre",
"dateUpdated": "2023-06-16T00:00:00",
"dateReserved": "2020-02-19T00:00:00",
"datePublished": "2020-02-20T00:00:00"
},
"containers": {
"cna": {
"providerMetadata": {
"orgId": "8254265b-2729-46b6-b9e3-3dfca2d5bfca",
"shortName": "mitre",
"dateUpdated": "2023-06-16T00:00:00"
},
"descriptions": [
{
"lang": "en",
"value": "golang.org/x/crypto before v0.0.0-20200220183623-bac4c82f6975 for Go allows a panic during signature verification in the golang.org/x/crypto/ssh package. A client can attack an SSH server that accepts public keys. Also, a server can attack any SSH client."
}
],
"affected": [
{
"vendor": "n/a",
"product": "n/a",
"versions": [
{
"version": "n/a",
"status": "affected"
}
]
}
],
"references": [
{
"url": "https://groups.google.com/forum/#%21topic/golang-announce/3L45YRc91SY"
},
{
"url": "http://packetstormsecurity.com/files/156480/Go-SSH-0.0.2-Denial-Of-Service.html"
},
{
"name": "[debian-lts-announce] 20201007 [SECURITY] [DLA 2402-1] golang-go.crypto security update",
"tags": [
"mailing-list"
],
"url": "https://lists.debian.org/debian-lts-announce/2020/10/msg00014.html"
},
{
"name": "[debian-lts-announce] 20201116 [SECURITY] [DLA 2453-1] restic security update",
"tags": [
"mailing-list"
],
"url": "https://lists.debian.org/debian-lts-announce/2020/11/msg00027.html"
},
{
"name": "[debian-lts-announce] 20201118 [SECURITY] [DLA 2455-1] packer security update",
"tags": [
"mailing-list"
],
"url": "https://lists.debian.org/debian-lts-announce/2020/11/msg00031.html"
},
{
"name": "[debian-lts-announce] 20230616 [SECURITY] [DLA 3455-1] golang-go.crypto security update",
"tags": [
"mailing-list"
],
"url": "https://lists.debian.org/debian-lts-announce/2023/06/msg00017.html"
}
],
"problemTypes": [
{
"descriptions": [
{
"type": "text",
"lang": "en",
"description": "n/a"
}
]
}
]
}
}
}
-- cves/2021/27xxx/CVE-2021-27919.json --
{
"containers": {
"cna": {
"affected": [
{
"product": "n/a",
"vendor": "n/a",
"versions": [
{
"status": "affected",
"version": "n/a"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "archive/zip in Go 1.16.x before 1.16.1 allows attackers to cause a denial of service (panic) upon attempted use of the Reader.Open API for a ZIP archive in which ../ occurs at the beginning of any filename."
}
],
"problemTypes": [
{
"descriptions": [
{
"description": "n/a",
"lang": "en",
"type": "text"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2022-08-04T15:11:53",
"orgId": "8254265b-2729-46b6-b9e3-3dfca2d5bfca",
"shortName": "mitre"
},
"references": [
{
"tags": [
"x_refsource_MISC"
],
"url": "https://groups.google.com/g/golang-announce/c/MfiLYjG-RAw"
},
{
"name": "FEDORA-2021-6a3024b3fd",
"tags": [
"vendor-advisory",
"x_refsource_FEDORA"
],
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2MU47VKTNXX33ZDLTI2ORRUY3KLJKU6G/"
},
{
"name": "FEDORA-2021-e71b05ba7b",
"tags": [
"vendor-advisory",
"x_refsource_FEDORA"
],
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HM7U5JNS5WU66Q3S26PFIU2ITB2ATTQ4/"
},
{
"name": "GLSA-202208-02",
"tags": [
"vendor-advisory",
"x_refsource_GENTOO"
],
"url": "https://security.gentoo.org/glsa/202208-02"
}
],
"x_legacyV4Record": {
"CVE_data_meta": {
"ASSIGNER": "cve@mitre.org",
"ID": "CVE-2021-27919",
"STATE": "PUBLIC"
},
"affects": {
"vendor": {
"vendor_data": [
{
"product": {
"product_data": [
{
"product_name": "n/a",
"version": {
"version_data": [
{
"version_value": "n/a"
}
]
}
}
]
},
"vendor_name": "n/a"
}
]
}
},
"data_format": "MITRE",
"data_type": "CVE",
"data_version": "4.0",
"description": {
"description_data": [
{
"lang": "eng",
"value": "archive/zip in Go 1.16.x before 1.16.1 allows attackers to cause a denial of service (panic) upon attempted use of the Reader.Open API for a ZIP archive in which ../ occurs at the beginning of any filename."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "n/a"
}
]
}
]
},
"references": {
"reference_data": [
{
"name": "https://groups.google.com/g/golang-announce/c/MfiLYjG-RAw",
"refsource": "MISC",
"url": "https://groups.google.com/g/golang-announce/c/MfiLYjG-RAw"
},
{
"name": "FEDORA-2021-6a3024b3fd",
"refsource": "FEDORA",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2MU47VKTNXX33ZDLTI2ORRUY3KLJKU6G/"
},
{
"name": "FEDORA-2021-e71b05ba7b",
"refsource": "FEDORA",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HM7U5JNS5WU66Q3S26PFIU2ITB2ATTQ4/"
},
{
"name": "GLSA-202208-02",
"refsource": "GENTOO",
"url": "https://security.gentoo.org/glsa/202208-02"
}
]
}
}
}
},
"cveMetadata": {
"assignerOrgId": "8254265b-2729-46b6-b9e3-3dfca2d5bfca",
"assignerShortName": "mitre",
"cveId": "CVE-2021-27919",
"datePublished": "2021-03-11T00:00:13",
"dateReserved": "2021-03-03T00:00:00",
"dateUpdated": "2022-08-04T15:11:53",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.0"
}
-- cves/2021/3xxx/CVE-2021-3115.json --
{
"containers": {
"cna": {
"affected": [
{
"product": "n/a",
"vendor": "n/a",
"versions": [
{
"status": "affected",
"version": "n/a"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "Go before 1.14.14 and 1.15.x before 1.15.7 on Windows is vulnerable to Command Injection and remote code execution when using the \"go get\" command to fetch modules that make use of cgo (for example, cgo can execute a gcc program from an untrusted download)."
}
],
"problemTypes": [
{
"descriptions": [
{
"description": "n/a",
"lang": "en",
"type": "text"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2022-08-04T15:09:52",
"orgId": "8254265b-2729-46b6-b9e3-3dfca2d5bfca",
"shortName": "mitre"
},
"references": [
{
"tags": [
"x_refsource_CONFIRM"
],
"url": "https://groups.google.com/g/golang-announce/c/mperVMGa98w"
},
{
"tags": [
"x_refsource_CONFIRM"
],
"url": "https://blog.golang.org/path-security"
},
{
"name": "FEDORA-2021-e435a8bb88",
"tags": [
"vendor-advisory",
"x_refsource_FEDORA"
],
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YWAYJGXWC232SG3UR3TR574E6BP3OSQQ/"
},
{
"tags": [
"x_refsource_CONFIRM"
],
"url": "https://security.netapp.com/advisory/ntap-20210219-0001/"
},
{
"name": "GLSA-202208-02",
"tags": [
"vendor-advisory",
"x_refsource_GENTOO"
],
"url": "https://security.gentoo.org/glsa/202208-02"
}
],
"x_legacyV4Record": {
"CVE_data_meta": {
"ASSIGNER": "cve@mitre.org",
"ID": "CVE-2021-3115",
"STATE": "PUBLIC"
},
"affects": {
"vendor": {
"vendor_data": [
{
"product": {
"product_data": [
{
"product_name": "n/a",
"version": {
"version_data": [
{
"version_value": "n/a"
}
]
}
}
]
},
"vendor_name": "n/a"
}
]
}
},
"data_format": "MITRE",
"data_type": "CVE",
"data_version": "4.0",
"description": {
"description_data": [
{
"lang": "eng",
"value": "Go before 1.14.14 and 1.15.x before 1.15.7 on Windows is vulnerable to Command Injection and remote code execution when using the \"go get\" command to fetch modules that make use of cgo (for example, cgo can execute a gcc program from an untrusted download)."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "n/a"
}
]
}
]
},
"references": {
"reference_data": [
{
"name": "https://groups.google.com/g/golang-announce/c/mperVMGa98w",
"refsource": "CONFIRM",
"url": "https://groups.google.com/g/golang-announce/c/mperVMGa98w"
},
{
"name": "https://blog.golang.org/path-security",
"refsource": "CONFIRM",
"url": "https://blog.golang.org/path-security"
},
{
"name": "FEDORA-2021-e435a8bb88",
"refsource": "FEDORA",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YWAYJGXWC232SG3UR3TR574E6BP3OSQQ/"
},
{
"name": "https://security.netapp.com/advisory/ntap-20210219-0001/",
"refsource": "CONFIRM",
"url": "https://security.netapp.com/advisory/ntap-20210219-0001/"
},
{
"name": "GLSA-202208-02",
"refsource": "GENTOO",
"url": "https://security.gentoo.org/glsa/202208-02"
}
]
}
}
}
},
"cveMetadata": {
"assignerOrgId": "8254265b-2729-46b6-b9e3-3dfca2d5bfca",
"assignerShortName": "mitre",
"cveId": "CVE-2021-3115",
"datePublished": "2021-01-26T02:14:51",
"dateReserved": "2021-01-11T00:00:00",
"dateUpdated": "2022-08-04T15:09:52",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.0"
}
-- cves/2022/39xxx/CVE-2022-39213.json --
{
"containers": {
"cna": {
"affected": [
{
"product": "go-cvss",
"vendor": "pandatix",
"versions": [
{
"status": "affected",
"version": ">= 0.2.0, < 0.4.0"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "go-cvss is a Go module to manipulate Common Vulnerability Scoring System (CVSS). In affected versions when a full CVSS v2.0 vector string is parsed using `ParseVector`, an Out-of-Bounds Read is possible due to a lack of tests. The Go module will then panic. The problem is patched in tag `v0.4.0`, by the commit `d9d478ff0c13b8b09ace030db9262f3c2fe031f4`. Users are advised to upgrade. Users unable to upgrade may avoid this issue by parsing only CVSS v2.0 vector strings that do not have all attributes defined (e.g. `AV:N/AC:L/Au:N/C:P/I:P/A:C/E:U/RL:OF/RC:C/CDP:MH/TD:H/CR:M/IR:M/AR:M`). As stated in [SECURITY.md](https://github.com/pandatix/go-cvss/blob/master/SECURITY.md), the CPE v2.3 to refer to this Go module is `cpe:2.3:a:pandatix:go_cvss:*:*:*:*:*:*:*:*`. The entry has already been requested to the NVD CPE dictionary."
}
],
"metrics": [
{
"cvssV3_1": {
"attackComplexity": "LOW",
"attackVector": "NETWORK",
"availabilityImpact": "HIGH",
"baseScore": 7.5,
"baseSeverity": "HIGH",
"confidentialityImpact": "NONE",
"integrityImpact": "NONE",
"privilegesRequired": "NONE",
"scope": "UNCHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"version": "3.1"
}
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-125",
"description": "CWE-125: Out-of-bounds Read",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2022-09-15T21:45:12",
"orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"shortName": "GitHub_M"
},
"references": [
{
"tags": [
"x_refsource_CONFIRM"
],
"url": "https://github.com/pandatix/go-cvss/security/advisories/GHSA-xhmf-mmv2-4hhx"
},
{
"tags": [
"x_refsource_MISC"
],
"url": "https://github.com/pandatix/go-cvss/commit/d9d478ff0c13b8b09ace030db9262f3c2fe031f4"
},
{
"tags": [
"x_refsource_MISC"
],
"url": "https://github.com/pandatix/go-cvss/blob/master/SECURITY.md"
}
],
"source": {
"advisory": "GHSA-xhmf-mmv2-4hhx",
"discovery": "UNKNOWN"
},
"title": "Out-of-bounds Read in go-cvss",
"x_legacyV4Record": {
"CVE_data_meta": {
"ASSIGNER": "security-advisories@github.com",
"ID": "CVE-2022-39213",
"STATE": "PUBLIC",
"TITLE": "Out-of-bounds Read in go-cvss"
},
"affects": {
"vendor": {
"vendor_data": [
{
"product": {
"product_data": [
{
"product_name": "go-cvss",
"version": {
"version_data": [
{
"version_value": ">= 0.2.0, < 0.4.0"
}
]
}
}
]
},
"vendor_name": "pandatix"
}
]
}
},
"data_format": "MITRE",
"data_type": "CVE",
"data_version": "4.0",
"description": {
"description_data": [
{
"lang": "eng",
"value": "go-cvss is a Go module to manipulate Common Vulnerability Scoring System (CVSS). In affected versions when a full CVSS v2.0 vector string is parsed using `ParseVector`, an Out-of-Bounds Read is possible due to a lack of tests. The Go module will then panic. The problem is patched in tag `v0.4.0`, by the commit `d9d478ff0c13b8b09ace030db9262f3c2fe031f4`. Users are advised to upgrade. Users unable to upgrade may avoid this issue by parsing only CVSS v2.0 vector strings that do not have all attributes defined (e.g. `AV:N/AC:L/Au:N/C:P/I:P/A:C/E:U/RL:OF/RC:C/CDP:MH/TD:H/CR:M/IR:M/AR:M`). As stated in [SECURITY.md](https://github.com/pandatix/go-cvss/blob/master/SECURITY.md), the CPE v2.3 to refer to this Go module is `cpe:2.3:a:pandatix:go_cvss:*:*:*:*:*:*:*:*`. The entry has already been requested to the NVD CPE dictionary."
}
]
},
"impact": {
"cvss": {
"attackComplexity": "LOW",
"attackVector": "NETWORK",
"availabilityImpact": "HIGH",
"baseScore": 7.5,
"baseSeverity": "HIGH",
"confidentialityImpact": "NONE",
"integrityImpact": "NONE",
"privilegesRequired": "NONE",
"scope": "UNCHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"version": "3.1"
}
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "CWE-125: Out-of-bounds Read"
}
]
}
]
},
"references": {
"reference_data": [
{
"name": "https://github.com/pandatix/go-cvss/security/advisories/GHSA-xhmf-mmv2-4hhx",
"refsource": "CONFIRM",
"url": "https://github.com/pandatix/go-cvss/security/advisories/GHSA-xhmf-mmv2-4hhx"
},
{
"name": "https://github.com/pandatix/go-cvss/commit/d9d478ff0c13b8b09ace030db9262f3c2fe031f4",
"refsource": "MISC",
"url": "https://github.com/pandatix/go-cvss/commit/d9d478ff0c13b8b09ace030db9262f3c2fe031f4"
},
{
"name": "https://github.com/pandatix/go-cvss/blob/master/SECURITY.md",
"refsource": "MISC",
"url": "https://github.com/pandatix/go-cvss/blob/master/SECURITY.md"
}
]
},
"source": {
"advisory": "GHSA-xhmf-mmv2-4hhx",
"discovery": "UNKNOWN"
}
}
}
},
"cveMetadata": {
"assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"assignerShortName": "GitHub_M",
"cveId": "CVE-2022-39213",
"datePublished": "2022-09-15T21:45:12",
"dateReserved": "2022-09-02T00:00:00",
"dateUpdated": "2022-09-15T21:45:12",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.0"
}
-- cves/2023/29xxx/CVE-2023-29407.json --
{
"dataType": "CVE_RECORD",
"dataVersion": "5.0",
"cveMetadata": {
"cveId": "CVE-2023-29407",
"assignerOrgId": "1bb62c36-49e3-4200-9d77-64a1400537cc",
"state": "PUBLISHED",
"assignerShortName": "Go",
"dateReserved": "2023-04-05T19:36:35.043Z",
"datePublished": "2023-08-02T19:52:53.482Z",
"dateUpdated": "2023-08-02T19:52:53.482Z"
},
"containers": {
"cna": {
"providerMetadata": {
"orgId": "1bb62c36-49e3-4200-9d77-64a1400537cc",
"shortName": "Go",
"dateUpdated": "2023-08-02T19:52:53.482Z"
},
"title": "Excessive CPU consumption when decoding 0-height images in golang.org/x/image/tiff",
"descriptions": [
{
"lang": "en",
"value": "A maliciously-crafted image can cause excessive CPU consumption in decoding. A tiled image with a height of 0 and a very large width can cause excessive CPU consumption, despite the image size (width * height) appearing to be zero."
}
],
"affected": [
{
"vendor": "golang.org/x/image",
"product": "golang.org/x/image/tiff",
"collectionURL": "https://pkg.go.dev",
"packageName": "golang.org/x/image/tiff",
"versions": [
{
"version": "0",
"lessThan": "0.10.0",
"status": "affected",
"versionType": "semver"
}
],
"programRoutines": [
{
"name": "newDecoder"
},
{
"name": "Decode"
},
{
"name": "DecodeConfig"
}
],
"defaultStatus": "unaffected"
}
],
"problemTypes": [
{
"descriptions": [
{
"lang": "en",
"description": "CWE-834: Excessive Iteration"
}
]
}
],
"references": [
{
"url": "https://go.dev/issue/61581"
},
{
"url": "https://go.dev/cl/514897"
},
{
"url": "https://pkg.go.dev/vuln/GO-2023-1990"
},
{
"url": "https://security.netapp.com/advisory/ntap-20230831-0009/"
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KO54NBDUJXKAZNGCFOEYL2LKK2RQP6K6/"
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XWH6Q7NVM4MV3GWFEU4PA67AWZHVFJQ2/"
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XZTEP6JYILRBNDTNWTEQ5D4QUUVQBESK/"
}
],
"credits": [
{
"lang": "en",
"value": "Philippe Antoine (Catena cyber)"
}
]
}
}
}
-- cves/2023/44xxx/CVE-2023-44378.json --
{
"dataType": "CVE_RECORD",
"dataVersion": "5.0",
"cveMetadata": {
"cveId": "CVE-2023-44378",
"assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"state": "PUBLISHED",
"assignerShortName": "GitHub_M",
"dateReserved": "2023-09-28T17:56:32.612Z",
"datePublished": "2023-10-09T13:33:54.973Z",
"dateUpdated": "2023-10-09T13:33:54.973Z"
},
"containers": {
"cna": {
"title": "gnark vulnerable to unsoundness in variable comparison/non-unique binary decomposition",
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-191",
"lang": "en",
"description": "CWE-191: Integer Underflow (Wrap or Wraparound)",
"type": "CWE"
}
]
},
{
"descriptions": [
{
"cweId": "CWE-697",
"lang": "en",
"description": "CWE-697: Incorrect Comparison",
"type": "CWE"
}
]
}
],
"metrics": [
{
"cvssV3_1": {
"attackComplexity": "LOW",
"attackVector": "LOCAL",
"availabilityImpact": "NONE",
"baseScore": 7.1,
"baseSeverity": "HIGH",
"confidentialityImpact": "NONE",
"integrityImpact": "HIGH",
"privilegesRequired": "NONE",
"scope": "CHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N",
"version": "3.1"
}
}
],
"references": [
{
"name": "https://github.com/Consensys/gnark/security/advisories/GHSA-498w-5j49-vqjg",
"tags": [
"x_refsource_CONFIRM"
],
"url": "https://github.com/Consensys/gnark/security/advisories/GHSA-498w-5j49-vqjg"
},
{
"name": "https://github.com/zkopru-network/zkopru/issues/116",
"tags": [
"x_refsource_MISC"
],
"url": "https://github.com/zkopru-network/zkopru/issues/116"
},
{
"name": "https://github.com/Consensys/gnark/commit/59a4087261a6c73f13e80d695c17b398c3d0934f",
"tags": [
"x_refsource_MISC"
],
"url": "https://github.com/Consensys/gnark/commit/59a4087261a6c73f13e80d695c17b398c3d0934f"
}
],
"affected": [
{
"vendor": "Consensys",
"product": "gnark",
"versions": [
{
"version": "< 0.9.0",
"status": "affected"
}
]
}
],
"providerMetadata": {
"orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"shortName": "GitHub_M",
"dateUpdated": "2023-10-09T13:33:54.973Z"
},
"descriptions": [
{
"lang": "en",
"value": "gnark is a zk-SNARK library that offers a high-level API to design circuits. Prior to version 0.9.0, for some in-circuit values, it is possible to construct two valid decomposition to bits. In addition to the canonical decomposition of `a`, for small values there exists a second decomposition for `a+r` (where `r` is the modulus the values are being reduced by). The second decomposition was possible due to overflowing the field where the values are defined. Upgrading to version 0.9.0 should fix the issue without needing to change the calls to value comparison methods."
}
],
"source": {
"advisory": "GHSA-498w-5j49-vqjg",
"discovery": "UNKNOWN"
}
}
}
}
-- cves/2023/45xxx/CVE-2023-45141.json --
{
"dataType": "CVE_RECORD",
"dataVersion": "5.0",
"cveMetadata": {
"cveId": "CVE-2023-45141",
"assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"state": "PUBLISHED",
"assignerShortName": "GitHub_M",
"dateReserved": "2023-10-04T16:02:46.329Z",
"datePublished": "2023-10-16T20:48:55.590Z",
"dateUpdated": "2023-10-16T20:48:55.590Z"
},
"containers": {
"cna": {
"title": "CSRF Token Validation Vulnerability in fiber",
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-352",
"lang": "en",
"description": "CWE-352: Cross-Site Request Forgery (CSRF)",
"type": "CWE"
}
]
},
{
"descriptions": [
{
"cweId": "CWE-565",
"lang": "en",
"description": "CWE-565: Reliance on Cookies without Validation and Integrity Checking",
"type": "CWE"
}
]
}
],
"metrics": [
{
"cvssV3_1": {
"attackComplexity": "LOW",
"attackVector": "NETWORK",
"availabilityImpact": "LOW",
"baseScore": 8.6,
"baseSeverity": "HIGH",
"confidentialityImpact": "LOW",
"integrityImpact": "HIGH",
"privilegesRequired": "NONE",
"scope": "UNCHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L",
"version": "3.1"
}
}
],
"references": [
{
"name": "https://github.com/gofiber/fiber/security/advisories/GHSA-mv73-f69x-444p",
"tags": [
"x_refsource_CONFIRM"
],
"url": "https://github.com/gofiber/fiber/security/advisories/GHSA-mv73-f69x-444p"
}
],
"affected": [
{
"vendor": "gofiber",
"product": "fiber",
"versions": [
{
"version": "< 2.50.0",
"status": "affected"
}
]
}
],
"providerMetadata": {
"orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"shortName": "GitHub_M",
"dateUpdated": "2023-10-16T20:48:55.590Z"
},
"descriptions": [
{
"lang": "en",
"value": "Fiber is an express inspired web framework written in Go. A Cross-Site Request Forgery (CSRF) vulnerability has been identified in the application, which allows an attacker to obtain tokens and forge malicious requests on behalf of a user. This can lead to unauthorized actions being taken on the user's behalf, potentially compromising the security and integrity of the application. The vulnerability is caused by improper validation and enforcement of CSRF tokens within the application. This vulnerability has been addressed in version 2.50.0 and users are advised to upgrade. Users should take additional security measures like captchas or Two-Factor Authentication (2FA) and set Session cookies with SameSite=Lax or SameSite=Secure, and the Secure and HttpOnly attributes."
}
],
"source": {
"advisory": "GHSA-mv73-f69x-444p",
"discovery": "UNKNOWN"
}
}
}
}
-- cves/2023/45xxx/CVE-2023-45283.json --
{
"dataType": "CVE_RECORD",
"dataVersion": "5.0",
"cveMetadata": {
"cveId": "CVE-2023-45283",
"assignerOrgId": "1bb62c36-49e3-4200-9d77-64a1400537cc",
"state": "PUBLISHED",
"assignerShortName": "Go",
"dateReserved": "2023-10-06T17:06:26.220Z",
"datePublished": "2023-11-09T16:30:12.395Z",
"dateUpdated": "2023-12-06T16:27:23.552Z"
},
"containers": {
"cna": {
"providerMetadata": {
"orgId": "1bb62c36-49e3-4200-9d77-64a1400537cc",
"shortName": "Go",
"dateUpdated": "2023-12-06T16:27:23.552Z"
},
"title": "Insecure parsing of Windows paths with a \\??\\ prefix in path/filepath",
"descriptions": [
{
"lang": "en",
"value": "The filepath package does not recognize paths with a \\??\\ prefix as special. On Windows, a path beginning with \\??\\ is a Root Local Device path equivalent to a path beginning with \\\\?\\. Paths with a \\??\\ prefix may be used to access arbitrary locations on the system. For example, the path \\??\\c:\\x is equivalent to the more common path c:\\x. Before fix, Clean could convert a rooted path such as \\a\\..\\??\\b into the root local device path \\??\\b. Clean will now convert this to .\\??\\b. Similarly, Join(\\, ??, b) could convert a seemingly innocent sequence of path elements into the root local device path \\??\\b. Join will now convert this to \\.\\??\\b. In addition, with fix, IsAbs now correctly reports paths beginning with \\??\\ as absolute, and VolumeName correctly reports the \\??\\ prefix as a volume name. UPDATE: Go 1.20.11 and Go 1.21.4 inadvertently changed the definition of the volume name in Windows paths starting with \\?, resulting in filepath.Clean(\\?\\c:) returning \\?\\c: rather than \\?\\c:\\ (among other effects). The previous behavior has been restored."
}
],
"affected": [
{
"vendor": "Go standard library",
"product": "path/filepath",
"collectionURL": "https://pkg.go.dev",
"packageName": "path/filepath",
"versions": [
{
"version": "0",
"lessThan": "1.20.11",
"status": "affected",
"versionType": "semver"
},
{
"version": "1.21.0-0",
"lessThan": "1.21.4",
"status": "affected",
"versionType": "semver"
}
],
"platforms": [
"windows"
],
"programRoutines": [
{
"name": "Clean"
},
{
"name": "volumeNameLen"
},
{
"name": "join"
},
{
"name": "Abs"
},
{
"name": "Base"
},
{
"name": "Dir"
},
{
"name": "EvalSymlinks"
},
{
"name": "Glob"
},
{
"name": "IsLocal"
},
{
"name": "Join"
},
{
"name": "Rel"
},
{
"name": "Split"
},
{
"name": "VolumeName"
},
{
"name": "Walk"
},
{
"name": "WalkDir"
}
],
"defaultStatus": "unaffected"
},
{
"vendor": "Go standard library",
"product": "internal/safefilepath",
"collectionURL": "https://pkg.go.dev",
"packageName": "internal/safefilepath",
"versions": [
{
"version": "0",
"lessThan": "1.20.11",
"status": "affected",
"versionType": "semver"
},
{
"version": "1.21.0-0",
"lessThan": "1.21.4",
"status": "affected",
"versionType": "semver"
}
],
"platforms": [
"windows"
],
"programRoutines": [
{
"name": "fromFS"
},
{
"name": "FromFS"
}
],
"defaultStatus": "unaffected"
},
{
"vendor": "Go standard library",
"product": "path/filepath",
"collectionURL": "https://pkg.go.dev",
"packageName": "path/filepath",
"versions": [
{
"version": "1.20.11",
"lessThan": "1.20.12",
"status": "affected",
"versionType": "semver"
},
{
"version": "1.21.4",
"lessThan": "1.21.5",
"status": "affected",
"versionType": "semver"
}
],
"platforms": [
"windows"
],
"programRoutines": [
{
"name": "volumeNameLen"
},
{
"name": "Abs"
},
{
"name": "Base"
},
{
"name": "Clean"
},
{
"name": "Dir"
},
{
"name": "EvalSymlinks"
},
{
"name": "Glob"
},
{
"name": "IsLocal"
},
{
"name": "Join"
},
{
"name": "Rel"
},
{
"name": "Split"
},
{
"name": "VolumeName"
},
{
"name": "Walk"
},
{
"name": "WalkDir"
}
],
"defaultStatus": "unaffected"
}
],
"problemTypes": [
{
"descriptions": [
{
"lang": "en",
"description": "CWE-41: Improper Resolution of Path Equivalence"
}
]
}
],
"references": [
{
"url": "https://go.dev/issue/63713"
},
{
"url": "https://go.dev/cl/540277"
},
{
"url": "https://groups.google.com/g/golang-announce/c/4tU8LZfBFkY"
},
{
"url": "https://go.dev/issue/64028"
},
{
"url": "https://go.dev/cl/541175"
},
{
"url": "https://groups.google.com/g/golang-dev/c/6ypN5EjibjM/m/KmLVYH_uAgAJ"
},
{
"url": "https://pkg.go.dev/vuln/GO-2023-2185"
},
{
"url": "http://www.openwall.com/lists/oss-security/2023/12/05/2"
},
{
"url": "https://security.netapp.com/advisory/ntap-20231214-0008/"
}
]
}
}
}
-- cves/2023/45xxx/CVE-2023-45285.json --
{
"dataType": "CVE_RECORD",
"dataVersion": "5.0",
"cveMetadata": {
"cveId": "CVE-2023-45285",
"assignerOrgId": "1bb62c36-49e3-4200-9d77-64a1400537cc",
"state": "PUBLISHED",
"assignerShortName": "Go",
"dateReserved": "2023-10-06T17:06:26.220Z",
"datePublished": "2023-12-06T16:27:55.521Z",
"dateUpdated": "2023-12-06T16:27:55.521Z"
},
"containers": {
"cna": {
"providerMetadata": {
"orgId": "1bb62c36-49e3-4200-9d77-64a1400537cc",
"shortName": "Go",
"dateUpdated": "2023-12-06T16:27:55.521Z"
},
"title": "Command 'go get' may unexpectedly fallback to insecure git in cmd/go",
"descriptions": [
{
"lang": "en",
"value": "Using go get to fetch a module with the \".git\" suffix may unexpectedly fallback to the insecure \"git://\" protocol if the module is unavailable via the secure \"https://\" and \"git+ssh://\" protocols, even if GOINSECURE is not set for said module. This only affects users who are not using the module proxy and are fetching modules directly (i.e. GOPROXY=off)."
}
],
"affected": [
{
"vendor": "Go toolchain",
"product": "cmd/go",
"collectionURL": "https://pkg.go.dev",
"packageName": "cmd/go",
"versions": [
{
"version": "0",
"lessThan": "1.20.12",
"status": "affected",
"versionType": "semver"
},
{
"version": "1.21.0-0",
"lessThan": "1.21.5",
"status": "affected",
"versionType": "semver"
}
],
"defaultStatus": "unaffected"
}
],
"problemTypes": [
{
"descriptions": [
{
"lang": "en",
"description": "CWE-636: Not Failing Securely ('Failing Open')"
}
]
}
],
"references": [
{
"url": "https://groups.google.com/g/golang-dev/c/6ypN5EjibjM/m/KmLVYH_uAgAJ"
},
{
"url": "https://go.dev/issue/63845"
},
{
"url": "https://go.dev/cl/540257"
},
{
"url": "https://pkg.go.dev/vuln/GO-2023-2383"
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UIU6HOGV6RRIKWM57LOXQA75BGZSIH6G/"
}
],
"credits": [
{
"lang": "en",
"value": "David Leadbeater"
}
]
}
}
}
-- cves/2023/45xxx/CVE-2023-45286.json --
{
"dataType": "CVE_RECORD",
"dataVersion": "5.0",
"cveMetadata": {
"cveId": "CVE-2023-45286",
"assignerOrgId": "1bb62c36-49e3-4200-9d77-64a1400537cc",
"state": "PUBLISHED",
"assignerShortName": "Go",
"dateReserved": "2023-10-06T17:06:26.221Z",
"datePublished": "2023-11-28T16:31:21.078Z",
"dateUpdated": "2024-01-04T18:41:48.460Z"
},
"containers": {
"cna": {
"providerMetadata": {
"orgId": "1bb62c36-49e3-4200-9d77-64a1400537cc",
"shortName": "Go",
"dateUpdated": "2024-01-04T18:41:48.460Z"
},
"title": "HTTP request body disclosure in github.com/go-resty/resty/v2",
"descriptions": [
{
"lang": "en",
"value": "A race condition in go-resty can result in HTTP request body disclosure across requests. This condition can be triggered by calling sync.Pool.Put with the same *bytes.Buffer more than once, when request retries are enabled and a retry occurs. The call to sync.Pool.Get will then return a bytes.Buffer that hasn't had bytes.Buffer.Reset called on it. This dirty buffer will contain the HTTP request body from an unrelated request, and go-resty will append the current HTTP request body to it, sending two bodies in one request. The sync.Pool in question is defined at package level scope, so a completely unrelated server could receive the request body."
}
],
"affected": [
{
"vendor": "github.com/go-resty/resty/v2",
"product": "github.com/go-resty/resty/v2",
"collectionURL": "https://pkg.go.dev",
"packageName": "github.com/go-resty/resty/v2",
"versions": [
{
"version": "2.10.0",
"lessThan": "2.11.0",
"status": "affected",
"versionType": "semver"
}
],
"programRoutines": [
{
"name": "handleRequestBody"
},
{
"name": "Backoff"
},
{
"name": "Request.Delete"
},
{
"name": "Request.Execute"
},
{
"name": "Request.Get"
},
{
"name": "Request.Head"
},
{
"name": "Request.Options"
},
{
"name": "Request.Patch"
},
{
"name": "Request.Post"
},
{
"name": "Request.Put"
},
{
"name": "Request.Send"
}
],
"defaultStatus": "unaffected"
}
],
"problemTypes": [
{
"descriptions": [
{
"lang": "en",
"description": "CWE-200: Exposure of Sensitive Information to an Unauthorized Actor"
}
]
}
],
"references": [
{
"url": "https://github.com/go-resty/resty/issues/743"
},
{
"url": "https://github.com/go-resty/resty/issues/739"
},
{
"url": "https://github.com/go-resty/resty/pull/745"
},
{
"url": "https://github.com/go-resty/resty/commit/577fed8730d79f583eb48dfc81674164e1fc471e"
},
{
"url": "https://pkg.go.dev/vuln/GO-2023-2328"
}
],
"credits": [
{
"lang": "en",
"value": "Logan Attwood (@lattwood)"
}
]
}
}
}
-- cves/2024/2xxx/CVE-2024-2056.json --
{
"dataType": "CVE_RECORD",
"dataVersion": "5.0",
"cveMetadata": {
"cveId": "CVE-2024-2056",
"assignerOrgId": "26969f82-7e87-44d8-9cb5-f6fb926ddd43",
"state": "PUBLISHED",
"assignerShortName": "AHA",
"dateReserved": "2024-03-01T02:03:12.654Z",
"datePublished": "2024-03-05T18:57:03.524Z",
"dateUpdated": "2024-03-05T18:59:28.493Z"
},
"containers": {
"cna": {
"affected": [
{
"defaultStatus": "unaffected",
"product": "Artica Proxy",
"vendor": "Artica Tech",
"versions": [
{
"status": "affected",
"version": "4.50"
}
]
}
],
"credits": [
{
"lang": "en",
"type": "finder",
"user": "00000000-0000-4000-9000-000000000000",
"value": "Jim Becher of KoreLogic, Inc."
},
{
"lang": "en",
"type": "finder",
"user": "00000000-0000-4000-9000-000000000000",
"value": "Jaggar Henry of KoreLogic, Inc."
}
],
"datePublic": "2024-03-05T18:00:00.000Z",
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "Services that are running and bound to the loopback interface on the Artica Proxy are accessible through the proxy service. In particular, the \"tailon\" service is running, running as the root user, is bound to the loopback interface, and is listening on TCP port 7050. Security issues associated with exposing this network service are documented at <span style=\"background-color: rgb(252, 252, 252);\">gvalkov's 'tailon' GitHub repo</span>. Using the tailon service, the contents of any file on the Artica Proxy can be viewed."
}
],
"value": "Services that are running and bound to the loopback interface on the Artica Proxy are accessible through the proxy service. In particular, the \"tailon\" service is running, running as the root user, is bound to the loopback interface, and is listening on TCP port 7050. Security issues associated with exposing this network service are documented at gvalkov's 'tailon' GitHub repo. Using the tailon service, the contents of any file on the Artica Proxy can be viewed."
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-288",
"description": "CWE-288 Authentication Bypass Using an Alternate Path or Channel",
"lang": "en",
"type": "CWE"
}
]
},
{
"descriptions": [
{
"cweId": "CWE-552",
"description": "CWE-552 Files or Directories Accessible to External Parties",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"orgId": "26969f82-7e87-44d8-9cb5-f6fb926ddd43",
"shortName": "AHA",
"dateUpdated": "2024-03-05T18:59:28.493Z"
},
"references": [
{
"tags": [
"third-party-advisory"
],
"url": "https://korelogic.com/Resources/Advisories/KL-001-2024-004.txt"
},
{
"tags": [
"related"
],
"url": "https://github.com/gvalkov/tailon#security"
},
{
"url": "http://seclists.org/fulldisclosure/2024/Mar/14"
}
],
"source": {
"discovery": "EXTERNAL"
},
"title": "Artica Proxy Loopback Services Remotely Accessible Unauthenticated",
"x_generator": {
"engine": "Vulnogram 0.1.0-dev"
}
}
}
}
-- cves/2024/3xxx/CVE-2024-3094.json --
{
"dataType": "CVE_RECORD",
"dataVersion": "5.0",
"cveMetadata": {
"cveId": "CVE-2024-3094",
"assignerOrgId": "53f830b8-0a3f-465b-8143-3b8a9948e749",
"state": "PUBLISHED",
"assignerShortName": "redhat",
"dateReserved": "2024-03-29T15:38:13.249Z",
"datePublished": "2024-03-29T16:51:12.588Z",
"dateUpdated": "2024-04-18T17:29:57.790Z"
},
"containers": {
"cna": {
"title": "Xz: malicious code in distributed source",
"metrics": [
{
"other": {
"content": {
"value": "Critical",
"namespace": "https://access.redhat.com/security/updates/classification/"
},
"type": "Red Hat severity rating"
}
},
{
"cvssV3_1": {
"attackComplexity": "LOW",
"attackVector": "NETWORK",
"availabilityImpact": "HIGH",
"baseScore": 10,
"baseSeverity": "CRITICAL",
"confidentialityImpact": "HIGH",
"integrityImpact": "HIGH",
"privilegesRequired": "NONE",
"scope": "CHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H",
"version": "3.1"
},
"format": "CVSS"
}
],
"descriptions": [
{
"lang": "en",
"value": "Malicious code was discovered in the upstream tarballs of xz, starting with version 5.6.0. \r\nThrough a series of complex obfuscations, the liblzma build process extracts a prebuilt object file from a disguised test file existing in the source code, which is then used to modify specific functions in the liblzma code. This results in a modified liblzma library that can be used by any software linked against this library, intercepting and modifying the data interaction with this library."
}
],
"affected": [
{
"versions": [
{
"status": "affected",
"version": "5.6.0"
},
{
"status": "affected",
"version": "5.6.1"
}
],
"packageName": "xz",
"collectionURL": "https://github.com/tukaani-project/xz",
"defaultStatus": "unaffected"
},
{
"vendor": "Red Hat",
"product": "Red Hat Enterprise Linux 6",
"collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
"packageName": "xz",
"defaultStatus": "unaffected",
"cpes": [
"cpe:/o:redhat:enterprise_linux:6"
]
},
{
"vendor": "Red Hat",
"product": "Red Hat Enterprise Linux 7",
"collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
"packageName": "xz",
"defaultStatus": "unaffected",
"cpes": [
"cpe:/o:redhat:enterprise_linux:7"
]
},
{
"vendor": "Red Hat",
"product": "Red Hat Enterprise Linux 8",
"collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
"packageName": "xz",
"defaultStatus": "unaffected",
"cpes": [
"cpe:/o:redhat:enterprise_linux:8"
]
},
{
"vendor": "Red Hat",
"product": "Red Hat Enterprise Linux 9",
"collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
"packageName": "xz",
"defaultStatus": "unaffected",
"cpes": [
"cpe:/o:redhat:enterprise_linux:9"
]
},
{
"vendor": "Red Hat",
"product": "Red Hat JBoss Enterprise Application Platform 8",
"collectionURL": "https://access.redhat.com/jbossnetwork/restricted/listSoftware.html",
"packageName": "xz",
"defaultStatus": "unaffected",
"cpes": [
"cpe:/a:redhat:jboss_enterprise_application_platform:8"
]
}
],
"references": [
{
"url": "https://access.redhat.com/security/cve/CVE-2024-3094",
"tags": [
"vdb-entry",
"x_refsource_REDHAT"
]
},
{
"url": "https://ariadne.space/2024/04/02/the-xz-utils-backdoor-is-a-symptom-of-a-larger-problem/"
},
{
"url": "https://arstechnica.com/security/2024/03/backdoor-found-in-widely-used-linux-utility-breaks-encrypted-ssh-connections/"
},
{
"url": "https://aws.amazon.com/security/security-bulletins/AWS-2024-002/"
},
{
"url": "https://blog.netbsd.org/tnf/entry/statement_on_backdoor_in_xz"
},
{
"url": "https://boehs.org/node/everything-i-know-about-the-xz-backdoor"
},
{
"url": "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1068024"
},
{
"url": "https://bugs.gentoo.org/928134"
},
{
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2272210",
"name": "RHBZ#2272210",
"tags": [
"issue-tracking",
"x_refsource_REDHAT"
]
},
{
"url": "https://bugzilla.suse.com/show_bug.cgi?id=1222124"
},
{
"url": "https://discourse.nixos.org/t/cve-2024-3094-malicious-code-in-xz-5-6-0-and-5-6-1-tarballs/42405"
},
{
"url": "https://gist.github.com/thesamesam/223949d5a074ebc3dce9ee78baad9e27"
},
{
"url": "https://github.com/advisories/GHSA-rxwq-x6h5-x525"
},
{
"url": "https://github.com/amlweems/xzbot"
},
{
"url": "https://github.com/karcherm/xz-malware"
},
{
"url": "https://gynvael.coldwind.pl/?lang=en&id=782"
},
{
"url": "https://lists.debian.org/debian-security-announce/2024/msg00057.html"
},
{
"url": "https://lists.freebsd.org/archives/freebsd-security/2024-March/000248.html"
},
{
"url": "https://lwn.net/Articles/967180/"
},
{
"url": "https://news.ycombinator.com/item?id=39865810"
},
{
"url": "https://news.ycombinator.com/item?id=39877267"
},
{
"url": "https://news.ycombinator.com/item?id=39895344"
},
{
"url": "https://openssf.org/blog/2024/03/30/xz-backdoor-cve-2024-3094/"
},
{
"url": "https://research.swtch.com/xz-script"
},
{
"url": "https://research.swtch.com/xz-timeline"
},
{
"url": "https://security-tracker.debian.org/tracker/CVE-2024-3094"
},
{
"url": "https://security.alpinelinux.org/vuln/CVE-2024-3094"
},
{
"url": "https://security.archlinux.org/CVE-2024-3094"
},
{
"url": "https://security.netapp.com/advisory/ntap-20240402-0001/"
},
{
"url": "https://tukaani.org/xz-backdoor/"
},
{
"url": "https://twitter.com/LetsDefendIO/status/1774804387417751958"
},
{
"url": "https://twitter.com/debian/status/1774219194638409898"
},
{
"url": "https://twitter.com/infosecb/status/1774595540233167206"
},
{
"url": "https://twitter.com/infosecb/status/1774597228864139400"
},
{
"url": "https://ubuntu.com/security/CVE-2024-3094"
},
{
"url": "https://www.cisa.gov/news-events/alerts/2024/03/29/reported-supply-chain-compromise-affecting-xz-utils-data-compression-library-cve-2024-3094"
},
{
"url": "https://www.darkreading.com/vulnerabilities-threats/are-you-affected-by-the-backdoor-in-xz-utils"
},
{
"url": "https://www.kali.org/blog/about-the-xz-backdoor/"
},
{
"url": "https://www.openwall.com/lists/oss-security/2024/03/29/4"
},
{
"url": "https://www.redhat.com/en/blog/urgent-security-alert-fedora-41-and-rawhide-users"
},
{
"url": "https://www.tenable.com/blog/frequently-asked-questions-cve-2024-3094-supply-chain-backdoor-in-xz-utils"
},
{
"url": "https://www.theregister.com/2024/03/29/malicious_backdoor_xz/"
},
{
"url": "https://www.vicarius.io/vsociety/vulnerabilities/cve-2024-3094"
},
{
"url": "https://xeiaso.net/notes/2024/xz-vuln/"
},
{
"url": "http://www.openwall.com/lists/oss-security/2024/03/30/12"
},
{
"url": "http://www.openwall.com/lists/oss-security/2024/03/30/27"
},
{
"url": "http://www.openwall.com/lists/oss-security/2024/03/29/12"
},
{
"url": "http://www.openwall.com/lists/oss-security/2024/03/29/10"
},
{
"url": "http://www.openwall.com/lists/oss-security/2024/03/30/36"
},
{
"url": "http://www.openwall.com/lists/oss-security/2024/04/16/5"
},
{
"url": "http://www.openwall.com/lists/oss-security/2024/03/29/8"
},
{
"url": "http://www.openwall.com/lists/oss-security/2024/03/30/5"
},
{
"url": "http://www.openwall.com/lists/oss-security/2024/03/29/5"
},
{
"url": "http://www.openwall.com/lists/oss-security/2024/03/29/4"
}
],
"datePublic": "2024-03-29T00:00:00+00:00",
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-506",
"description": "Embedded Malicious Code",
"lang": "en",
"type": "CWE"
}
]
}
],
"x_redhatCweChain": "CWE-506: Embedded Malicious Code",
"timeline": [
{
"lang": "en",
"time": "2024-03-27T00:00:00+00:00",
"value": "Reported to Red Hat."
},
{
"lang": "en",
"time": "2024-03-29T00:00:00+00:00",
"value": "Made public."
}
],
"credits": [
{
"lang": "en",
"value": "Red Hat would like to thank Andres Freund for reporting this issue."
}
],
"providerMetadata": {
"orgId": "53f830b8-0a3f-465b-8143-3b8a9948e749",
"shortName": "redhat",
"dateUpdated": "2024-04-18T17:29:57.790Z"
}
}
}
}
-- cves/2024/33xxx/CVE-2024-33522.json --
{
"dataType": "CVE_RECORD",
"dataVersion": "5.0",
"cveMetadata": {
"cveId": "CVE-2024-33522",
"assignerOrgId": "e6d453f4-3dae-4941-bcea-9af25f4e824d",
"state": "PUBLISHED",
"assignerShortName": "Tigera",
"dateReserved": "2024-04-23T16:32:33.170Z",
"datePublished": "2024-04-29T22:19:06.908Z",
"dateUpdated": "2024-04-29T22:19:06.908Z"
},
"containers": {
"cna": {
"affected": [
{
"defaultStatus": "unaffected",
"packageName": "cni-plugin",
"product": "Calico",
"repo": "https://www.tigera.io/tigera-products/calico/",
"vendor": "Tigera",
"versions": [
{
"lessThan": "v3.26.5",
"status": "affected",
"version": "0",
"versionType": "semver"
},
{
"lessThan": "v3.27.3",
"status": "affected",
"version": "v3.27.0",
"versionType": "semver"
},
{
"status": "unaffected",
"version": "v3.28.0"
}
]
},
{
"defaultStatus": "unaffected",
"packageName": "cni-plugin",
"product": "Calico Enterprise ",
"vendor": "Tigera",
"versions": [
{
"lessThan": "v3.17.4",
"status": "affected",
"version": "0",
"versionType": "semver"
},
{
"lessThan": "v3.18.2",
"status": "affected",
"version": "v3.18.0",
"versionType": "semver"
},
{
"lessThan": "v3.19.0-2.0",
"status": "affected",
"version": "v3.19.0-1.0",
"versionType": "semver"
}
]
},
{
"defaultStatus": "unaffected",
"packageName": "cni-plugin",
"product": "Calico Cloud",
"vendor": "Tigera",
"versions": [
{
"lessThan": "v19.3.0",
"status": "affected",
"version": "0",
"versionType": "semver"
}
]
}
],
"credits": [
{
"lang": "en",
"type": "finder",
"value": "Christopher Alonso (Github: @latortuga71)"
},
{
"lang": "en",
"type": "remediation reviewer",
"value": "Anthony Tam"
},
{
"lang": "en",
"type": "remediation verifier",
"value": "Behnam Shobiri"
},
{
"lang": "en",
"type": "remediation developer",
"value": "Pedro Coutinho"
},
{
"lang": "en",
"type": "remediation reviewer",
"value": "Matt Dupre"
}
],
"datePublic": "2024-04-29T19:57:00.000Z",
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "<span style=\"background-color: transparent;\">In vulnerable </span><span style=\"background-color: transparent;\">versions of Calico (v3.27.2 and below), Calico Enterprise (v3.19.0-1, v3.18.1, v3.17.3 and below), and Calico Cloud (v19.2.0 and below), an attacker who has local access to the Kubernetes node, can escalate their privileges by exploiting a vulnerability in the Calico CNI install binary. The issue arises from an incorrect SUID (Set User ID) bit configuration in the binary, combined with the ability to control the input binary, allowing an attacker to execute an arbitrary binary with elevated privileges.</span><br>"
}
],
"value": "In vulnerable versions of Calico (v3.27.2 and below), Calico Enterprise (v3.19.0-1, v3.18.1, v3.17.3 and below), and Calico Cloud (v19.2.0 and below), an attacker who has local access to the Kubernetes node, can escalate their privileges by exploiting a vulnerability in the Calico CNI install binary. The issue arises from an incorrect SUID (Set User ID) bit configuration in the binary, combined with the ability to control the input binary, allowing an attacker to execute an arbitrary binary with elevated privileges.\n"
}
],
"impacts": [
{
"capecId": "CAPEC-233",
"descriptions": [
{
"lang": "en",
"value": "CAPEC-233 Privilege Escalation"
}
]
}
],
"metrics": [
{
"cvssV3_1": {
"attackComplexity": "LOW",
"attackVector": "LOCAL",
"availabilityImpact": "HIGH",
"baseScore": 6.7,
"baseSeverity": "MEDIUM",
"confidentialityImpact": "HIGH",
"integrityImpact": "HIGH",
"privilegesRequired": "HIGH",
"scope": "UNCHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"version": "3.1"
},
"format": "CVSS",
"scenarios": [
{
"lang": "en",
"value": "GENERAL"
}
]
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-269",
"description": "CWE-269 Improper Privilege Management",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"orgId": "e6d453f4-3dae-4941-bcea-9af25f4e824d",
"shortName": "Tigera",
"dateUpdated": "2024-04-29T22:19:06.908Z"
},
"references": [
{
"tags": [
"exploit",
"issue-tracking"
],
"url": "https://github.com/projectcalico/calico/issues/7981"
},
{
"tags": [
"patch"
],
"url": "https://github.com/projectcalico/calico/pull/8447"
},
{
"tags": [
"patch"
],
"url": "https://github.com/projectcalico/calico/pull/8517"
},
{
"tags": [
"vendor-advisory"
],
"url": "https://www.tigera.io/security-bulletins-tta-2024-001/"
}
],
"source": {
"discovery": "UNKNOWN"
},
"title": "Privilege escalation in Calico CNI install binary",
"x_generator": {
"engine": "Vulnogram 0.1.0-dev"
}
}
}
}
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/cve/TestToReport/CVE-2023-45141.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2023-45141.
-- CVE-2023-45141 --
id: GO-ID-PENDING
modules:
- module: github.com/gofiber/fiber
vulnerable_at: 1.14.6
- module: github.com/gofiber/fiber/v2
versions:
- fixed: 2.50.0
vulnerable_at: 2.49.2
summary: CSRF Token Validation Vulnerability in fiber in github.com/gofiber/fiber
cves:
- CVE-2023-45141
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2023-45141
- web: https://github.com/gofiber/fiber/security/advisories/GHSA-mv73-f69x-444p
source:
id: CVE-2023-45141
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/cve/TestToReport/CVE-2023-45283.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2023-45283.
-- CVE-2023-45283 --
id: GO-ID-PENDING
modules:
- module: std
versions:
- fixed: 1.20.11
- introduced: 1.21.0-0
- fixed: 1.21.4
packages:
- package: internal/safefilepath
goos:
- windows
symbols:
- fromFS
- FromFS
- module: std
versions:
- fixed: 1.20.11
- introduced: 1.21.0-0
- fixed: 1.21.4
packages:
- package: path/filepath
goos:
- windows
symbols:
- Clean
- volumeNameLen
- join
- Abs
- Base
- Dir
- EvalSymlinks
- Glob
- IsLocal
- Join
- Rel
- Split
- VolumeName
- Walk
- WalkDir
- module: std
versions:
- introduced: 1.20.11
- fixed: 1.20.12
- introduced: 1.21.4
- fixed: 1.21.5
packages:
- package: path/filepath
goos:
- windows
symbols:
- volumeNameLen
- Abs
- Base
- Clean
- Dir
- EvalSymlinks
- Glob
- IsLocal
- Join
- Rel
- Split
- VolumeName
- Walk
- WalkDir
summary: Insecure parsing of Windows paths with a \??\ prefix in path/filepath
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2023-45283
- fix: https://go.dev/cl/540277
- fix: https://go.dev/cl/541175
- report: https://go.dev/issue/63713
- report: https://go.dev/issue/64028
- web: http://www.openwall.com/lists/oss-security/2023/12/05/2
- web: https://groups.google.com/g/golang-announce/c/4tU8LZfBFkY
- web: https://groups.google.com/g/golang-dev/c/6ypN5EjibjM/m/KmLVYH_uAgAJ
- web: https://security.netapp.com/advisory/ntap-20231214-0008/
cve_metadata:
id: CVE-2023-45283
cwe: 'CWE-41: Improper Resolution of Path Equivalence'
notes:
- fix: 'module merge error: could not merge versions of module std: range events must be in strictly ascending order (found 1.20.11>=1.20.11)'
- fix: 'std: could not add vulnerable_at: not implemented for std/cmd'
- lint: 'description: missing (reports with Go CVEs must have a description)'
- lint: 'modules[0] "std": packages[0] "internal/safefilepath": at least one of vulnerable_at and skip_fix must be set'
- lint: 'modules[1] "std": packages[0] "path/filepath": at least one of vulnerable_at and skip_fix must be set'
- lint: 'modules[2] "std": packages[0] "path/filepath": at least one of vulnerable_at and skip_fix must be set'
- lint: 'references[0] "https://nvd.nist.gov/vuln/detail/CVE-2023-45283": "https://nvd.nist.gov/vuln/detail/CVE-2023-45283": advisory reference must not be set for first-party issues'
- lint: 'references[5] "http://www.openwall.com/lists/oss-security/2023/12/05/2": "http://www.openwall.com/lists/oss-security/2023/12/05/2": web reference must match regex "https://groups.google.com/g/golang-(announce|dev|nuts)/c/([^/]+)"'
- lint: 'references[8] "https://security.netapp.com/advisory/ntap-20231214-0008/": "https://security.netapp.com/advisory/ntap-20231214-0008/": web reference must match regex "https://groups.google.com/g/golang-(announce|dev|nuts)/c/([^/]+)"'
source:
id: CVE-2023-45283
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/cve/TestToReport/CVE-2023-45285.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2023-45285.
-- CVE-2023-45285 --
id: GO-ID-PENDING
modules:
- module: cmd
versions:
- fixed: 1.20.12
- introduced: 1.21.0-0
- fixed: 1.21.5
packages:
- package: cmd/go
summary: Command 'go get' may unexpectedly fallback to insecure git in cmd/go
credits:
- David Leadbeater
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2023-45285
- fix: https://go.dev/cl/540257
- report: https://go.dev/issue/63845
- web: https://groups.google.com/g/golang-dev/c/6ypN5EjibjM/m/KmLVYH_uAgAJ
- web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UIU6HOGV6RRIKWM57LOXQA75BGZSIH6G/
cve_metadata:
id: CVE-2023-45285
cwe: 'CWE-636: Not Failing Securely (''Failing Open'')'
notes:
- fix: 'cmd: could not add vulnerable_at: not implemented for std/cmd'
- lint: 'description: missing (reports with Go CVEs must have a description)'
- lint: 'modules[0] "cmd": packages[0] "cmd/go": at least one of vulnerable_at and skip_fix must be set'
- lint: 'references[0] "https://nvd.nist.gov/vuln/detail/CVE-2023-45285": "https://nvd.nist.gov/vuln/detail/CVE-2023-45285": advisory reference must not be set for first-party issues'
- lint: 'references[4] "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UIU6HOGV6RRIKWM57LOXQA75BGZSIH6G/": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UIU6HOGV6RRIKWM57LOXQA75BGZSIH6G/": web reference must match regex "https://groups.google.com/g/golang-(announce|dev|nuts)/c/([^/]+)"'
source:
id: CVE-2023-45285
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/cve/TestToReport/CVE-2023-29407.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2023-29407.
-- CVE-2023-29407 --
id: GO-ID-PENDING
modules:
- module: golang.org/x/image
versions:
- fixed: 0.10.0
vulnerable_at: 0.9.0
summary: |-
Excessive CPU consumption when decoding 0-height images in
golang.org/x/image/tiff
credits:
- Philippe Antoine (Catena cyber)
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2023-29407
- fix: https://go.dev/cl/514897
- report: https://go.dev/issue/61581
- web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KO54NBDUJXKAZNGCFOEYL2LKK2RQP6K6/
- web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XWH6Q7NVM4MV3GWFEU4PA67AWZHVFJQ2/
- web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XZTEP6JYILRBNDTNWTEQ5D4QUUVQBESK/
- web: https://security.netapp.com/advisory/ntap-20230831-0009/
cve_metadata:
id: CVE-2023-29407
cwe: 'CWE-834: Excessive Iteration'
notes:
- lint: 'description: missing (reports with Go CVEs must have a description)'
source:
id: CVE-2023-29407
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/cve/TestToReport/CVE-2024-3094.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2024-3094.
-- CVE-2024-3094 --
id: GO-ID-PENDING
modules:
- module: github.com/amlweems/xzbot
unsupported_versions:
- cve_version_range: 'affected at 5.6.0 (default: unaffected)'
- cve_version_range: 'affected at 5.6.1 (default: unaffected)'
vulnerable_at: 0.0.0-20240403045847-8ae5b706fb2c
summary: 'Xz: malicious code in distributed source in github.com/amlweems/xzbot'
cves:
- CVE-2024-3094
credits:
- Red Hat would like to thank Andres Freund for reporting this issue.
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2024-3094
- report: https://bugzilla.redhat.com/show_bug.cgi?id=2272210
- web: http://www.openwall.com/lists/oss-security/2024/03/29/10
- web: http://www.openwall.com/lists/oss-security/2024/03/29/12
- web: http://www.openwall.com/lists/oss-security/2024/03/29/4
- web: http://www.openwall.com/lists/oss-security/2024/03/29/5
- web: http://www.openwall.com/lists/oss-security/2024/03/29/8
- web: http://www.openwall.com/lists/oss-security/2024/03/30/12
- web: http://www.openwall.com/lists/oss-security/2024/03/30/27
- web: http://www.openwall.com/lists/oss-security/2024/03/30/36
- web: http://www.openwall.com/lists/oss-security/2024/03/30/5
- web: http://www.openwall.com/lists/oss-security/2024/04/16/5
- web: https://access.redhat.com/security/cve/CVE-2024-3094
- web: https://ariadne.space/2024/04/02/the-xz-utils-backdoor-is-a-symptom-of-a-larger-problem/
- web: https://arstechnica.com/security/2024/03/backdoor-found-in-widely-used-linux-utility-breaks-encrypted-ssh-connections/
- web: https://aws.amazon.com/security/security-bulletins/AWS-2024-002/
- web: https://blog.netbsd.org/tnf/entry/statement_on_backdoor_in_xz
- web: https://boehs.org/node/everything-i-know-about-the-xz-backdoor
- web: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1068024
- web: https://bugs.gentoo.org/928134
- web: https://bugzilla.suse.com/show_bug.cgi?id=1222124
- web: https://discourse.nixos.org/t/cve-2024-3094-malicious-code-in-xz-5-6-0-and-5-6-1-tarballs/42405
- web: https://gist.github.com/thesamesam/223949d5a074ebc3dce9ee78baad9e27
- web: https://github.com/advisories/GHSA-rxwq-x6h5-x525
- web: https://github.com/amlweems/xzbot
- web: https://github.com/karcherm/xz-malware
- web: https://gynvael.coldwind.pl/?lang=en&id=782
- web: https://lists.debian.org/debian-security-announce/2024/msg00057.html
- web: https://lists.freebsd.org/archives/freebsd-security/2024-March/000248.html
- web: https://lwn.net/Articles/967180/
- web: https://news.ycombinator.com/item?id=39865810
- web: https://news.ycombinator.com/item?id=39877267
- web: https://news.ycombinator.com/item?id=39895344
- web: https://openssf.org/blog/2024/03/30/xz-backdoor-cve-2024-3094/
- web: https://research.swtch.com/xz-script
- web: https://research.swtch.com/xz-timeline
- web: https://security-tracker.debian.org/tracker/CVE-2024-3094
- web: https://security.alpinelinux.org/vuln/CVE-2024-3094
- web: https://security.archlinux.org/CVE-2024-3094
- web: https://security.netapp.com/advisory/ntap-20240402-0001/
- web: https://tukaani.org/xz-backdoor/
- web: https://twitter.com/LetsDefendIO/status/1774804387417751958
- web: https://twitter.com/debian/status/1774219194638409898
- web: https://twitter.com/infosecb/status/1774595540233167206
- web: https://twitter.com/infosecb/status/1774597228864139400
- web: https://ubuntu.com/security/CVE-2024-3094
- web: https://www.cisa.gov/news-events/alerts/2024/03/29/reported-supply-chain-compromise-affecting-xz-utils-data-compression-library-cve-2024-3094
- web: https://www.darkreading.com/vulnerabilities-threats/are-you-affected-by-the-backdoor-in-xz-utils
- web: https://www.kali.org/blog/about-the-xz-backdoor/
- web: https://www.openwall.com/lists/oss-security/2024/03/29/4
- web: https://www.redhat.com/en/blog/urgent-security-alert-fedora-41-and-rawhide-users
- web: https://www.tenable.com/blog/frequently-asked-questions-cve-2024-3094-supply-chain-backdoor-in-xz-utils
- web: https://www.theregister.com/2024/03/29/malicious_backdoor_xz/
- web: https://www.vicarius.io/vsociety/vulnerabilities/cve-2024-3094
- web: https://xeiaso.net/notes/2024/xz-vuln/
source:
id: CVE-2024-3094
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/cve/TestToReport/CVE-2021-3115.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2021-3115.
-- CVE-2021-3115 --
id: GO-ID-PENDING
modules:
- module: cmd
packages:
- package: cmd/go
summary: CVE-2021-3115 in cmd
cves:
- CVE-2021-3115
references:
- advisory: https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YWAYJGXWC232SG3UR3TR574E6BP3OSQQ/
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2021-3115
- advisory: https://security.gentoo.org/glsa/202208-02
- web: https://blog.go.dev/path-security
- web: https://groups.google.com/g/golang-announce/c/mperVMGa98w
- web: https://security.netapp.com/advisory/ntap-20210219-0001/
notes:
- fix: 'cmd: could not add vulnerable_at: not implemented for std/cmd'
- lint: 'modules[0] "cmd": packages[0] "cmd/go": at least one of vulnerable_at and skip_fix must be set'
- lint: 'references: must contain at least one fix'
- lint: 'references: must contain at least one report'
- lint: 'references[0] "https://lists.fedoraproject.org/archives/list/package-announce%!l(MISSING)ists.fedoraproject.org/message/YWAYJGXWC232SG3UR3TR574E6BP3OSQQ/": "https://lists.fedoraproject.org/archives/list/package-announce%!l(MISSING)ists.fedoraproject.org/message/YWAYJGXWC232SG3UR3TR574E6BP3OSQQ/": advisory reference must not be set for first-party issues'
- lint: 'references[1] "https://nvd.nist.gov/vuln/detail/CVE-2021-3115": "https://nvd.nist.gov/vuln/detail/CVE-2021-3115": advisory reference must not be set for first-party issues'
- lint: 'references[2] "https://security.gentoo.org/glsa/202208-02": "https://security.gentoo.org/glsa/202208-02": advisory reference must not be set for first-party issues'
- lint: 'references[3] "https://blog.go.dev/path-security": "https://blog.go.dev/path-security": web reference must match regex "https://groups.google.com/g/golang-(announce|dev|nuts)/c/([^/]+)"'
- lint: 'references[5] "https://security.netapp.com/advisory/ntap-20210219-0001/": "https://security.netapp.com/advisory/ntap-20210219-0001/": web reference must match regex "https://groups.google.com/g/golang-(announce|dev|nuts)/c/([^/]+)"'
source:
id: CVE-2021-3115
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/cve/TestToReport/CVE-2023-45286.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2023-45286.
-- CVE-2023-45286 --
id: GO-ID-PENDING
modules:
- module: github.com/go-resty/resty
vulnerable_at: 1.12.0
- module: github.com/go-resty/resty/v2
versions:
- introduced: 2.10.0
- fixed: 2.11.0
vulnerable_at: 2.10.0
summary: HTTP request body disclosure in github.com/go-resty/resty/v2
credits:
- Logan Attwood (@lattwood)
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2023-45286
- fix: https://github.com/go-resty/resty/commit/577fed8730d79f583eb48dfc81674164e1fc471e
- fix: https://github.com/go-resty/resty/pull/745
- report: https://github.com/go-resty/resty/issues/739
- report: https://github.com/go-resty/resty/issues/743
cve_metadata:
id: CVE-2023-45286
cwe: 'CWE-200: Exposure of Sensitive Information to an Unauthorized Actor'
notes:
- lint: 'description: missing (reports with Go CVEs must have a description)'
source:
id: CVE-2023-45286
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/cve/TestToReport/CVE-2024-33522.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2024-33522.
-- CVE-2024-33522 --
id: GO-ID-PENDING
modules:
- module: github.com/projectcalico/calico
non_go_versions:
- fixed: 19.3.0
vulnerable_at: 2.6.12+incompatible
- module: github.com/projectcalico/calico
non_go_versions:
- fixed: 3.26.5
- introduced: 3.27.0
- fixed: 3.27.3
unsupported_versions:
- cve_version_range: 'unaffected at v3.28.0 (default: unaffected)'
vulnerable_at: 2.6.12+incompatible
- module: github.com/projectcalico/calico
versions:
- fixed: 3.17.4+incompatible
- introduced: 3.18.0+incompatible
- fixed: 3.18.2+incompatible
non_go_versions:
- introduced: 3.19.0-1.0
- fixed: 3.19.0-2.0
vulnerable_at: 3.18.2-networking-calico+incompatible
summary: Privilege escalation in Calico CNI install binary in github.com/projectcalico/calico
cves:
- CVE-2024-33522
credits:
- 'Christopher Alonso (Github: @latortuga71)'
- Anthony Tam
- Behnam Shobiri
- Pedro Coutinho
- Matt Dupre
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2024-33522
- advisory: https://www.tigera.io/security-bulletins-tta-2024-001/
- fix: https://github.com/projectcalico/calico/pull/8447
- fix: https://github.com/projectcalico/calico/pull/8517
- report: https://github.com/projectcalico/calico/issues/7981
notes:
- fix: 'module merge error: could not merge versions of module github.com/projectcalico/calico: introduced and fixed versions must alternate'
source:
id: CVE-2024-33522
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/cve/TestToReport/CVE-2024-2056.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2024-2056.
-- CVE-2024-2056 --
id: GO-ID-PENDING
modules:
- module: github.com/gvalkov/tailon
unsupported_versions:
- cve_version_range: 'affected at 4.50 (default: unaffected)'
vulnerable_at: 1.1.0
summary: Artica Proxy Loopback Services Remotely Accessible Unauthenticated in github.com/gvalkov/tailon
cves:
- CVE-2024-2056
credits:
- Jim Becher of KoreLogic, Inc.
- Jaggar Henry of KoreLogic, Inc.
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2024-2056
- web: http://seclists.org/fulldisclosure/2024/Mar/14
- web: https://github.com/gvalkov/tailon#security
- web: https://korelogic.com/Resources/Advisories/KL-001-2024-004.txt
source:
id: CVE-2024-2056
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/cve/TestToReport/CVE-2021-27919.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2021-27919.
-- CVE-2021-27919 --
id: GO-ID-PENDING
modules:
- module: std
packages:
- package: archive/zip
summary: CVE-2021-27919 in archive/zip
cves:
- CVE-2021-27919
references:
- advisory: https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2MU47VKTNXX33ZDLTI2ORRUY3KLJKU6G/
- advisory: https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HM7U5JNS5WU66Q3S26PFIU2ITB2ATTQ4/
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2021-27919
- advisory: https://security.gentoo.org/glsa/202208-02
- web: https://groups.google.com/g/golang-announce/c/MfiLYjG-RAw
notes:
- fix: 'std: could not add vulnerable_at: not implemented for std/cmd'
- lint: 'modules[0] "std": packages[0] "archive/zip": at least one of vulnerable_at and skip_fix must be set'
- lint: 'references: must contain at least one fix'
- lint: 'references: must contain at least one report'
- lint: 'references[0] "https://lists.fedoraproject.org/archives/list/package-announce%!l(MISSING)ists.fedoraproject.org/message/2MU47VKTNXX33ZDLTI2ORRUY3KLJKU6G/": "https://lists.fedoraproject.org/archives/list/package-announce%!l(MISSING)ists.fedoraproject.org/message/2MU47VKTNXX33ZDLTI2ORRUY3KLJKU6G/": advisory reference must not be set for first-party issues'
- lint: 'references[1] "https://lists.fedoraproject.org/archives/list/package-announce%!l(MISSING)ists.fedoraproject.org/message/HM7U5JNS5WU66Q3S26PFIU2ITB2ATTQ4/": "https://lists.fedoraproject.org/archives/list/package-announce%!l(MISSING)ists.fedoraproject.org/message/HM7U5JNS5WU66Q3S26PFIU2ITB2ATTQ4/": advisory reference must not be set for first-party issues'
- lint: 'references[2] "https://nvd.nist.gov/vuln/detail/CVE-2021-27919": "https://nvd.nist.gov/vuln/detail/CVE-2021-27919": advisory reference must not be set for first-party issues'
- lint: 'references[3] "https://security.gentoo.org/glsa/202208-02": "https://security.gentoo.org/glsa/202208-02": advisory reference must not be set for first-party issues'
source:
id: CVE-2021-27919
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/cve/TestToReport/CVE-2022-39213.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2022-39213.
-- CVE-2022-39213 --
id: GO-ID-PENDING
modules:
- module: github.com/pandatix/go-cvss
versions:
- introduced: 0.2.0
- fixed: 0.4.0
vulnerable_at: 0.3.0
summary: Out-of-bounds Read in go-cvss in github.com/pandatix/go-cvss
cves:
- CVE-2022-39213
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2022-39213
- fix: https://github.com/pandatix/go-cvss/commit/d9d478ff0c13b8b09ace030db9262f3c2fe031f4
- web: https://github.com/pandatix/go-cvss/blob/master/SECURITY.md
- web: https://github.com/pandatix/go-cvss/security/advisories/GHSA-xhmf-mmv2-4hhx
source:
id: CVE-2022-39213
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/cve/TestToReport/CVE-2020-9283.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2020-9283.
-- CVE-2020-9283 --
id: GO-ID-PENDING
modules:
- module: golang.org/x/crypto
vulnerable_at: 0.24.0
summary: CVE-2020-9283 in golang.org/x/crypto
cves:
- CVE-2020-9283
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2020-9283
- web: http://packetstormsecurity.com/files/156480/Go-SSH-0.0.2-Denial-Of-Service.html
- web: https://groups.google.com/forum/#!topic/golang-announce/3L45YRc91SY
- web: https://lists.debian.org/debian-lts-announce/2020/10/msg00014.html
- web: https://lists.debian.org/debian-lts-announce/2020/11/msg00027.html
- web: https://lists.debian.org/debian-lts-announce/2020/11/msg00031.html
- web: https://lists.debian.org/debian-lts-announce/2023/06/msg00017.html
source:
id: CVE-2020-9283
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
TestToReport
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/cve5/testdata/cve/TestToReport/CVE-2023-44378.txtar
|
Copyright 2024 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
Expected output of TestToReport/CVE-2023-44378.
-- CVE-2023-44378 --
id: GO-ID-PENDING
modules:
- module: github.com/consensys/gnark
versions:
- fixed: 0.9.0
vulnerable_at: 0.9.0-alpha
summary: |-
gnark vulnerable to unsoundness in variable comparison/non-unique binary
decomposition in github.com/consensys/gnark
cves:
- CVE-2023-44378
references:
- advisory: https://nvd.nist.gov/vuln/detail/CVE-2023-44378
- fix: https://github.com/Consensys/gnark/commit/59a4087261a6c73f13e80d695c17b398c3d0934f
- report: https://github.com/zkopru-network/zkopru/issues/116
- web: https://github.com/Consensys/gnark/security/advisories/GHSA-498w-5j49-vqjg
source:
id: CVE-2023-44378
created: 1999-01-01T00:00:00Z
review_status: UNREVIEWED
|
derrors
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/derrors/derrors.go
|
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package derrors defines internal error values to categorize the different
// types error semantics supported by x/vulndb.
package derrors
import (
"fmt"
"cloud.google.com/go/errorreporting"
)
// Wrap adds context to the error and allows
// unwrapping the result to recover the original error.
//
// Example:
//
// defer derrors.Wrap(&err, "copy(%s, %s)", dst, src)
func Wrap(errp *error, format string, args ...interface{}) {
if *errp != nil {
*errp = fmt.Errorf("%s: %w", fmt.Sprintf(format, args...), *errp)
}
}
// WrapAndReport calls Wrap followed by Report.
func WrapAndReport(errp *error, format string, args ...interface{}) {
Wrap(errp, format, args...)
if *errp != nil {
Report(*errp)
}
}
var repClient *errorreporting.Client
// SetReportingClient sets an errorreporting client, for use by Report.
func SetReportingClient(c *errorreporting.Client) {
repClient = c
}
// Report uses the errorreporting API to report an error.
func Report(err error) {
if repClient != nil {
repClient.Report(errorreporting.Entry{Error: err})
}
}
|
symbols
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/symbols/populate_test.go
|
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package symbols
import (
"context"
"fmt"
"testing"
"github.com/go-git/go-git/v5"
"github.com/google/go-cmp/cmp"
"golang.org/x/vulndb/internal/osv"
"golang.org/x/vulndb/internal/report"
)
func TestPopulate(t *testing.T) {
for _, tc := range []struct {
name string
update bool
input *report.Report
want *report.Report
}{
{
name: "basic",
update: true,
input: &report.Report{
Modules: []*report.Module{{
Module: "example.com/module",
}},
References: []*report.Reference{{
Type: osv.ReferenceTypeFix,
URL: "https://example.com/module/commit/1234",
}},
},
want: &report.Report{
Modules: []*report.Module{{
Module: "example.com/module",
Packages: []*report.Package{{
Package: "example.com/module/package",
Symbols: []string{"symbol1", "symbol2"},
}},
FixLinks: []string{"https://example.com/module/commit/1234"},
}},
References: []*report.Reference{
{
Type: osv.ReferenceTypeFix,
URL: "https://example.com/module/commit/1234",
},
},
},
},
{
name: "multiple_fixes",
update: false,
input: &report.Report{
Modules: []*report.Module{{
Module: "example.com/module",
}},
References: []*report.Reference{
{
Type: osv.ReferenceTypeFix,
URL: "https://example.com/module/commit/1234",
},
{
Type: osv.ReferenceTypeFix,
URL: "https://example.com/module/commit/5678",
},
},
},
want: &report.Report{
Modules: []*report.Module{{
Module: "example.com/module",
Packages: []*report.Package{{
Package: "example.com/module/package",
Symbols: []string{"symbol1", "symbol2", "symbol3"},
}},
}},
References: []*report.Reference{
{
Type: osv.ReferenceTypeFix,
URL: "https://example.com/module/commit/1234",
},
{
Type: osv.ReferenceTypeFix,
URL: "https://example.com/module/commit/5678",
},
},
},
}, {
name: "multiple_fixes_update",
update: true,
input: &report.Report{
Modules: []*report.Module{{
Module: "example.com/module",
}},
References: []*report.Reference{
{
Type: osv.ReferenceTypeFix,
URL: "https://example.com/module/commit/1234",
},
{
Type: osv.ReferenceTypeFix,
URL: "https://example.com/module/commit/5678",
},
},
},
want: &report.Report{
Modules: []*report.Module{{
Module: "example.com/module",
Packages: []*report.Package{{
Package: "example.com/module/package",
// We don't yet dedupe the symbols.
Symbols: []string{"symbol1", "symbol2", "symbol3"},
}},
// Both links are added because they both contain vulnerable symbols
FixLinks: []string{"https://example.com/module/commit/1234", "https://example.com/module/commit/5678"},
}},
References: []*report.Reference{
{
Type: osv.ReferenceTypeFix,
URL: "https://example.com/module/commit/1234",
},
{
Type: osv.ReferenceTypeFix,
URL: "https://example.com/module/commit/5678",
},
},
},
},
{
name: "has fix link",
update: false,
input: &report.Report{
Modules: []*report.Module{{
Module: "example.com/module",
FixLinks: []string{"https://example.com/module/commit/1234", "https://example.com/module/commit/5678"},
}},
},
want: &report.Report{
Modules: []*report.Module{{
Module: "example.com/module",
Packages: []*report.Package{{
Package: "example.com/module/package",
Symbols: []string{"symbol1", "symbol2", "symbol3"},
}},
FixLinks: []string{"https://example.com/module/commit/1234", "https://example.com/module/commit/5678"},
}},
},
},
} {
t.Run(tc.name, func(t *testing.T) {
if err := populate(tc.input, tc.update, mockClone, patchedFake); err != nil {
t.Fatal(err)
}
got := tc.input
if diff := cmp.Diff(tc.want, got); diff != "" {
t.Errorf("populate mismatch (-want, +got):\n%s", diff)
}
})
}
}
func patchedFake(module string, hash string, repo *repository) (map[string][]string, error) {
if module == "example.com/module" && repo.url == "https://example.com/module" && hash == "1234" {
return map[string][]string{
"example.com/module/package": {"symbol1", "symbol2"},
}, nil
}
if module == "example.com/module" && repo.url == "https://example.com/module" && hash == "5678" {
return map[string][]string{
"example.com/module/package": {"symbol1", "symbol2", "symbol3"},
}, nil
}
return nil, fmt.Errorf("unrecognized inputs: module=%s,repo=%s,hash=%s", module, repo.url, hash)
}
func mockClone(ctx context.Context, dir, repoURL string) (repo *git.Repository, err error) {
return nil, err
}
|
symbols
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/symbols/patched_functions.go
|
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package symbols
import (
"bytes"
"errors"
"fmt"
"go/ast"
"go/parser"
"go/printer"
"go/token"
"io/fs"
"os"
"path"
"path/filepath"
"reflect"
"strings"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/config"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
"golang.org/x/mod/modfile"
"golang.org/x/vulndb/internal/derrors"
)
// Patched returns symbols of module patched in commit identified
// by commitHash. r is the git repository containing the module.
//
// Patched returns a map from package import paths to symbols
// patched in the package. Test packages and symbols are omitted.
//
// If the commit has more than one parent, an error is returned.
func Patched(module, commitHash string, r *repository) (_ map[string][]string, err error) {
defer derrors.Wrap(&err, "Patched(%s, %s, %s)", module, r.url, commitHash)
repo := r.repo
w, err := repo.Worktree()
if err != nil {
return nil, err
}
defer resetWorktree(r.repo, w)
hash := plumbing.NewHash(commitHash)
commit, err := findCommit(repo, w, hash)
if err != nil {
return nil, err
}
if commit.NumParents() != 1 {
return nil, fmt.Errorf("more than 1 parent: %d", commit.NumParents())
}
parent, err := commit.Parent(0)
if err != nil {
return nil, err
}
if err := w.Checkout(&git.CheckoutOptions{Hash: hash, Force: true}); err != nil {
return nil, err
}
newSymbols, err := moduleSymbols(r.root, module)
if err != nil {
return nil, err
}
if err := w.Checkout(&git.CheckoutOptions{Hash: parent.Hash, Force: true}); err != nil {
return nil, err
}
oldSymbols, err := moduleSymbols(r.root, module)
if err != nil {
return nil, err
}
patched, err := patchedSymbols(oldSymbols, newSymbols)
if err != nil {
return nil, err
}
pkgSyms := make(map[string][]string)
for _, sym := range patched {
pkgSyms[sym.pkg] = append(pkgSyms[sym.pkg], sym.symbol)
}
return pkgSyms, nil
}
// resetWorktree takes a repository and its worktree and resets it to MAIN/MASTER@HEAD
func resetWorktree(r *git.Repository, w *git.Worktree) {
r.Fetch(&git.FetchOptions{})
w.Reset(&git.ResetOptions{
Mode: git.HardReset,
})
}
// findCommit attempts to find a commit with hash in repo's w work tree.
// If it cannot find the fix at the current branch, it tries to identify
// the commit at all remote branches. Once it finds a commit, it returns
// the commit object and keeps the work tree at the corresponding branch.
func findCommit(repo *git.Repository, w *git.Worktree, hash plumbing.Hash) (*object.Commit, error) {
commit, err := repo.CommitObject(hash)
if err == nil {
return commit, nil
}
err = repo.Fetch(&git.FetchOptions{
RefSpecs: []config.RefSpec{"refs/*:refs/*", "HEAD:refs/heads/HEAD"},
})
if err != nil {
return nil, fmt.Errorf("commit not on current branch, failed to fetch remote branches: %v", err)
}
remote, err := repo.Remote("origin")
if err != nil {
return nil, fmt.Errorf("commit not on current branch, failed to find remote origin: %v", err)
}
refList, err := remote.List(&git.ListOptions{})
if err != nil {
return nil, fmt.Errorf("commit not on current branch, failed to list remote branches: %v", err)
}
for _, ref := range refList {
err := w.Checkout(&git.CheckoutOptions{Branch: ref.Name(), Force: true})
if err != nil {
continue
}
commit, err := repo.CommitObject(hash)
if err == nil {
return commit, nil
}
}
return nil, fmt.Errorf("failed to find the commit %v on %d remote branches", hash, len(refList))
}
// patchedSymbols returns symbol indices in oldSymbols that either 1) cannot
// be identified in newSymbols or 2) the corresponding functions have their
// source code changed.
func patchedSymbols(oldSymbols, newSymbols map[symKey]*ast.FuncDecl) ([]symKey, error) {
var syms []symKey
for key, of := range oldSymbols {
nf, ok := newSymbols[key]
if !ok {
// We cannot locate the symbol in the new version
// of code, so we designate it as being patched.
syms = append(syms, key)
continue
}
osrc, err := source(of)
if err != nil {
return nil, err
}
nsrc, err := source(nf)
if err != nil {
return nil, err
}
if osrc != nsrc {
syms = append(syms, key)
}
}
return syms, nil
}
// source returns f's source code as text.
func source(f *ast.FuncDecl) (string, error) {
var b bytes.Buffer
fs := token.NewFileSet()
if err := printer.Fprint(&b, fs, f); err != nil {
return "", fmt.Errorf("getting source of %s failed: %w", astSymbolName(f), err)
}
return strings.TrimSpace(b.String()), nil
}
// moduleSymbols indexes all symbols of a module located
// within repo at repoRoot. Test symbols are omitted.
//
// If the module is not defined in the repo, an empty
// index is returned.
func moduleSymbols(repoRoot, module string) (map[symKey]*ast.FuncDecl, error) {
modRoot, files, err := moduleRootAndFiles(repoRoot, module)
if err != nil {
return nil, err
}
m := make(map[symKey]*ast.FuncDecl)
fset := token.NewFileSet()
for _, file := range files {
f, err := parser.ParseFile(fset, file, nil, 0)
if err != nil {
return nil, err
}
for _, decl := range f.Decls {
if fn, ok := decl.(*ast.FuncDecl); ok {
m[symKey{
pkg: packageImportPath(module, modRoot, file),
file: filepath.Base(file),
symbol: astSymbolName(fn)}] = fn
}
}
}
// Remove file info from indices that don't actually need it.
// This should make things more robust for cases when there
// the function name is unique and the patch moves the function
// to a different file (due to, say, refactoring).
return cleanFileInfo(m), nil
}
// cleanFileInfo deletes the value of file field in symKeys for
// function declarations that do not need the file information to
// differentiate between other same-named symbols in the same package.
func cleanFileInfo(syms map[symKey]*ast.FuncDecl) map[symKey]*ast.FuncDecl {
// collisions tracks which symbols have multiple
// function declarations in a package.
collisions := make(map[symKey]int)
for sk := range syms {
k := symKey{pkg: sk.pkg, symbol: sk.symbol}
collisions[k]++
}
m := make(map[symKey]*ast.FuncDecl)
for sk, f := range syms {
k := symKey{pkg: sk.pkg, symbol: sk.symbol}
if collisions[k] > 1 {
// multiple functions with the same name,
// so we keep the file info.
m[sk] = f
} else {
m[k] = f // get rid of file info
}
}
return m
}
// symKey is used as a unique key for
// a Go symbol in a repo.
type symKey struct {
pkg string
// file is the name of the file where the symbol
// is defined. Set when multiple same-named
// symbols are hidden under different build tags.
file string
symbol string
}
// moduleRootAndFiles returns the root of Go module within
// repo and all of its .go files. Test Go files (*_test.go)
// and Go files in "testdata" subdirectories are omitted.
//
// If there are no Go files or module does not exist in the
// repo, empty file slice is returned. Each returned file
// path has repoRoot as its prefix.
func moduleRootAndFiles(repoRoot, module string) (string, []string, error) {
modRoots, err := moduleRoots(repoRoot)
if err != nil {
return "", nil, err
}
moduleRoot, ok := modRoots[module]
if !ok {
return "", nil, nil
}
// directlyUnder checks if path belongs
// to module and not some of its sub-modules.
directlyUnder := func(path string) bool {
maxModPath := ""
for _, modPath := range modRoots {
if subdir(path, modPath) && len(modPath) > len(maxModPath) {
maxModPath = modPath
}
}
return maxModPath == moduleRoot
}
var files []string
err = filepath.Walk(moduleRoot, func(path string, fi fs.FileInfo, err error) error {
if err != nil {
return err
}
if fi.IsDir() {
if filepath.Base(path) == "testdata" {
// Skip test harness Go files.
return filepath.SkipDir
}
return nil
}
if filepath.Ext(path) != ".go" {
// We are only interested in Go files.
return nil
}
if !strings.HasSuffix(path, "_test.go") && directlyUnder(path) {
// Skip test Go files and files that belong to sub-modules.
files = append(files, path)
}
return nil
})
if err != nil {
return "", nil, err
}
return moduleRoot, files, err
}
// subdir checks if target is a sub-directory of base. It assumes
// that both target and base are either absolute paths or relative
// paths with the same offset.
func subdir(target, base string) bool {
p, err := filepath.Rel(base, target)
return err == nil && !strings.Contains(p, "..")
}
// moduleRoots returns paths in repoRoot that are roots
// of a Go module. Each such discovered path is indexed
// with the name of the corresponding module. Each returned
// path has repoRoot as prefix.
func moduleRoots(repoRoot string) (map[string]string, error) {
mods := make(map[string]string)
err := filepath.Walk(repoRoot, func(path string, fi fs.FileInfo, err error) error {
if err != nil {
return err
}
if !fi.IsDir() {
return nil
}
if filepath.Base(path) == "testdata" {
return filepath.SkipDir
}
if modName, err := moduleName(path); err != nil {
return err
} else if modName != "" {
mods[modName] = path
}
return nil
})
if err != nil {
return nil, err
}
return mods, nil
}
// moduleName returns the name of the module if path is
// the root of a Go module. Otherwise, returns empty string.
func moduleName(path string) (string, error) {
gomodPath := filepath.Join(path, "go.mod")
data, err := os.ReadFile(gomodPath)
if err != nil {
// go.mod does not exist, so this is not an error.
// It is just that the current path is not the root
// of a Go module.
if errors.Is(err, os.ErrNotExist) {
return "", nil
}
return "", err
}
gomod, err := modfile.ParseLax("go.mod", data, nil)
if err != nil {
return "", err
}
return gomod.Module.Mod.Path, nil
}
// packageImportPath computes the full package import path for a
// a package directory or file on local disk, given a module path
// and root of a module on local disk. For instance,
//
// packageImportPath("golang.org/module", "/module/root",
// "module/root/internal/foo/foo.go") =
// "golang.org/module/internal/foo"
//
// Returns empty string in case of any errors or if moduleRoot is
// not a sub-path of path.
//
// moduleRoot and path have to be either both absolute or both
// relative paths. The last element in path will always be interpreted
// as a file, hence directory paths should end with a file separator.
func packageImportPath(module, moduleRoot, pkgPath string) string {
if !subdir(pkgPath, moduleRoot) {
return ""
}
dir := filepath.Dir(pkgPath)
rel, err := filepath.Rel(moduleRoot, dir)
if err != nil {
return ""
}
if rel == "." {
// The path is moduleRoot
return module
}
rel = filepath.ToSlash(rel) // cross platform
return path.Join(module, rel)
}
// astSymbolName returns the name of f as a symbol in
// a vulnerability database.
func astSymbolName(f *ast.FuncDecl) string {
name := f.Name.Name
if f.Recv == nil || len(f.Recv.List) == 0 {
return name
}
field := f.Recv.List[0]
if len(field.Names) == 0 {
return "" // sanity
}
// unpackIdent assumes e is of the form id or id[...]
// and then returns id. Otherwise, returns "".
unpackIdent := func(e ast.Expr) string {
switch xv := e.(type) {
case *ast.Ident:
return xv.Name
case *ast.IndexExpr:
if si, ok := xv.X.(*ast.Ident); ok {
return si.Name
}
}
return ""
}
// supported receiver type names are id, *id, id[...], and *id[...].
t := ""
switch xv := field.Type.(type) {
case *ast.StarExpr:
t = unpackIdent(xv.X)
case *ast.Ident, *ast.IndexExpr:
t = unpackIdent(xv)
case *ast.IndexListExpr:
t = unpackIdent(xv.X)
default:
panic(fmt.Sprintf("astSymbolName: unexpected receiver type: %v\n", reflect.TypeOf(field.Type)))
}
return t + "." + name
}
|
symbols
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/symbols/slicing.go
|
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package symbols
// This file is a subset of golang.org/x/vuln/internal/vulncheck/slicing.go.
import (
"golang.org/x/tools/go/callgraph"
"golang.org/x/tools/go/ssa"
)
// forwardSlice computes the transitive closure of functions forward reachable
// via calls in cg or referred to in an instruction starting from `sources`.
func forwardSlice(sources map[*ssa.Function]bool, cg *callgraph.Graph) map[*ssa.Function]bool {
seen := make(map[*ssa.Function]bool)
var visit func(f *ssa.Function)
visit = func(f *ssa.Function) {
if seen[f] {
return
}
seen[f] = true
if n := cg.Nodes[f]; n != nil {
for _, e := range n.Out {
if e.Site != nil {
visit(e.Callee.Func)
}
}
}
var buf [10]*ssa.Value // avoid alloc in common case
for _, b := range f.Blocks {
for _, instr := range b.Instrs {
for _, op := range instr.Operands(buf[:0]) {
if fn, ok := (*op).(*ssa.Function); ok {
visit(fn)
}
}
}
}
}
for source := range sources {
visit(source)
}
return seen
}
// pruneSet removes functions in `set` that are in `toPrune`.
func pruneSet(set, toPrune map[*ssa.Function]bool) {
for f := range set {
if !toPrune[f] {
delete(set, f)
}
}
}
|
symbols
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/symbols/populate.go
|
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package symbols
import (
"context"
"errors"
"fmt"
"os"
"path/filepath"
"strings"
"github.com/go-git/go-git/v5"
"golang.org/x/exp/slices"
"golang.org/x/vulndb/internal/gitrepo"
"golang.org/x/vulndb/internal/report"
)
// repository represents a repository that may contain fixes for a given report.
type repository struct {
repo *git.Repository
url string
root string
fixHashes []string
}
// Populate attempts to populate the report with symbols derived
// from the patch link(s) in the report.
func Populate(r *report.Report, update bool) error {
return populate(r, update, gitrepo.PlainClone, Patched)
}
func populate(r *report.Report, update bool, clone func(context.Context, string, string) (*git.Repository, error), patched func(string, string, *repository) (map[string][]string, error)) error {
commits := r.CommitLinks()
reportFixRepos, errs := getFixRepos(commits, clone)
for _, mod := range r.Modules {
hasFixLinks := len(mod.FixLinks) > 0
fixRepos := reportFixRepos
if hasFixLinks {
frs, ers := getFixRepos(mod.FixLinks, clone)
if len(ers) != 0 {
errs = append(errs, ers...)
}
fixRepos = frs
} else if len(commits) == 0 {
errs = append(errs, fmt.Errorf("no commits found for %s", mod.Module))
continue
}
if len(fixRepos) == 0 {
errs = append(errs, fmt.Errorf("no working repos found for %s", mod.Module))
continue
}
foundSymbols := false
for _, repo := range fixRepos {
for _, hash := range repo.fixHashes {
found, err := populateFromFixHash(repo, hash, mod, patched)
if err != nil {
errs = append(errs, err)
}
if !hasFixLinks && update && found {
fixLink := fmt.Sprintf("%s/commit/%s", repo.url, hash)
mod.FixLinks = append(mod.FixLinks, fixLink)
}
foundSymbols = foundSymbols || found
}
root := repo.root
defer func() {
_ = os.RemoveAll(root)
}()
}
if !foundSymbols {
errs = append(errs, fmt.Errorf("no vulnerable symbols found for module %s", mod.Module))
}
// Sort fix links for testing/deterministic output
if !hasFixLinks && update {
slices.Sort(mod.FixLinks)
}
}
return errors.Join(errs...)
}
// populateFromFixHash takes a repository, fix hash and corresponding module and returns true
// if any symbols are found for the given fix/module pairs.
func populateFromFixHash(repo *repository, fixHash string, m *report.Module, patched func(string, string, *repository) (map[string][]string, error)) (foundSymbols bool, err error) {
pkgsToSymbols, err := patched(m.Module, fixHash, repo)
if err != nil {
return false, err
}
modPkgs := m.AllPackages()
for pkg, symbols := range pkgsToSymbols {
foundSymbols = true
if modPkg, exists := modPkgs[pkg]; exists {
// Ensure there are no duplicate symbols
for _, s := range symbols {
if !slices.Contains(modPkg.Symbols, s) {
modPkg.Symbols = append(modPkg.Symbols, s)
}
}
} else {
m.Packages = append(m.Packages, &report.Package{
Package: pkg,
Symbols: symbols,
})
}
}
return foundSymbols, nil
}
// getFixRepos takes a list of fix links and returns the repositories and hashes of those fix links.
func getFixRepos(links []string, clone func(context.Context, string, string) (*git.Repository, error)) (fixRepos map[string]*repository, errs []error) {
fixRepos = make(map[string]*repository)
for _, fixLink := range links {
fixHash := filepath.Base(fixLink)
repoURL := strings.TrimSuffix(fixLink, "/commit/"+fixHash)
if _, found := fixRepos[repoURL]; !found {
repoRoot, err := os.MkdirTemp("", fixHash)
if err != nil {
errs = append(errs, fmt.Errorf("error making temp dir for repo %s: %v", repoURL, err))
continue
}
ctx := context.Background()
r, err := clone(ctx, repoRoot, repoURL)
if err != nil {
errs = append(errs, fmt.Errorf("error cloning repo: %v", err.Error()))
continue
}
fixRepos[repoURL] = &repository{
repo: r,
url: repoURL,
root: repoRoot,
fixHashes: []string{fixHash},
}
} else {
r := fixRepos[repoURL]
r.fixHashes = append(r.fixHashes, fixHash)
}
}
return fixRepos, errs
}
|
symbols
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/symbols/exported_functions.go
|
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package symbols
import (
"bytes"
"errors"
"fmt"
"go/types"
"os"
"os/exec"
"sort"
"strings"
"golang.org/x/exp/slices"
"golang.org/x/tools/go/packages"
"golang.org/x/vulndb/internal/derrors"
"golang.org/x/vulndb/internal/osvutils"
"golang.org/x/vulndb/internal/report"
"golang.org/x/vulndb/internal/version"
)
// Exported returns a set of vulnerable symbols, in the vuln
// db format, exported by a package p from the module m.
func Exported(m *report.Module, p *report.Package) (_ []string, err error) {
defer derrors.Wrap(&err, "Exported(%q, %q)", m.Module, p.Package)
cleanup, err := changeToTempDir()
if err != nil {
return nil, err
}
defer cleanup()
run := func(name string, arg ...string) error {
cmd := exec.Command(name, arg...)
out, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("%s: %v\nout:\n%s", name, err, string(out))
}
return nil
}
// This procedure was developed through trial and error finding a way
// to load symbols for GO-2023-1549, which has a dependency tree that
// includes go.mod files that reference v0.0.0 versions which do not exist.
//
// Create an empty go.mod.
if err := run("go", "mod", "init", "go.dev/_"); err != nil {
return nil, err
}
if !m.IsFirstParty() {
if m.VulnerableAt == nil {
return nil, fmt.Errorf("vulnerable_at is not set")
}
// Require the module we're interested in at the vulnerable_at version.
if err := run("go", "mod", "edit", "-require", m.Module+"@v"+m.VulnerableAt.Version); err != nil {
return nil, err
}
for _, req := range m.VulnerableAtRequires {
if err := run("go", "mod", "edit", "-require", req); err != nil {
return nil, err
}
}
// TODO: This is the logical place to update the vulnerable module to locally
// use a different version of a module when necessary for .
// Example: data/reports/GO-2023-2399.yaml
// go mod edit -require github.com/hashicorp/vault@1.15.3
// which requires
// go get github.com/hashicorp/vault/sdk@v0.10.2
// to locally derive symbols.
// It may potentially make sense to extend yaml report format with
// these if this is a recurring problem.
// Create a package that imports the package we're interested in.
var content bytes.Buffer
fmt.Fprintf(&content, "package p\n")
fmt.Fprintf(&content, "import _ %q\n", p.Package)
for _, req := range m.VulnerableAtRequires {
pkg, _, _ := strings.Cut(req, "@")
fmt.Fprintf(&content, "import _ %q", pkg)
}
if err := os.WriteFile("p.go", content.Bytes(), 0666); err != nil {
return nil, err
}
}
// Run go mod tidy.
if err := run("go", "mod", "tidy"); err != nil {
return nil, err
}
pkg, err := loadPackage(&packages.Config{}, p.Package)
if err != nil {
return nil, err
}
// First package should match package path and module.
if pkg.PkgPath != p.Package {
return nil, fmt.Errorf("first package had import path %s, wanted %s", pkg.PkgPath, p.Package)
}
if m.IsFirstParty() {
if pm := pkg.Module; pm != nil {
return nil, fmt.Errorf("got module %v, expected nil", pm)
}
} else {
if pm := pkg.Module; pm == nil || pm.Path != m.Module {
return nil, fmt.Errorf("got module %v, expected %s", pm, m.Module)
}
}
if len(p.Symbols) == 0 {
return nil, nil // no symbols to derive from. skip.
}
// Check to see that all symbols actually exist in the package.
// This should perhaps be a lint check, but lint doesn't
// load/typecheck packages at the moment, so do it here for now.
if err := checkSymbols(pkg, p.Symbols); err != nil {
return nil, fmt.Errorf("invalid symbol(s):\n%w", err)
}
newsyms, err := exportedFunctions(pkg, m)
if err != nil {
return nil, err
}
var newslice []string
for s := range newsyms {
if s == "init" {
// Exclude init funcs from consideration.
//
// Assume that if init is calling a vulnerable symbol,
// it is doing so in a safe fashion (for example, the
// function might be vulnerable only when provided with
// untrusted input).
continue
}
if !slices.Contains(p.Symbols, s) {
newslice = append(newslice, s)
}
}
sort.Strings(newslice)
return newslice, nil
}
func checkSymbols(pkg *packages.Package, symbols []string) error {
var errs []error
for _, sym := range symbols {
if typ, method, ok := strings.Cut(sym, "."); ok {
n, ok := pkg.Types.Scope().Lookup(typ).(*types.TypeName)
if !ok {
errs = append(errs, fmt.Errorf("%v: type not found", typ))
continue
}
m, _, _ := types.LookupFieldOrMethod(n.Type(), true, pkg.Types, method)
if m == nil {
errs = append(errs, fmt.Errorf("%v: method not found", sym))
}
} else {
_, ok := pkg.Types.Scope().Lookup(typ).(*types.Func)
if !ok {
errs = append(errs, fmt.Errorf("%v: func not found", typ))
}
}
}
return errors.Join(errs...)
}
// exportedFunctions returns a set of vulnerable functions exported
// by a packages from the module.
func exportedFunctions(pkg *packages.Package, m *report.Module) (_ map[string]bool, err error) {
defer derrors.Wrap(&err, "exportedFunctions(%q)", pkg.PkgPath)
if pkg.Module != nil {
v := version.TrimPrefix(pkg.Module.Version)
rs, err := m.Versions.ToSemverRanges()
if err != nil {
return nil, err
}
affected, err := osvutils.AffectsSemver(rs, v)
if err != nil {
return nil, err
}
if !affected {
return nil, fmt.Errorf("version %s of module %s is not affected by this vuln", v, pkg.Module.Path)
}
}
entries, err := vulnEntries([]*packages.Package{pkg}, m)
if err != nil {
return nil, err
}
// Return the name of all entry points.
// Note that "main" and "init" are both possible entries.
// Both have clear meanings: "main" means that invoking
// the program is a problem, and "init" means that very likely
// some global state is altered, and so every exported function
// is vulnerable. For now, we leave it to consumers to use this
// information as they wish.
names := map[string]bool{}
for _, e := range entries {
if pkgPath(e) == pkg.PkgPath {
names[dbFuncName(e)] = true
}
}
return names, nil
}
|
symbols
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/symbols/entries.go
|
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package symbols
// This file is a subset of golang.org/x/vuln/internal/vulncheck/entries.go.
import (
"strings"
"golang.org/x/tools/go/ssa"
)
func entryPoints(topPackages []*ssa.Package) []*ssa.Function {
var entries []*ssa.Function
for _, pkg := range topPackages {
if pkg.Pkg.Name() == "main" {
// for "main" packages the only valid entry points are the "main"
// function and any "init#" functions, even if there are other
// exported functions or types. similarly to isEntry it should be
// safe to ignore the validity of the main or init# signatures,
// since the compiler will reject malformed definitions,
// and the init function is synthetic
entries = append(entries, memberFuncs(pkg.Members["main"], pkg.Prog)...)
for name, member := range pkg.Members {
if strings.HasPrefix(name, "init#") || name == "init" {
entries = append(entries, memberFuncs(member, pkg.Prog)...)
}
}
continue
}
for _, member := range pkg.Members {
for _, f := range memberFuncs(member, pkg.Prog) {
if isEntry(f) {
entries = append(entries, f)
}
}
}
}
return entries
}
func isEntry(f *ssa.Function) bool {
// it should be safe to ignore checking that the signature of the "init" function
// is valid, since it is synthetic
if f.Name() == "init" && f.Synthetic == "package initializer" {
return true
}
return f.Synthetic == "" && f.Object() != nil && f.Object().Exported()
}
|
symbols
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/symbols/vuln_entries.go
|
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package symbols
import (
"context"
"fmt"
"go/token"
"golang.org/x/tools/go/callgraph"
"golang.org/x/tools/go/packages"
"golang.org/x/tools/go/ssa"
"golang.org/x/vulndb/internal/report"
)
// vulnEntries returns entries of pkgs call graph that lead to
// vulnerable symbols in m.
//
// It assumes that the modules in m present in pkgs, if any,
// are at a version deemed vulnerable by m.
func vulnEntries(pkgs []*packages.Package, m *report.Module) ([]*ssa.Function, error) {
ctx := context.Background()
// The following code block is copied from
// golang.org/x/vuln/internal/vulncheck/source.go:Source.
var fset *token.FileSet
for _, p := range pkgs {
if fset == nil {
fset = p.Fset
} else {
if fset != p.Fset {
return nil, fmt.Errorf("[]*Package must have created with the same FileSet")
}
}
}
prog, ssaPkgs := buildSSA(pkgs, fset)
entries := entryPoints(ssaPkgs)
cg, err := callGraph(ctx, prog, entries)
if err != nil {
return nil, err
}
// Identify vulnerable functions/methods in the call graph and
// compute the backwards reachable entries.
entryNodes := vulnReachingEntries(vulnFuncs(cg, m), entries)
var vres []*ssa.Function
for _, n := range entryNodes {
vres = append(vres, n.Func)
}
return vres, nil
}
// vulnFuncs returns functions/methods of cg deemed vulnerable by m.
//
// It mimics golang.org/x/vuln/internal/vulncheck/source.go:vulnFuncs.
func vulnFuncs(cg *callgraph.Graph, m *report.Module) []*callgraph.Node {
// Create a set of vulnerable symbols easy to query.
type vulnSym struct {
pkg string
sym string
}
vulnSyms := make(map[vulnSym]bool)
for _, p := range m.Packages {
for _, s := range p.Symbols {
vulnSyms[vulnSym{p.Package, s}] = true
}
for _, s := range p.DerivedSymbols { // for sanity
vulnSyms[vulnSym{p.Package, s}] = true
}
}
var vfs []*callgraph.Node
for f, n := range cg.Nodes {
if vulnSyms[vulnSym{pkgPath(f), dbFuncName(f)}] {
vfs = append(vfs, n)
}
}
return vfs
}
// vulnReachingEntries returns call graph nodes corresponding to allEntries
// that are backwards reachable from sinks.
func vulnReachingEntries(sinks []*callgraph.Node, allEntries []*ssa.Function) []*callgraph.Node {
allEs := make(map[*ssa.Function]bool)
for _, e := range allEntries {
allEs[e] = true
}
var vres []*callgraph.Node
// The following code block mimics the body of
// golang.org/x/vuln/internal/vulncheck/source.go:callGraphSlice.
visited := make(map[*callgraph.Node]bool)
var visit func(*callgraph.Node)
visit = func(n *callgraph.Node) {
if visited[n] {
return
}
visited[n] = true
if allEs[n.Func] {
vres = append(vres, n)
}
for _, edge := range n.In {
visit(edge.Caller)
}
}
for _, s := range sinks {
visit(s)
}
return vres
}
|
symbols
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/symbols/utils.go
|
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package symbols
// This file is a subset of golang.org/x/vuln/internal/vulncheck/utils.go.
import (
"context"
"errors"
"fmt"
"go/build"
"go/token"
"go/types"
"os"
"strings"
"golang.org/x/tools/go/callgraph"
"golang.org/x/tools/go/callgraph/cha"
"golang.org/x/tools/go/callgraph/vta"
"golang.org/x/tools/go/packages"
"golang.org/x/tools/go/ssa/ssautil"
"golang.org/x/tools/go/types/typeutil"
"golang.org/x/vulndb/internal/derrors"
"golang.org/x/tools/go/ssa"
)
// loadPackage loads the package at the given import path, with enough
// information for constructing a call graph.
func loadPackage(cfg *packages.Config, importPath string) (_ *packages.Package, err error) {
defer derrors.Wrap(&err, "loadPackage(%s)", importPath)
cfg.Mode |= packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles |
packages.NeedImports | packages.NeedTypes | packages.NeedTypesSizes |
packages.NeedSyntax | packages.NeedTypesInfo | packages.NeedDeps |
packages.NeedModule
cfg.BuildFlags = []string{fmt.Sprintf("-tags=%s", strings.Join(build.Default.BuildTags, ","))}
pkgs, err := packages.Load(cfg, importPath)
if err != nil {
return nil, err
}
if err := packageLoadingError(pkgs); err != nil {
return nil, err
}
if len(pkgs) == 0 {
return nil, errors.New("no packages found")
}
if len(pkgs) > 1 {
return nil, fmt.Errorf("multiple (%d) packages found for import path %s", len(pkgs), importPath)
}
return pkgs[0], nil
}
// packageLoadingError returns an error summarizing packages.Package.Errors if there were any.
func packageLoadingError(pkgs []*packages.Package) error {
pkgError := func(pkg *packages.Package) error {
var msgs []string
for _, err := range pkg.Errors {
msgs = append(msgs, err.Error())
}
if len(msgs) == 0 {
return nil
}
// Report a more helpful error message for the package if possible.
for _, msg := range msgs {
// cgo failure?
if strings.Contains(msg, "could not import C (no metadata for C)") {
const url = `https://github.com/golang/vulndb/blob/master/doc/triage.md#vulnreport-cgo-failures`
return fmt.Errorf("package %s has a cgo error (install relevant C packages? %s)\nerrors:%s", pkg.PkgPath, url, strings.Join(msgs, "\n"))
}
}
return fmt.Errorf("package %s had %d errors: %s", pkg.PkgPath, len(msgs), strings.Join(msgs, "\n"))
}
var paths []string
var msgs []string
packages.Visit(pkgs, nil, func(pkg *packages.Package) {
if err := pkgError(pkg); err != nil {
paths = append(paths, pkg.PkgPath)
msgs = append(msgs, err.Error())
}
})
if len(msgs) == 0 {
return nil // no errors
}
return fmt.Errorf("packages with errors: %s\nerrors:\n%s", strings.Join(paths, " "), strings.Join(msgs, "\n"))
}
// buildSSA creates an ssa representation for pkgs. Returns
// the ssa program encapsulating the packages and top level
// ssa packages corresponding to pkgs.
func buildSSA(pkgs []*packages.Package, fset *token.FileSet) (*ssa.Program, []*ssa.Package) {
// TODO(https://go.dev/issue/57221): what about entry functions that are generics?
prog := ssa.NewProgram(fset, ssa.InstantiateGenerics)
imports := make(map[*packages.Package]*ssa.Package)
var createImports func(map[string]*packages.Package)
createImports = func(pkgs map[string]*packages.Package) {
for _, p := range pkgs {
if _, ok := imports[p]; !ok {
i := prog.CreatePackage(p.Types, p.Syntax, p.TypesInfo, true)
imports[p] = i
createImports(p.Imports)
}
}
}
for _, tp := range pkgs {
createImports(tp.Imports)
}
var ssaPkgs []*ssa.Package
for _, tp := range pkgs {
if sp, ok := imports[tp]; ok {
ssaPkgs = append(ssaPkgs, sp)
} else {
sp := prog.CreatePackage(tp.Types, tp.Syntax, tp.TypesInfo, false)
ssaPkgs = append(ssaPkgs, sp)
}
}
prog.Build()
return prog, ssaPkgs
}
// callGraph builds a call graph of prog based on VTA analysis.
func callGraph(ctx context.Context, prog *ssa.Program, entries []*ssa.Function) (*callgraph.Graph, error) {
entrySlice := make(map[*ssa.Function]bool)
for _, e := range entries {
entrySlice[e] = true
}
if err := ctx.Err(); err != nil { // cancelled?
return nil, err
}
initial := cha.CallGraph(prog)
allFuncs := ssautil.AllFunctions(prog)
fslice := forwardSlice(entrySlice, initial)
// Keep only actually linked functions.
pruneSet(fslice, allFuncs)
if err := ctx.Err(); err != nil { // cancelled?
return nil, err
}
vtaCg := vta.CallGraph(fslice, initial)
// Repeat the process once more, this time using
// the produced VTA call graph as the base graph.
fslice = forwardSlice(entrySlice, vtaCg)
pruneSet(fslice, allFuncs)
if err := ctx.Err(); err != nil { // cancelled?
return nil, err
}
cg := vta.CallGraph(fslice, vtaCg)
cg.DeleteSyntheticNodes()
return cg, nil
}
// dbTypeFormat formats the name of t according how types
// are encoded in vulnerability database:
// - pointer designation * is skipped
// - full path prefix is skipped as well
func dbTypeFormat(t types.Type) string {
switch tt := t.(type) {
case *types.Pointer:
return dbTypeFormat(tt.Elem())
case *types.Named:
return tt.Obj().Name()
default:
return types.TypeString(t, func(p *types.Package) string { return "" })
}
}
// dbFuncName computes a function name consistent with the namings used in vulnerability
// databases. Effectively, a qualified name of a function local to its enclosing package.
// If a receiver is a pointer, this information is not encoded in the resulting name. If
// a function has type argument/parameter, this information is omitted. The name of
// anonymous functions is simply "". The function names are unique subject to the enclosing
// package, but not globally.
//
// Examples:
//
// func (a A) foo (...) {...} -> A.foo
// func foo(...) {...} -> foo
// func (b *B) bar (...) {...} -> B.bar
// func (c C[T]) do(...) {...} -> C.do
func dbFuncName(f *ssa.Function) string {
selectBound := func(f *ssa.Function) types.Type {
// If f is a "bound" function introduced by ssa for a given type, return the type.
// When "f" is a "bound" function, it will have 1 free variable of that type within
// the function. This is subject to change when ssa changes.
if len(f.FreeVars) == 1 && strings.HasPrefix(f.Synthetic, "bound ") {
return f.FreeVars[0].Type()
}
return nil
}
selectThunk := func(f *ssa.Function) types.Type {
// If f is a "thunk" function introduced by ssa for a given type, return the type.
// When "f" is a "thunk" function, the first parameter will have that type within
// the function. This is subject to change when ssa changes.
params := f.Signature.Params() // params.Len() == 1 then params != nil.
if strings.HasPrefix(f.Synthetic, "thunk ") && params.Len() >= 1 {
if first := params.At(0); first != nil {
return first.Type()
}
}
return nil
}
var qprefix string
if recv := f.Signature.Recv(); recv != nil {
qprefix = dbTypeFormat(recv.Type())
} else if btype := selectBound(f); btype != nil {
qprefix = dbTypeFormat(btype)
} else if ttype := selectThunk(f); ttype != nil {
qprefix = dbTypeFormat(ttype)
}
if qprefix == "" {
return funcName(f)
}
return qprefix + "." + funcName(f)
}
// funcName returns the name of the ssa function f.
// It is f.Name() without additional type argument
// information in case of generics.
func funcName(f *ssa.Function) string {
n, _, _ := strings.Cut(f.Name(), "[")
return n
}
// memberFuncs returns functions associated with the `member`:
// 1) `member` itself if `member` is a function
// 2) `member` methods if `member` is a type
// 3) empty list otherwise
func memberFuncs(member ssa.Member, prog *ssa.Program) []*ssa.Function {
switch t := member.(type) {
case *ssa.Type:
methods := typeutil.IntuitiveMethodSet(t.Type(), &prog.MethodSets)
var funcs []*ssa.Function
for _, m := range methods {
if f := prog.MethodValue(m); f != nil {
funcs = append(funcs, f)
}
}
return funcs
case *ssa.Function:
return []*ssa.Function{t}
default:
return nil
}
}
// pkgPath returns the path of the f's enclosing package, if any.
// Otherwise, returns "".
//
// Copy of golang.org/x/vuln/internal/vulncheck/source.go:pkgPath.
func pkgPath(f *ssa.Function) string {
if f.Package() != nil && f.Package().Pkg != nil {
return f.Package().Pkg.Path()
}
return ""
}
func changeToTempDir() (cleanup func(), _ error) {
cwd, err := os.Getwd()
if err != nil {
return nil, err
}
dir, err := os.MkdirTemp("", "vulnreport")
if err != nil {
return nil, err
}
cleanup = func() {
_ = os.RemoveAll(dir)
_ = os.Chdir(cwd)
}
if err := os.Chdir(dir); err != nil {
cleanup()
return nil, err
}
return cleanup, err
}
|
symbols
|
/home/linuxreitt/Michinereitt/Tuning/Workshop_Scripts/hf-codegen/data/golang_public_repos/vulndb/internal/symbols/exported_functions_test.go
|
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package symbols
import (
"path"
"testing"
"github.com/google/go-cmp/cmp"
"golang.org/x/tools/go/packages/packagestest"
"golang.org/x/vulndb/internal/report"
)
func TestExportedFunctions(t *testing.T) {
e := packagestest.Export(t, packagestest.Modules, []packagestest.Module{
{
Name: "example.com/m",
Files: map[string]interface{}{
"p/a.go": `
package p
func vuln() {}
func ok() {}
`,
"p/b.go": `
package p
import "example.com/m/internal/v"
func Exp() { vuln() }
func Trans() { Exp() }
func Fine() { ok() }
type D struct {}
func (d D) Dep() {
vl := v.V{}
vl.Vuln()
}
`,
"internal/v/v.go": `
package v
type V struct {}
func (v V) Vuln() {}
`,
},
},
})
defer e.Cleanup()
m := &report.Module{
Module: "example.com/m",
Packages: []*report.Package{
{
Package: "example.com/m/p",
Symbols: []string{"vuln"},
},
{
Package: "example.com/m/internal/v",
Symbols: []string{"V.Vuln"},
},
},
}
pkg, err := loadPackage(e.Config, path.Join(e.Temp(), "m/p"))
if err != nil {
t.Fatal(err)
}
// Clear Module.Dir so vulncheck doesn't think that the module is local and ignore it.
// Set Module.Version so vulncheck doesn't filter it out.
pkg.Module.Dir = ""
pkg.Module.Version = "v1.0.0"
got, err := exportedFunctions(pkg, m)
if err != nil {
t.Fatal(err)
}
want := map[string]bool{"Exp": true, "Trans": true, "D.Dep": true}
if !cmp.Equal(got, want) {
t.Errorf("\ngot\n\t%v\nwant\n\t%v", got, want)
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.