Skip to content

Commit dbe3f0c

Browse files
thatnealpatelgopherbot
authored andcommitted
data/reports: review GO-2024-3321
- data/reports/GO-2024-3321.yaml Fixes #3321 Change-Id: Iea14830a48de66fda12d50f86eebcdd40d830a45 Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/648215 Reviewed-by: Zvonimir Pavlinovic <[email protected]> Reviewed-by: Tatiana Bradley <[email protected]> Auto-Submit: Neal Patel <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 28c269f commit dbe3f0c

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

data/cve/v5/GO-2024-3321.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"providerMetadata": {
1010
"orgId": "1bb62c36-49e3-4200-9d77-64a1400537cc"
1111
},
12-
"title": "Misuse of ServerConfig.PublicKeyCallback may cause authorization bypass in golang.org/x/crypto",
12+
"title": "Misuse of connection.serverAuthenticate may cause authorization bypass in golang.org/x/crypto",
1313
"descriptions": [
1414
{
1515
"lang": "en",
16-
"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."
16+
"value": "Applications and libraries which misuse connection.serverAuthenticate (via callback field ServerConfig.PublicKeyCallback) 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."
1717
}
1818
],
1919
"affected": [
@@ -33,6 +33,12 @@
3333
"programRoutines": [
3434
{
3535
"name": "ServerConfig.PublicKeyCallback"
36+
},
37+
{
38+
"name": "connection.serverAuthenticate"
39+
},
40+
{
41+
"name": "NewServerConn"
3642
}
3743
],
3844
"defaultStatus": "unaffected"

data/osv/GO-2024-3321.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"CVE-2024-45337",
88
"GHSA-v778-237x-gjrc"
99
],
10-
"summary": "Misuse of ServerConfig.PublicKeyCallback may cause authorization bypass in golang.org/x/crypto",
11-
"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.",
10+
"summary": "Misuse of connection.serverAuthenticate may cause authorization bypass in golang.org/x/crypto",
11+
"details": "Applications and libraries which misuse connection.serverAuthenticate (via callback field ServerConfig.PublicKeyCallback) 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.",
1212
"affected": [
1313
{
1414
"package": {
@@ -33,7 +33,9 @@
3333
{
3434
"path": "golang.org/x/crypto/ssh",
3535
"symbols": [
36-
"ServerConfig.PublicKeyCallback"
36+
"NewServerConn",
37+
"ServerConfig.PublicKeyCallback",
38+
"connection.serverAuthenticate"
3739
]
3840
}
3941
]

data/reports/GO-2024-3321.yaml

+7-5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ modules:
88
- package: golang.org/x/crypto/ssh
99
symbols:
1010
- ServerConfig.PublicKeyCallback
11-
summary: |-
12-
Misuse of ServerConfig.PublicKeyCallback may cause authorization bypass in
13-
golang.org/x/crypto
11+
- connection.serverAuthenticate
12+
derived_symbols:
13+
- NewServerConn
14+
summary: Misuse of connection.serverAuthenticate may cause authorization bypass in golang.org/x/crypto
1415
description: |-
15-
Applications and libraries which misuse the ServerConfig.PublicKeyCallback
16-
callback may be susceptible to an authorization bypass.
16+
Applications and libraries which misuse connection.serverAuthenticate (via
17+
callback field ServerConfig.PublicKeyCallback) may be susceptible to an
18+
authorization bypass.
1719
1820
The documentation for ServerConfig.PublicKeyCallback says that "A call to this
1921
function does not guarantee that the key offered is in fact used to

0 commit comments

Comments
 (0)