Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump dependencies to fix reported CVEs #636

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Bump dependencies to fix reported CVEs #636

merged 1 commit into from
Jan 9, 2025

Conversation

SgtCoDFish
Copy link
Contributor

No evidence that these CVEs were actually exploitable in any way, I believe they're false positives.

The CVEs are:

Trivy output before this PR:

{
  "SchemaVersion": 2,
  "CreatedAt": "2025-01-09T12:23:03.224784Z",
  "ArtifactName": ".",
  "ArtifactType": "filesystem",
  "Metadata": {
    "ImageConfig": {
      "architecture": "",
      "created": "0001-01-01T00:00:00Z",
      "os": "",
      "rootfs": {
        "type": "",
        "diff_ids": null
      },
      "config": {}
    }
  },
  "Results": [
    {
      "Target": "go.mod",
      "Class": "lang-pkgs",
      "Type": "gomod",
      "Vulnerabilities": [
        {
          "VulnerabilityID": "CVE-2024-51744",
          "PkgID": "github.com/golang-jwt/jwt/[email protected]",
          "PkgName": "github.com/golang-jwt/jwt/v4",
          "PkgIdentifier": {
            "PURL": "pkg:golang/github.com/golang-jwt/jwt/[email protected]",
            "UID": "fcf0d6f346ee1743"
          },
          "InstalledVersion": "v4.5.0",
          "FixedVersion": "4.5.1",
          "Status": "fixed",
          "Layer": {},
          "SeveritySource": "ghsa",
          "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2024-51744",
          "DataSource": {
            "ID": "ghsa",
            "Name": "GitHub Security Advisory Go",
            "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Ago"
          },
          "Title": "golang-jwt: Bad documentation of error handling in ParseWithClaims can lead to potentially dangerous situations in golang-jwt",
          "Description": "golang-jwt is a Go implementation of JSON Web Tokens. Unclear documentation of the error behavior in `ParseWithClaims` can lead to situation where users are potentially not checking errors in the way they should be. Especially, if a token is both expired and invalid, the errors returned by `ParseWithClaims` return both error codes. If users only check for the `jwt.ErrTokenExpired ` using `error.Is`, they will ignore the embedded `jwt.ErrTokenSignatureInvalid` and thus potentially accept invalid tokens. A fix has been back-ported with the error handling logic from the `v5` branch to the `v4` branch. In this logic, the `ParseWithClaims` function will immediately return in \"dangerous\" situations (e.g., an invalid signature), limiting the combined errors only to situations where the signature is valid, but further validation failed (e.g., if the signature is valid, but is expired AND has the wrong audience). This fix is part of the 4.5.1 release. We are aware that this changes the behaviour of an established function and is not 100 % backwards compatible, so updating to 4.5.1 might break your code. In case you cannot update to 4.5.0, please make sure that you are properly checking for all errors (\"dangerous\" ones first), so that you are not running in the case detailed above.",
          "Severity": "LOW",
          "CweIDs": [
            "CWE-755"
          ],
          "VendorSeverity": {
            "ghsa": 1,
            "redhat": 1
          },
          "CVSS": {
            "ghsa": {
              "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N",
              "V3Score": 3.1
            },
            "redhat": {
              "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N",
              "V3Score": 3.1
            }
          },
          "References": [
            "https://access.redhat.com/security/cve/CVE-2024-51744",
            "https://github.com/golang-jwt/jwt",
            "https://github.com/golang-jwt/jwt/commit/7b1c1c00a171c6c79bbdb40e4ce7d197060c1c2c",
            "https://github.com/golang-jwt/jwt/security/advisories/GHSA-29wx-vh33-7x7r",
            "https://nvd.nist.gov/vuln/detail/CVE-2024-51744",
            "https://www.cve.org/CVERecord?id=CVE-2024-51744"
          ],
          "PublishedDate": "2024-11-04T22:15:03.997Z",
          "LastModifiedDate": "2024-11-05T16:04:26.053Z"
        },
        {
          "VulnerabilityID": "CVE-2024-45337",
          "PkgID": "golang.org/x/[email protected]",
          "PkgName": "golang.org/x/crypto",
          "PkgIdentifier": {
            "PURL": "pkg:golang/golang.org/x/[email protected]",
            "UID": "1e2401ae941babb7"
          },
          "InstalledVersion": "v0.24.0",
          "FixedVersion": "0.31.0",
          "Status": "fixed",
          "Layer": {},
          "SeveritySource": "ghsa",
          "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2024-45337",
          "DataSource": {
            "ID": "ghsa",
            "Name": "GitHub Security Advisory Go",
            "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Ago"
          },
          "Title": "golang.org/x/crypto/ssh: Misuse of ServerConfig.PublicKeyCallback may cause authorization bypass in golang.org/x/crypto",
          "Description": "Applications and libraries which misuse the ServerConfig.PublicKeyCallback callback may be susceptible to an authorization bypass. The documentation for ServerConfig.PublicKeyCallback says that \"A call to this function does not guarantee that the key offered is in fact used to authenticate.\" Specifically, the SSH protocol allows clients to inquire about whether a public key is acceptable before proving control of the corresponding private key. PublicKeyCallback may be called with multiple keys, and the order in which the keys were provided cannot be used to infer which key the client successfully authenticated with, if any. Some applications, which store the key(s) passed to PublicKeyCallback (or derived information) and make security relevant determinations based on it once the connection is established, may make incorrect assumptions. For example, an attacker may send public keys A and B, and then authenticate with A. PublicKeyCallback would be called only twice, first with A and then with B. A vulnerable application may then make authorization decisions based on key B for which the attacker does not actually control the private key. Since this API is widely misused, as a partial mitigation golang.org/x/[email protected] enforces the property that, when successfully authenticating via public key, the last key passed to ServerConfig.PublicKeyCallback will be the key used to authenticate the connection. PublicKeyCallback will now be called multiple times with the same key, if necessary. Note that the client may still not control the last key passed to PublicKeyCallback if the connection is then authenticated with a different method, such as PasswordCallback, KeyboardInteractiveCallback, or NoClientAuth. Users should be using the Extensions field of the Permissions return value from the various authentication callbacks to record data associated with the authentication attempt instead of referencing external state. Once the connection is established the state corresponding to the successful authentication attempt can be retrieved via the ServerConn.Permissions field. Note that some third-party libraries misuse the Permissions type by sharing it across authentication attempts; users of third-party libraries should refer to the relevant projects for guidance.",
          "Severity": "CRITICAL",
          "VendorSeverity": {
            "azure": 4,
            "cbl-mariner": 4,
            "ghsa": 4,
            "redhat": 3
          },
          "CVSS": {
            "ghsa": {
              "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N",
              "V3Score": 9.1
            },
            "redhat": {
              "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:N",
              "V3Score": 8.2
            }
          },
          "References": [
            "http://www.openwall.com/lists/oss-security/2024/12/11/2",
            "https://access.redhat.com/security/cve/CVE-2024-45337",
            "https://github.com/golang/crypto",
            "https://github.com/golang/crypto/commit/b4f1988a35dee11ec3e05d6bf3e90b695fbd8909",
            "https://go.dev/cl/635315",
            "https://go.dev/issue/70779",
            "https://groups.google.com/g/golang-announce/c/-nPEi39gI4Q/m/cGVPJCqdAQAJ",
            "https://nvd.nist.gov/vuln/detail/CVE-2024-45337",
            "https://pkg.go.dev/vuln/GO-2024-3321",
            "https://www.cve.org/CVERecord?id=CVE-2024-45337"
          ],
          "PublishedDate": "2024-12-12T02:02:07.97Z",
          "LastModifiedDate": "2024-12-12T21:15:08.5Z"
        },
        {
          "VulnerabilityID": "CVE-2024-45338",
          "PkgID": "golang.org/x/[email protected]",
          "PkgName": "golang.org/x/net",
          "PkgIdentifier": {
            "PURL": "pkg:golang/golang.org/x/[email protected]",
            "UID": "eef2f1c0560c161f"
          },
          "InstalledVersion": "v0.26.0",
          "FixedVersion": "0.33.0",
          "Status": "fixed",
          "Layer": {},
          "SeveritySource": "ghsa",
          "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2024-45338",
          "DataSource": {
            "ID": "ghsa",
            "Name": "GitHub Security Advisory Go",
            "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Ago"
          },
          "Title": "golang.org/x/net/html: Non-linear parsing of case-insensitive content in golang.org/x/net/html",
          "Description": "An attacker can craft an input to the Parse functions that would be processed non-linearly with respect to its length, resulting in extremely slow parsing. This could cause a denial of service.",
          "Severity": "HIGH",
          "CweIDs": [
            "CWE-1333"
          ],
          "VendorSeverity": {
            "ghsa": 3,
            "redhat": 3,
            "ubuntu": 2
          },
          "CVSS": {
            "redhat": {
              "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
              "V3Score": 7.5
            }
          },
          "References": [
            "https://access.redhat.com/security/cve/CVE-2024-45338",
            "https://cs.opensource.google/go/x/net",
            "https://github.com/golang/go/issues/70906",
            "https://go-review.googlesource.com/c/net/+/637536",
            "https://go.dev/cl/637536",
            "https://go.dev/issue/70906",
            "https://groups.google.com/g/golang-announce/c/wSCRmFnNmPA/m/Lvcd0mRMAwAJ",
            "https://nvd.nist.gov/vuln/detail/CVE-2024-45338",
            "https://pkg.go.dev/vuln/GO-2024-3333",
            "https://www.cve.org/CVERecord?id=CVE-2024-45338"
          ],
          "PublishedDate": "2024-12-18T21:15:08.173Z",
          "LastModifiedDate": "2024-12-31T20:16:06.603Z"
        }
      ]
    },
    {
      "Target": "make/_shared/oci-build/image_tool/go.mod",
      "Class": "lang-pkgs",
      "Type": "gomod"
    }
  ]
}

