CVE-2025-47914 Overview
CVE-2025-47914 affects SSH Agent server implementations in the golang.org/x/crypto module. The agent does not validate message size when processing new identity requests. A malformed message triggers an out-of-bounds read [CWE-125], causing the program to panic and terminate the agent process.
The issue impacts services that embed the Go SSH agent server to broker key operations. An unauthenticated network-adjacent client sending a crafted identity-addition request can crash the agent. The defect is tracked as GO-2025-4135 by the Go vulnerability database and resolved upstream in golang.org/x/crypto.
Critical Impact
A malformed SSH agent identity-addition message triggers an out-of-bounds read and panics the agent process, producing a denial-of-service condition for any service relying on the Go SSH agent server.
Affected Products
- golang.org/x/crypto SSH agent server (module golang:crypto)
- Go applications embedding golang.org/x/crypto/ssh/agent server functionality
- Downstream tools and services exposing an SSH agent backed by this library
Discovery Timeline
- 2025-11-19 - CVE-2025-47914 published to NVD
- 2025-12-11 - Last updated in NVD database
Technical Details for CVE-2025-47914
Vulnerability Analysis
The SSH agent protocol uses length-prefixed messages to add, list, and remove identities. The Go implementation in golang.org/x/crypto/ssh/agent processes new identity requests by parsing fields from the incoming message buffer. The server does not verify that the declared message size matches the actual payload available before reading subsequent fields.
When a malformed or truncated request reaches the agent, the parser reads past the end of the buffer. This out-of-bounds read raises a runtime panic in Go and tears down the goroutine, which can terminate the agent process. The defect is classified as [CWE-125] Out-of-Bounds Read and produces an availability impact only — no confidentiality or integrity loss is documented.
Root Cause
The root cause is missing input validation in the agent server's message-handling path for identity additions. The code trusts the framing data supplied by the client and dereferences buffer regions without bounds checks. Any client able to reach the agent socket or network endpoint can supply input that violates the parser's implicit length assumptions.
Attack Vector
The vulnerability is reachable wherever the affected agent listens. Standard deployments use a local Unix domain socket, but forwarded or networked agents expand the attack surface. An attacker delivers a crafted SSH agent message in which size fields do not match payload length. Parsing then reads beyond the buffer and panics. Exploitation requires no authentication and no user interaction. See the Go Vulnerability Report GO-2025-4135 for technical details.
No public proof-of-concept exploit is listed in the available references.
Detection Methods for CVE-2025-47914
Indicators of Compromise
- Unexpected termination or repeated restarts of SSH agent processes built with vulnerable golang.org/x/crypto versions
- Go runtime panic stack traces referencing ssh/agent parsing functions in application or system logs
- Malformed SSH_AGENTC_ADD_IDENTITY (message type 17) requests observed on agent sockets or forwarded channels
Detection Strategies
- Inventory Go binaries with govulncheck to identify modules importing affected versions of golang.org/x/crypto/ssh/agent
- Correlate agent process crash events with preceding inbound connections to the agent socket
- Alert on repeated short-lived connections to SSH agent endpoints followed by service exit codes
Monitoring Recommendations
- Forward SSH agent stdout/stderr and systemd journal entries to a centralized log platform and watch for runtime error: index out of range patterns
- Monitor availability of services that depend on agent-backed authentication, including CI/CD runners and bastion hosts
- Track network or socket access to agent listeners and flag clients submitting non-standard message lengths
How to Mitigate CVE-2025-47914
Immediate Actions Required
- Rebuild affected Go applications against a patched golang.org/x/crypto release that includes the fix referenced in Go change 721960
- Restrict access to SSH agent sockets and forwarded agent endpoints to trusted users and hosts only
- Disable ForwardAgent on SSH clients connecting to untrusted servers to prevent remote panic of local agents
Patch Information
The upstream fix is published in the golang.org/x/crypto repository and tracked under Go issue 76364 and Go change 721960. Consumers must update the module dependency in go.mod and recompile binaries — runtime patching of Go applications is not possible. Refer to the Golang Announce notice for release coordination details.
Workarounds
- Run agent processes under a supervisor such as systemd with automatic restart to limit downtime if the panic is triggered
- Bind agent listeners to local sockets with strict filesystem permissions instead of TCP or shared transports
- Avoid agent forwarding to multi-tenant or untrusted SSH servers until builds incorporate the patched library
# Update the affected module and rebuild
go get golang.org/x/crypto@latest
go mod tidy
go build ./...
# Verify no vulnerable versions remain
govulncheck ./...
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

