Skip to content

Commit

Permalink
data/reports: update GO-2024-3321
Browse files Browse the repository at this point in the history
Add GHSA and extend description to include additional
context from the announcement.

  - data/reports/GO-2024-3321.yaml

Updates #3321
Fixes #3328

Change-Id: I14ce706997a2468c27ab3a1c3c8087a14158ffcb
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/635695
LUCI-TryBot-Result: Go LUCI <[email protected]>
Auto-Submit: Tatiana Bradley <[email protected]>
Reviewed-by: Zvonimir Pavlinovic <[email protected]>
  • Loading branch information
tatianab authored and gopherbot committed Dec 12, 2024
1 parent f61706e commit 539543c
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 12 deletions.
6 changes: 3 additions & 3 deletions data/cve/v5/GO-2024-3321.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/[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."
}
],
"affected": [
Expand Down Expand Up @@ -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"
Expand Down
13 changes: 7 additions & 6 deletions data/osv/GO-2024-3321.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/[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.\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": {
Expand Down Expand Up @@ -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",
Expand Down
45 changes: 42 additions & 3 deletions data/reports/GO-2024-3321.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[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.
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
Expand Down

0 comments on commit 539543c

Please sign in to comment.