---
title: "CVE-2024-45337: Misuse of ServerConfig.PublicKeyCallback may cause authorization bypass in golang.org/x/crypto"
url: https://erroneo.us/security/cve/CVE-2024-45337/
description: "CVE-2024-45337 (golang.org/x/crypto (Go)): Applications and libraries which misuse connection.serverAuthenticate (via callback field…"
type: vulnerability-record
section: "Security Digest"
date_published: 2024-12-11
date_modified: 2025-02-18
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2024-45337"
kev: false
cvss: 9.1
epss: 0.03181
license: All rights reserved. Quote with attribution and a link.
---

# CVE-2024-45337: Misuse of ServerConfig.PublicKeyCallback may cause authorization bypass in golang.org/x/crypto

**Signal:** Critical and remotely reachable. No known exploitation yet, but it is network-reachable without credentials. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

- No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
- EPSS 3.2% , percentile 88: FIRST’s model estimates a 3.2% chance of exploitation activity in the next 30 days, higher than 88% of all scored CVEs (elevated). EPSS is a probability, not a verdict.
- Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
- Only applies if your dependency tree includes golang.org/x/crypto (Go) < 0.31.0, fixed in 0.31.0 . Check your lockfile, including transitive dependencies.

## What it is

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 packages

- Go `golang.org/x/crypto` < 0.31.0 → fixed: 0.31.0

## Affected products (CVE record)

- golang.org/x/crypto golang.org/x/crypto/ssh: < 0.31.0

## Severity

- CISA-ADP CVSS 3.1: 9.1 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`
- GitHub CVSS 3.1: 9.1 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`

## Exploitation

- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation none , automatable yes , technical impact total .
- FIRST EPSS (model of 2026-10-21): 3.18% probability of exploitation activity in the next 30 days; percentile 88.

## Sources

- [GitHub Advisory GHSA-v778-237x-gjrc](https://github.com/advisories/GHSA-v778-237x-gjrc)
- [CVE.org record CVE-2024-45337](https://www.cve.org/CVERecord?id=CVE-2024-45337)
- [NVD entry CVE-2024-45337](https://nvd.nist.gov/vuln/detail/CVE-2024-45337)
- [github.com](https://github.com/golang/crypto/commit/b4f1988a35dee11ec3e05d6bf3e90b695fbd8909)
- [go.dev](https://go.dev/cl/635315)
- [go.dev](https://go.dev/issue/70779)
- [groups.google.com](https://groups.google.com/g/golang-announce/c/-nPEi39gI4Q/m/cGVPJCqdAQAJ)
- [pkg.go.dev](https://pkg.go.dev/vuln/GO-2024-3321)
- [openwall.com](http://www.openwall.com/lists/oss-security/2024/12/11/2)
- [security.netapp.com](https://security.netapp.com/advisory/ntap-20250131-0007/)

---
Source page: https://erroneo.us/security/cve/CVE-2024-45337/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
