From 539543ce36f78d1ce05bf4cabb39d160efcce100 Mon Sep 17 00:00:00 2001 From: Tatiana Bradley Date: Thu, 12 Dec 2024 11:04:03 -0500 Subject: [PATCH] data/reports: update GO-2024-3321 Add GHSA and extend description to include additional context from the announcement. - data/reports/GO-2024-3321.yaml Updates golang/vulndb#3321 Fixes golang/vulndb#3328 Change-Id: I14ce706997a2468c27ab3a1c3c8087a14158ffcb Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/635695 LUCI-TryBot-Result: Go LUCI Auto-Submit: Tatiana Bradley Reviewed-by: Zvonimir Pavlinovic --- data/cve/v5/GO-2024-3321.json | 6 ++--- data/osv/GO-2024-3321.json | 13 +++++----- data/reports/GO-2024-3321.yaml | 45 +++++++++++++++++++++++++++++++--- 3 files changed, 52 insertions(+), 12 deletions(-) diff --git a/data/cve/v5/GO-2024-3321.json b/data/cve/v5/GO-2024-3321.json index 1ca67bfb..c72ac727 100644 --- a/data/cve/v5/GO-2024-3321.json +++ b/data/cve/v5/GO-2024-3321.json @@ -13,7 +13,7 @@ "descriptions": [ { "lang": "en", - "value": "Applications and libraries which misuse the ServerConfig.PublicKeyCallback callback may be susceptible to an authorization bypass." + "value": "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/cry...@v0.31.0 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." } ], "affected": [ @@ -50,13 +50,13 @@ ], "references": [ { - "url": "https://go.dev/issue/70779" + "url": "https://github.com/golang/crypto/commit/b4f1988a35dee11ec3e05d6bf3e90b695fbd8909" }, { "url": "https://go.dev/cl/635315" }, { - "url": "https://github.com/golang/crypto/commit/b4f1988a35dee11ec3e05d6bf3e90b695fbd8909" + "url": "https://go.dev/issue/70779" }, { "url": "https://groups.google.com/g/golang-announce/c/-nPEi39gI4Q/m/cGVPJCqdAQAJ" diff --git a/data/osv/GO-2024-3321.json b/data/osv/GO-2024-3321.json index dcda735a..c573dadb 100644 --- a/data/osv/GO-2024-3321.json +++ b/data/osv/GO-2024-3321.json @@ -4,10 +4,11 @@ "modified": "0001-01-01T00:00:00Z", "published": "0001-01-01T00:00:00Z", "aliases": [ - "CVE-2024-45337" + "CVE-2024-45337", + "GHSA-v778-237x-gjrc" ], "summary": "Misuse of ServerConfig.PublicKeyCallback may cause authorization bypass in golang.org/x/crypto", - "details": "Applications and libraries which misuse the ServerConfig.PublicKeyCallback callback may be susceptible to an authorization bypass.", + "details": "Applications and libraries which misuse the ServerConfig.PublicKeyCallback callback may be susceptible to an authorization bypass.\n\nThe 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.\n\nFor 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.\n\nSince this API is widely misused, as a partial mitigation golang.org/x/cry...@v0.31.0 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.\n\nUsers 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.", "affected": [ { "package": { @@ -41,16 +42,16 @@ ], "references": [ { - "type": "REPORT", - "url": "https://go.dev/issue/70779" + "type": "FIX", + "url": "https://github.com/golang/crypto/commit/b4f1988a35dee11ec3e05d6bf3e90b695fbd8909" }, { "type": "FIX", "url": "https://go.dev/cl/635315" }, { - "type": "FIX", - "url": "https://github.com/golang/crypto/commit/b4f1988a35dee11ec3e05d6bf3e90b695fbd8909" + "type": "REPORT", + "url": "https://go.dev/issue/70779" }, { "type": "WEB", diff --git a/data/reports/GO-2024-3321.yaml b/data/reports/GO-2024-3321.yaml index 277516f9..70e6f584 100644 --- a/data/reports/GO-2024-3321.yaml +++ b/data/reports/GO-2024-3321.yaml @@ -8,19 +8,58 @@ modules: - package: golang.org/x/crypto/ssh symbols: - ServerConfig.PublicKeyCallback -summary: Misuse of ServerConfig.PublicKeyCallback may cause authorization bypass in golang.org/x/crypto +summary: |- + 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/cry...@v0.31.0 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. +ghsas: + - GHSA-v778-237x-gjrc credits: - Damien Tournoud (Platform.sh / Upsun) - Patrick Dawkins (Platform.sh / Upsun) - Vince Parker (Platform.sh / Upsun) - Jules Duvivier (Platform.sh / Upsun) references: - - report: https://go.dev/issue/70779 - - fix: https://go.dev/cl/635315 - fix: https://github.com/golang/crypto/commit/b4f1988a35dee11ec3e05d6bf3e90b695fbd8909 + - fix: https://go.dev/cl/635315 + - report: https://go.dev/issue/70779 - web: https://groups.google.com/g/golang-announce/c/-nPEi39gI4Q/m/cGVPJCqdAQAJ cve_metadata: id: CVE-2024-45337