Skip to content

Commit bbf0d71

Browse files
committed
internal/report: attempt to auto-fix summaries
If there is no module path in a summary, simply add it to the end, i.e., "<summary> in <module>". This could result in non-grammatical phrases so it's meant as a convenience for a human to fix up. As a last resort, if there is no summary at all, add the summary '<[alias] | "Vulnerability"> in <module_path>' as a starting point. Change-Id: I64810c7c77980654d7973dc605b256e6053c0254 Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/576998 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com>
1 parent 44a7c1a commit bbf0d71

30 files changed

+61
-57
lines changed

internal/genericosv/testdata/yaml/GHSA-28r2-q6m8-9hpx.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ modules:
1919
vulnerable_at: 2.0.2
2020
summary: |-
2121
HashiCorp go-getter unsafe downloads could lead to asymmetric resource
22-
exhaustion
22+
exhaustion in github.com/hashicorp/go-getter
2323
description: |-
2424
HashiCorp go-getter through 2.0.2 does not safely perform downloads. Asymmetric
2525
resource exhaustion could occur when go-getter processed malicious HTTP
@@ -39,4 +39,4 @@ references:
3939
- web: https://discuss.hashicorp.com/t/hcsec-2022-13-multiple-vulnerabilities-in-go-getter-library/39930
4040
- web: https://github.com/hashicorp/go-getter/releases
4141
notes:
42-
- lint: 'summary: must contain an affected module or package path (e.g. "github.com/hashicorp/go-getter")'
42+
- lint: 'summary: too long (found 115 characters, want <=100)'

internal/genericosv/testdata/yaml/GHSA-3hwm-922r-47hw.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ modules:
33
- module: atomys.codes/stud42
44
versions:
55
- fixed: 0.23.0
6-
summary: Stud42 vulnerable to denial of service
6+
summary: Stud42 vulnerable to denial of service in atomys.codes/stud42
77
description: |-
88
A security vulnerability has been identified in the GraphQL parser used by the
99
API of s42.app. An attacker can overload the parser and cause the API pod to
@@ -22,4 +22,3 @@ references:
2222
- web: https://github.com/42Atomys/stud42/commit/a70bfc72fba721917bf681d72a58093fb9deee17
2323
notes:
2424
- lint: 'modules[0] "atomys.codes/stud42": version 0.23.0 does not exist'
25-
- lint: 'summary: must contain an affected module or package path (e.g. "atomys.codes/stud42")'

internal/genericosv/testdata/yaml/GHSA-3wq5-3f56-v5xc.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ modules:
1212
versions:
1313
- introduced: 6.3.0
1414
fixed: 7.1.6
15-
summary: Mattermost vulnerable to information disclosure
15+
summary: Mattermost vulnerable to information disclosure in github.com/mattermost/mattermost-server
1616
description: |-
1717
Mattermost allows an attacker to request a preview of an existing message when
1818
creating a new message via the createPost API call, disclosing the contents of
@@ -27,4 +27,3 @@ references:
2727
notes:
2828
- lint: 'modules[0] "github.com/mattermost/mattermost-server": 6 versions do not exist: 7.1.0, 7.1.6, 7.7.0, 7.7.2, 7.8.0, 7.8.1'
2929
- lint: 'modules[1] "github.com/mattermost/mattermost-server/v6": version 7.1.6 does not exist'
30-
- lint: 'summary: must contain an affected module or package path (e.g. "github.com/mattermost/mattermost-server")'

internal/genericosv/testdata/yaml/GHSA-54q4-74p3-mgcw.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ modules:
66
unsupported_versions:
77
- version: 4.0.2
88
type: last_affected
9-
summary: rttys SQL Injection vulnerability
9+
summary: rttys SQL Injection vulnerability in github.com/zhaojh329/rttys
1010
description: |-
1111
SQL Injection vulnerability in rttys versions 4.0.0, 4.0.1, and 4.0.2 in api.go,
1212
allows attackers to execute arbitrary code.
@@ -21,4 +21,3 @@ notes:
2121
- lint: 'modules[0] "github.com/zhaojh329/rttys": unsupported_versions: found 1 (want none)'
2222
- lint: 'modules[0] "github.com/zhaojh329/rttys": version 4.0.0 does not exist'
2323
- lint: 'summary: must begin with a capital letter'
24-
- lint: 'summary: must contain an affected module or package path (e.g. "github.com/zhaojh329/rttys")'

internal/genericosv/testdata/yaml/GHSA-5m6c-jp6f-2vcv.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ modules:
44
versions:
55
- introduced: 5.1.1
66
fixed: 6.0.0
7-
summary: Open Redirect in OAuth2 Proxy
7+
summary: Open Redirect in OAuth2 Proxy in github.com/oauth2-proxy/oauth2-proxy
88
description: |-
99
### Impact As users can provide a redirect address for the proxy to send the
1010
authenticated user to at the end of the authentication flow. This is expected to
@@ -22,4 +22,3 @@ references:
2222
notes:
2323
- lint: 'description: possible markdown formatting (found ### )'
2424
- lint: 'modules[0] "github.com/oauth2-proxy/oauth2-proxy": 2 versions do not exist: 5.1.1, 6.0.0'
25-
- lint: 'summary: must contain an affected module or package path (e.g. "github.com/oauth2-proxy/oauth2-proxy")'

