Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2024-45337

CRITICAL 9.1EPSS 91%

Misuse of connection.serverAuthenticate may cause authorization bypass in golang.org/x/crypto

Also known as GHSA-v778-237x-gjrc, GO-2024-3321

Mitigation

  • Upgrade golang.org/x/crypto to 0.31.0 or later.

Who should check

  • Projects that depend on Go package golang.org/x/crypto (< 0.31.0)
  • Anyone running golang.org/x/crypto/ssh < 0.31.0

Vulnerability facts

Affected
golang.org/x/crypto < 0.31.0
Fixed in
0.31.0
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, no login needed
CVSS
9.1 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: Low
  • Privileges required: None
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: None
EPSS
3.92% chance of exploitation in 30 days (percentile 91, 2026-11-26)
CWE
CWE-285
Published
Modified

Description

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/cry...@v0.31.0 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 and fixed versions

Package / productAffectedFixedSource
Go golang.org/x/crypto< 0.31.00.31.0osv
golang.org/x/crypto/ssh< 0.31.0—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2024-45337. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-45337.md
Affected: golang.org/x/crypto < 0.31.0
Fixed in: 0.31.0

Steps:
1. Search this machine and project for golang.org/x/crypto (Go), golang.org/x/crypto/ssh: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2024-45337 being exploited?

There is no confirmed exploitation: CVE-2024-45337 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 3.92% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2024-45337?

Critical: CVSS 9.1 (v3.1, scored by CNA). Remote, no login needed.

Which versions are affected by CVE-2024-45337?

golang.org/x/crypto < 0.31.0.

Is there a fix for CVE-2024-45337?

Yes. Fixed in 0.31.0. Upgrade golang.org/x/crypto to 0.31.0 or later.

How do I check if I'm affected by CVE-2024-45337?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors