PT-2024-9626 · Google+7 · Golang.Org/X/Crypto+7
Damien Tournoud
+3
·
Published
2023-07-12
·
Updated
2026-05-30
·
CVE-2024-45337
CVSS v2.0
9.4
Critical
| Vector | AV:N/AC:L/Au:N/C:C/I:C/A:N |
Name of the Vulnerable Software and Affected Versions
golang.org/x/crypto versions prior to 0.31.0
Description
The issue is related to the misuse of the
ServerConfig.PublicKeyCallback callback in applications and libraries, which may lead to an authorization bypass. 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.Recommendations
To resolve the issue, update golang.org/x/crypto to version 0.31.0 or later. As a temporary workaround, consider 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.
Exploit
Fix
Improper Authorization
Found an issue in the description? Have something to add? Feel free to write us 👾
Related Identifiers
Affected Products
Alt Linux
Astra Linux
Debian
Linuxmint
Red Os
Suse
Ubuntu
Golang.Org/X/Crypto