internal/genericosv/testdata/yaml/GHSA-627p-rr78-99rj.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ modules:
1414
fixed: 6.4.1
1515
summary: |-
1616
GitLab auth uses full name instead of username as user ID, allowing
17-
impersonation
17+
impersonation in github.com/concourse/concourse
1818
description: |-
1919
### Impact
2020
@@ -70,4 +70,4 @@ notes:
7070
- lint: 'description: possible markdown formatting (found `users`)'
7171
- lint: 'modules[0] "github.com/concourse/concourse": 4 versions do not exist: 6.3.0, 6.3.1, 6.4.0, 6.4.1'
7272
- lint: 'modules[1] "github.com/concourse/dex": 4 versions do not exist: 6.3.0, 6.3.1, 6.4.0, 6.4.1'
73-
- lint: 'summary: must contain an affected module or package path (e.g. "github.com/concourse/concourse")'
73+
- lint: 'summary: too long (found 115 characters, want <=100)'

internal/genericosv/testdata/yaml/GHSA-66p8-j459-rq63.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ modules:
88
vulnerable_at: 1.11.3
99
summary: |-
1010
Pterodactyl Wings contains UNIX Symbolic Link (Symlink) Following resulting in
11-
deletion of files and directories on the host system
11+
deletion of files and directories on the host system in github.com/pterodactyl/wings
1212
description: |-
1313
### Impact
1414
@@ -45,5 +45,4 @@ notes:
4545
- lint: 'description: possible markdown formatting (found ### )'
4646
- lint: 'description: possible markdown formatting (found [`GHSA-p8r3-83r8-jwj5`](https://github.com/pterodactyl/wings/security/advisories/GHSA-p8r3-83r8-jwj5))'
4747
- lint: 'description: possible markdown formatting (found `GHSA-p8r3-83r8-jwj5`)'
48-
- lint: 'summary: must contain an affected module or package path (e.g. "github.com/pterodactyl/wings")'
49-
- lint: 'summary: too long (found 131 characters, want <=100)'
48+
- lint: 'summary: too long (found 163 characters, want <=100)'

internal/genericosv/testdata/yaml/GHSA-69v6-xc2j-r2jf.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ modules:
1010
- fixed: 1.19.7
1111
packages:
1212
- package: github.com/ethereum/go-ethereum/core/vm
13-
summary: Shallow copy bug in geth
13+
summary: Shallow copy bug in geth in github.com/ethereum/go-ethereum
1414
description: |-
1515
### Impact This is a Consensus vulnerability, which can be used to cause a
1616
chain-split where vulnerable nodes reject the canonical chain.
@@ -44,4 +44,3 @@ notes:
4444
- lint: 'description: possible markdown formatting (found `dataCopy` (at `0x00...04`)'
4545
- lint: 'modules[1] "github.com/ethereum/go-ethereum": packages[0] "github.com/ethereum/go-ethereum/core/vm": at least one of vulnerable_at and skip_fix must be set'
4646
- lint: 'modules[1] "github.com/ethereum/go-ethereum": version 1.19.7 does not exist'
47-
- lint: 'summary: must contain an affected module or package path (e.g. "github.com/ethereum/go-ethereum")'

internal/genericosv/testdata/yaml/GHSA-6qfg-8799-r575.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ modules:
1616
vulnerable_at: 1.16.0-rc.2
1717
packages:
1818
- package: k8s.io/kubernetes/pkg/kubectl/cmd/cp
19-
summary: Symlink Attack
19+
summary: Symlink Attack in github.com/kubernetes/kubernetes
2020
description: |-
2121
The Kubernetes kubectl cp command in versions 1.1-1.12, and versions prior to
2222
1.13.11, 1.14.7, and 1.15.4 allows a combination of two symlinks provided by tar
@@ -33,5 +33,3 @@ references:
3333
- report: https://github.com/kubernetes/kubernetes/issues/87773
3434
- fix: https://github.com/kubernetes/kubernetes/pull/82143
3535
- web: https://groups.google.com/d/msg/kubernetes-announce/YYtEFdFimZ4/nZnOezZuBgAJ
36-
notes:
37-
- lint: 'summary: must contain an affected module or package path (e.g. "github.com/kubernetes/kubernetes")'

internal/genericosv/testdata/yaml/GHSA-6rg3-8h8x-5xfv.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ modules:
77
vulnerable_at: 1.2.0
88
summary: |-
99
Unchecked hostname resolution could allow access to local network resources by
10-
users outside the local network
10+
users outside the local network in github.com/pterodactyl/wings
1111
description: |-
1212
### Impact A newly implemented route allowing users to download files from
1313
remote endpoints was not properly verifying the destination hostname for user
@@ -29,5 +29,4 @@ references:
2929
- advisory: https://github.com/pterodactyl/wings/security/advisories/GHSA-6rg3-8h8x-5xfv
3030
notes:
3131
- lint: 'description: possible markdown formatting (found ### )'
32-
- lint: 'summary: must contain an affected module or package path (e.g. "github.com/pterodactyl/wings")'
33-
- lint: 'summary: too long (found 110 characters, want <=100)'
32+
- lint: 'summary: too long (found 142 characters, want <=100)'

0 commit comments

Comments
 (0)