-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/report: add basic logic to convert cve5 to report
Add function to convert CVE JSON 5.0 to our internal YAML format. As a starting point, this function does the same thing as the old function that converts from CVE JSON 4 to our format. A temporary test checks that this is the case. For golang/go#49289 Change-Id: Ie5226537cefaeb9e68b98e5dce9c6b97b29f968a Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/547556 Reviewed-by: Damien Neil <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
- Loading branch information
Showing
7 changed files
with
227 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
internal/report/testdata/cve/TestCVE5ToReport/CVE-2020-9283.txtar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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. | ||
|
||
Expected output of TestCVE5ToReport/CVE-2020-9283. | ||
|
||
-- CVE-2020-9283 -- | ||
id: PLACEHOLDER-ID | ||
modules: | ||
- module: golang.org/x/crypto | ||
packages: | ||
- package: n/a | ||
description: | | ||
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. | ||
references: | ||
- web: https://groups.google.com/forum/#!topic/golang-announce/3L45YRc91SY | ||
- web: http://packetstormsecurity.com/files/156480/Go-SSH-0.0.2-Denial-Of-Service.html | ||
- 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 | ||
cve_metadata: | ||
id: CVE-2020-9283 | ||
cwe: TODO |
20 changes: 20 additions & 0 deletions
20
internal/report/testdata/cve/TestCVE5ToReport/CVE-2022-39213.txtar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
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. | ||
|
||
Expected output of TestCVE5ToReport/CVE-2022-39213. | ||
|
||
-- CVE-2022-39213 -- | ||
id: PLACEHOLDER-ID | ||
modules: | ||
- module: github.com/pandatix/go-cvss | ||
packages: | ||
- package: go-cvss | ||
description: | | ||
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. | ||
cves: | ||
- CVE-2022-39213 | ||
references: | ||
- advisory: https://github.com/pandatix/go-cvss/security/advisories/GHSA-xhmf-mmv2-4hhx | ||
- fix: https://github.com/pandatix/go-cvss/commit/d9d478ff0c13b8b09ace030db9262f3c2fe031f4 | ||
- web: https://github.com/pandatix/go-cvss/blob/master/SECURITY.md |
20 changes: 20 additions & 0 deletions
20
internal/report/testdata/cve/TestCVE5ToReport/CVE-2023-44378.txtar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
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. | ||
|
||
Expected output of TestCVE5ToReport/CVE-2023-44378. | ||
|
||
-- CVE-2023-44378 -- | ||
id: PLACEHOLDER-ID | ||
modules: | ||
- module: github.com/Consensys/gnark | ||
packages: | ||
- package: gnark | ||
description: | | ||
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. | ||
cves: | ||
- CVE-2023-44378 | ||
references: | ||
- advisory: https://github.com/Consensys/gnark/security/advisories/GHSA-498w-5j49-vqjg | ||
- report: https://github.com/zkopru-network/zkopru/issues/116 | ||
- fix: https://github.com/Consensys/gnark/commit/59a4087261a6c73f13e80d695c17b398c3d0934f |
18 changes: 18 additions & 0 deletions
18
internal/report/testdata/cve/TestCVE5ToReport/CVE-2023-45141.txtar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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. | ||
|
||
Expected output of TestCVE5ToReport/CVE-2023-45141. | ||
|
||
-- CVE-2023-45141 -- | ||
id: PLACEHOLDER-ID | ||
modules: | ||
- module: github.com/gofiber/fiber | ||
packages: | ||
- package: fiber | ||
description: | | ||
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. | ||
cves: | ||
- CVE-2023-45141 | ||
references: | ||
- advisory: https://github.com/gofiber/fiber/security/advisories/GHSA-mv73-f69x-444p |