CVE-2025-47913 Overview
CVE-2025-47913 is a denial of service vulnerability affecting the Go SSH library (golang.org/x/crypto/ssh). SSH clients using this library can experience a panic and subsequent process termination when receiving an unexpected SSH_AGENT_SUCCESS response from a malicious or compromised SSH agent. When the client expects a typed response but instead receives SSH_AGENT_SUCCESS, the improper handling triggers a reachable assertion that crashes the application.
Critical Impact
This vulnerability allows network-based attackers to crash Go-based SSH client applications without authentication, causing service disruption and potential denial of service across affected systems.
Affected Products
- Go SSH library (golang.org/x/crypto/ssh)
- Applications built using the affected Go SSH package
- Go-based SSH clients and automation tools
Discovery Timeline
- 2025-11-13 - CVE CVE-2025-47913 published to NVD
- 2026-01-09 - Last updated in NVD database
Technical Details for CVE-2025-47913
Vulnerability Analysis
This vulnerability is classified under CWE-617 (Reachable Assertion), indicating that the application contains a reachable assertion that can be triggered by an external input, leading to process termination. The Go SSH client implementation does not properly handle protocol message type mismatches during SSH agent communication.
When an SSH client interacts with an SSH agent and expects a specific typed response (such as SSH_AGENT_IDENTITIES_ANSWER or SSH_AGENT_SIGN_RESPONSE), the code path assumes the response will conform to the expected message structure. A malicious SSH agent can exploit this by returning an SSH_AGENT_SUCCESS message instead, which lacks the expected typed payload. This type mismatch triggers a panic in the Go runtime, immediately terminating the client process.
The vulnerability is particularly concerning because it requires no authentication to exploit and can be triggered remotely over the network. Any application using the Go SSH library for client operations that communicate with potentially untrusted SSH agents is vulnerable to this denial of service attack.
Root Cause
The root cause of this vulnerability lies in insufficient message type validation within the SSH agent response handling code. The Go SSH library fails to properly validate that received protocol messages match the expected message types before attempting to parse them. When SSH_AGENT_SUCCESS is received instead of an expected typed response, the parsing logic encounters unexpected data structures, triggering an assertion failure and subsequent panic.
This represents a defensive programming oversight where the library trusts the SSH agent to always send correctly formatted responses without adequately validating message types before processing.
Attack Vector
The attack vector for CVE-2025-47913 operates through network-based SSH agent communication. An attacker who can position themselves as or compromise an SSH agent that the vulnerable client connects to can send malformed responses to trigger the vulnerability.
The attack scenario involves:
- A Go-based SSH client initiates communication with an SSH agent (which could be a rogue or compromised agent)
- The client sends a request expecting a specific typed response (e.g., requesting key identities or signatures)
- The malicious agent responds with SSH_AGENT_SUCCESS instead of the expected typed message
- The client's response handler panics when attempting to parse the unexpected message type
- The entire client process terminates abnormally
This attack requires no prior authentication and can be executed by any entity controlling an SSH agent endpoint that the client connects to. For technical implementation details, refer to the Go Language Issue Tracker and GitHub Security Advisory.
Detection Methods for CVE-2025-47913
Indicators of Compromise
- Unexpected SSH client process crashes with panic stack traces referencing SSH agent operations
- Application logs showing Go runtime panics in golang.org/x/crypto/ssh/agent package
- Repeated SSH client failures when connecting through specific agent endpoints
- Unusual SSH agent behavior returning unexpected message types
Detection Strategies
- Monitor application logs for Go panic signatures related to SSH agent communication
- Implement process monitoring to detect abnormal termination of SSH client applications
- Deploy network traffic analysis to identify malformed SSH agent protocol responses
- Use runtime instrumentation to track SSH agent message type mismatches
Monitoring Recommendations
- Configure alerting for SSH client process crashes and unexpected terminations
- Implement log aggregation to correlate SSH agent communication failures across systems
- Monitor SSH agent connectivity and response patterns for anomalies
- Track Go application health metrics including panic rates and process restarts
How to Mitigate CVE-2025-47913
Immediate Actions Required
- Update the Go SSH library (golang.org/x/crypto/ssh) to the latest patched version
- Rebuild and redeploy all applications using the vulnerable Go SSH package
- Review SSH agent configurations to ensure connections only to trusted agents
- Implement process supervision to automatically restart affected applications if crashes occur
Patch Information
The Go team has released a fix for this vulnerability. The patch is available through the official Go Language Code Review. Organizations should update to the patched version of golang.org/x/crypto/ssh as documented in the Go Vulnerability Report.
To update the dependency in your Go project:
go get -u golang.org/x/crypto/ssh@latest
go mod tidy
Workarounds
- Restrict SSH client applications to only connect to known, trusted SSH agent endpoints
- Implement network segmentation to limit exposure of SSH agent communication channels
- Deploy application-level recovery mechanisms to restart crashed SSH clients automatically
- Consider using alternative SSH implementations until the patch can be applied
# Example: Update Go SSH dependency and verify version
go get -u golang.org/x/crypto/ssh@latest
go list -m golang.org/x/crypto
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


