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

VectorAV: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 👾

Weakness Enumeration

Related Identifiers

ALSA-2023_4030
ALSA-2023_6972
ALSA-2024_1130
ALSA-2024_1150
ALSA-2024_1444
ALSA-2024_1962
ALSA-2024_1963
ALSA-2024_2079
ALSA-2024_2548
ALSA-2024_2549
ALSA-2024_2550
ALSA-2024_2562
ALSA-2024_2699
ALSA-2024_2724
ALSA-2024_4246
ALSA-2025_16880
ALSA-2025_3344
ALSA-2025_3833
ALSA-2025_4669
ALSA-2025_7389
ALSA-2025_7397
ALSA-2025_7404
ALSA-2025_7425
ALSA-2025_7967
ALT-PU-2025-13603
ALT-PU-2025-7474
ALT-PU-2025-7475
ALT-PU-2025-8447
AZL-54281
AZL-54286
AZL-54290
AZL-54315
AZL-54317
AZL-54320
AZL-54327
AZL-54330
AZL-54333
AZL-54345
AZL-54353
AZL-54357
AZL-54363
AZL-54372
AZL-54381
AZL-54384
BDU:2024-11338
CVE-2024-45337
ECHO-AB71-0C1D-545E
GHSA-7PRJ-HGX4-2XC3
GHSA-V778-237X-GJRC
GO-2024-3321
GO-2024-3330
OESA-2025-2257
OESA-2025-2258
OESA-2025-2259
OESA-2025-2297
OPENSUSE-SU-2024:14573-1
OPENSUSE-SU-2024:14585-1
OPENSUSE-SU-2024:14590-1
OPENSUSE-SU-2024:14592-1
OPENSUSE-SU-2024:14593-1
OPENSUSE-SU-2024:14595-1
OPENSUSE-SU-2024:14599-1
OPENSUSE-SU-2024:14602-1
OPENSUSE-SU-2024:14604-1
OPENSUSE-SU-2025:0025-1
OPENSUSE-SU-2025:0056-1
OPENSUSE-SU-2025:0094-1
OPENSUSE-SU-2025:14613-1
OPENSUSE-SU-2025:14633-1
OPENSUSE-SU-2025:14641-1
OPENSUSE-SU-2025:14660-1
OPENSUSE-SU-2025:14713-1
OPENSUSE-SU-2025:14902-1
OPENSUSE-SU-2025:14909-1
OPENSUSE-SU-2025:14920-1
OPENSUSE-SU-2025:14969-1
OPENSUSE-SU-2025:15013-1
OPENSUSE-SU-2025:15463-1
OPENSUSE-SU-2025:15779-1
OPENSUSE-SU-2025:20117-1
OPENSUSE-SU-2025:20143-1
OPENSUSE-SU-2025_0525-1
OPENSUSE-SU-2025_0545-1
OPENSUSE-SU-2025_0601-1
OPENSUSE-SU-2025_0602-1
OPENSUSE-SU-2025_0770-1
OPENSUSE-SU-2025_0980-1
OPENSUSE-SU-2025_1143-1
OPENSUSE-SU-2026:10230-1
OPENSUSE-SU-2026:20609-1
OPENSUSE-SU-2026:20620-1
OPENSUSE-SU-2026:20730-1
OPENSUSE-SU-2026:20798-1
OPENSUSE-SU-2026:20893-1
SUSE-SU-2025:01985-1
SUSE-SU-2025:02581-1
SUSE-SU-2025:03278-1
SUSE-SU-2025:0524-1
SUSE-SU-2025:0525-1
SUSE-SU-2025:0545-1
SUSE-SU-2025:0601-1
SUSE-SU-2025:0602-1
SUSE-SU-2025:0770-1
SUSE-SU-2025:0980-1
SUSE-SU-2025:1142-1
SUSE-SU-2025:1143-1
SUSE-SU-2025:20196-1
SUSE-SU-2025:20278-1
SUSE-SU-2025_02581-1
SUSE-SU-2025_03278-1
SUSE-SU-2025_0525-1
SUSE-SU-2025_0601-1
SUSE-SU-2025_0602-1
SUSE-SU-2025_0980-1
SUSE-SU-2025_1142-1
SUSE-SU-2025_1143-1
SUSE-SU-2026:0592-1
SUSE-SU-2026:21319-1
SUSE-SU-2026:21376-1
USN-7839-1
USN-7839-2

Affected Products

Alt Linux
Astra Linux
Debian
Linuxmint
Red Os
Suse
Ubuntu
Golang.Org/X/Crypto