Damien Tournoud

#15939of 53,632
16.9Total CVSS
Vulnerabilities · 2
High
1
Critical
1
PT-2024-9626
9.4
2023-07-12
Google · Golang.Org/X/Crypto · CVE-2024-45337
**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.