No evidence that these CVEs were actually exploitable in any way, I
believe they're false positives.

The CVEs are:

- CVE-2024-51744 (github.com/golang-jwt/jwt/v4)
- CVE-2024-45338 (x/net)
- CVE-2024-45337 (x/crypto)

Trivy output before this PR:

```json
{
  "SchemaVersion": 2,
  "CreatedAt": "2025-01-09T12:23:03.224784Z",
  "ArtifactName": ".",
  "ArtifactType": "filesystem",
  "Metadata": {
    "ImageConfig": {
      "architecture": "",
      "created": "0001-01-01T00:00:00Z",
      "os": "",
      "rootfs": {
        "type": "",
        "diff_ids": null
      },
      "config": {}
    }
  },
  "Results": [
    {
      "Target": "go.mod",
      "Class": "lang-pkgs",
      "Type": "gomod",
      "Vulnerabilities": [
        {
          "VulnerabilityID": "CVE-2024-51744",
          "PkgID": "github.com/golang-jwt/jwt/[email protected]",
          "PkgName": "github.com/golang-jwt/jwt/v4",
          "PkgIdentifier": {
            "PURL": "pkg:golang/github.com/golang-jwt/jwt/[email protected]",
            "UID": "fcf0d6f346ee1743"
          },
          "InstalledVersion": "v4.5.0",
          "FixedVersion": "4.5.1",
          "Status": "fixed",
          "Layer": {},
          "SeveritySource": "ghsa",
          "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2024-51744",
          "DataSource": {
            "ID": "ghsa",
            "Name": "GitHub Security Advisory Go",
            "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Ago"
          },
          "Title": "golang-jwt: Bad documentation of error handling in ParseWithClaims can lead to potentially dangerous situations in golang-jwt",
          "Description": "golang-jwt is a Go implementation of JSON Web Tokens. Unclear documentation of the error behavior in `ParseWithClaims` can lead to situation where users are potentially not checking errors in the way they should be. Especially, if a token is both expired and invalid, the errors returned by `ParseWithClaims` return both error codes. If users only check for the `jwt.ErrTokenExpired ` using `error.Is`, they will ignore the embedded `jwt.ErrTokenSignatureInvalid` and thus potentially accept invalid tokens. A fix has been back-ported with the error handling logic from the `v5` branch to the `v4` branch. In this logic, the `ParseWithClaims` function will immediately return in \"dangerous\" situations (e.g., an invalid signature), limiting the combined errors only to situations where the signature is valid, but further validation failed (e.g., if the signature is valid, but is expired AND has the wrong audience). This fix is part of the 4.5.1 release. We are aware that this changes the behaviour of an established function and is not 100 % backwards compatible, so updating to 4.5.1 might break your code. In case you cannot update to 4.5.0, please make sure that you are properly checking for all errors (\"dangerous\" ones first), so that you are not running in the case detailed above.",
          "Severity": "LOW",
          "CweIDs": [
            "CWE-755"
          ],
          "VendorSeverity": {
            "ghsa": 1,
            "redhat": 1
          },
          "CVSS": {
            "ghsa": {
              "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N",
              "V3Score": 3.1
            },
            "redhat": {
              "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N",
              "V3Score": 3.1
            }
          },
          "References": [
            "https://access.redhat.com/security/cve/CVE-2024-51744",
            "https://github.com/golang-jwt/jwt",
            "golang-jwt/jwt@7b1c1c0",
            "GHSA-29wx-vh33-7x7r",
            "https://nvd.nist.gov/vuln/detail/CVE-2024-51744",
            "https://www.cve.org/CVERecord?id=CVE-2024-51744"
          ],
          "PublishedDate": "2024-11-04T22:15:03.997Z",
          "LastModifiedDate": "2024-11-05T16:04:26.053Z"
        },
        {
          "VulnerabilityID": "CVE-2024-45337",
          "PkgID": "golang.org/x/[email protected]",
          "PkgName": "golang.org/x/crypto",
          "PkgIdentifier": {
            "PURL": "pkg:golang/golang.org/x/[email protected]",
            "UID": "1e2401ae941babb7"
          },
          "InstalledVersion": "v0.24.0",
          "FixedVersion": "0.31.0",
          "Status": "fixed",
          "Layer": {},
          "SeveritySource": "ghsa",
          "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2024-45337",
          "DataSource": {
            "ID": "ghsa",
            "Name": "GitHub Security Advisory Go",
            "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Ago"
          },
          "Title": "golang.org/x/crypto/ssh: Misuse of ServerConfig.PublicKeyCallback may cause authorization bypass in golang.org/x/crypto",
          "Description": "Applications and libraries which misuse the ServerConfig.PublicKeyCallback callback may be susceptible to an authorization bypass. The documentation for ServerConfig.PublicKeyCallback says that \"A call to this function does not guarantee that the key offered is in fact used to authenticate.\" Specifically, the SSH protocol allows clients to inquire about whether a public key is acceptable before proving control of the corresponding private key. PublicKeyCallback may be called with multiple keys, and the order in which the keys were provided cannot be used to infer which key the client successfully authenticated with, if any. Some applications, which store the key(s) passed to PublicKeyCallback (or derived information) and make security relevant determinations based on it once the connection is established, may make incorrect assumptions. For example, an attacker may send public keys A and B, and then authenticate with A. PublicKeyCallback would be called only twice, first with A and then with B. A vulnerable application may then make authorization decisions based on key B for which the attacker does not actually control the private key. Since this API is widely misused, as a partial mitigation golang.org/x/[email protected] enforces the property that, when successfully authenticating via public key, the last key passed to ServerConfig.PublicKeyCallback will be the key used to authenticate the connection. PublicKeyCallback will now be called multiple times with the same key, if necessary. Note that the client may still not control the last key passed to PublicKeyCallback if the connection is then authenticated with a different method, such as PasswordCallback, KeyboardInteractiveCallback, or NoClientAuth. Users should be using the Extensions field of the Permissions return value from the various authentication callbacks to record data associated with the authentication attempt instead of referencing external state. Once the connection is established the state corresponding to the successful authentication attempt can be retrieved via the ServerConn.Permissions field. Note that some third-party libraries misuse the Permissions type by sharing it across authentication attempts; users of third-party libraries should refer to the relevant projects for guidance.",
          "Severity": "CRITICAL",
          "VendorSeverity": {
            "azure": 4,
            "cbl-mariner": 4,
            "ghsa": 4,
            "redhat": 3
          },
          "CVSS": {
            "ghsa": {
              "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N",
              "V3Score": 9.1
            },
            "redhat": {
              "V3Vector": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:N",
              "V3Score": 8.2
            }
          },
          "References": [
            "http://www.openwall.com/lists/oss-security/2024/12/11/2",
            "https://access.redhat.com/security/cve/CVE-2024-45337",
            "https://github.com/golang/crypto",
            "golang/crypto@b4f1988",
            "https://go.dev/cl/635315",
            "https://go.dev/issue/70779",
            "https://groups.google.com/g/golang-announce/c/-nPEi39gI4Q/m/cGVPJCqdAQAJ",
            "https://nvd.nist.gov/vuln/detail/CVE-2024-45337",
            "https://pkg.go.dev/vuln/GO-2024-3321",
            "https://www.cve.org/CVERecord?id=CVE-2024-45337"
          ],
          "PublishedDate": "2024-12-12T02:02:07.97Z",
          "LastModifiedDate": "2024-12-12T21:15:08.5Z"
        },
        {
          "VulnerabilityID": "CVE-2024-45338",
          "PkgID": "golang.org/x/[email protected]",
          "PkgName": "golang.org/x/net",
          "PkgIdentifier": {
            "PURL": "pkg:golang/golang.org/x/[email protected]",
            "UID": "eef2f1c0560c161f"
          },
          "InstalledVersion": "v0.26.0",
          "FixedVersion": "0.33.0",
          "Status": "fixed",
          "Layer": {},
          "SeveritySource": "ghsa",
          "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2024-45338",
          "DataSource": {
            "ID": "ghsa",
            "Name": "GitHub Security Advisory Go",
            "URL": "https://github.com/advisories?query=type%3Areviewed+ecosystem%3Ago"
          },
          "Title": "golang.org/x/net/html: Non-linear parsing of case-insensitive content in golang.org/x/net/html",
          "Description": "An attacker can craft an input to the Parse functions that would be processed non-linearly with respect to its length, resulting in extremely slow parsing. This could cause a denial of service.",
          "Severity": "HIGH",
          "CweIDs": [
            "CWE-1333"
          ],
          "VendorSeverity": {
            "ghsa": 3,
            "redhat": 3,
            "ubuntu": 2
          },
          "CVSS": {
            "redhat": {
              "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
              "V3Score": 7.5
            }
          },
          "References": [
            "https://access.redhat.com/security/cve/CVE-2024-45338",
            "https://cs.opensource.google/go/x/net",
            "golang/go#70906",
            "https://go-review.googlesource.com/c/net/+/637536",
            "https://go.dev/cl/637536",
            "https://go.dev/issue/70906",
            "https://groups.google.com/g/golang-announce/c/wSCRmFnNmPA/m/Lvcd0mRMAwAJ",
            "https://nvd.nist.gov/vuln/detail/CVE-2024-45338",
            "https://pkg.go.dev/vuln/GO-2024-3333",
            "https://www.cve.org/CVERecord?id=CVE-2024-45338"
          ],
          "PublishedDate": "2024-12-18T21:15:08.173Z",
          "LastModifiedDate": "2024-12-31T20:16:06.603Z"
        }
      ]
    },
    {
      "Target": "make/_shared/oci-build/image_tool/go.mod",
      "Class": "lang-pkgs",
      "Type": "gomod"
    }
  ]
}
```

Signed-off-by: Ashley Davis <[email protected]>
@SgtCoDFish SgtCoDFish merged commit 8e4d5ed into master Jan 9, 2025
2 checks passed
@SgtCoDFish SgtCoDFish deleted the bumpcrypto branch January 9, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants