CVE-2025-58181

5.3 MEDIUM

📋 TL;DR

This vulnerability in SSH servers allows attackers to cause denial of service through memory exhaustion by sending malformed GSSAPI authentication requests. It affects SSH servers using GSSAPI authentication, particularly those built with vulnerable versions of Go's crypto/ssh package. Systems with GSSAPI enabled for SSH authentication are at risk.

💻 Affected Systems

Products:
  • Go crypto/ssh package
  • Applications using Go's crypto/ssh with GSSAPI support
Versions: Go versions before 1.23.3 and 1.22.12
Operating Systems: All operating systems running affected Go applications
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when GSSAPI authentication is enabled in SSH server configuration. Most default SSH configurations do not enable GSSAPI.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete SSH service disruption due to memory exhaustion, preventing legitimate authentication and potentially affecting system stability.

🟠

Likely Case

SSH service degradation or temporary unavailability requiring service restart, impacting remote administration capabilities.

🟢

If Mitigated

Minimal impact if GSSAPI authentication is disabled or proper resource limits are configured.

🌐 Internet-Facing: MEDIUM - SSH servers exposed to the internet with GSSAPI enabled could be targeted for DoS attacks.
🏢 Internal Only: LOW - Internal attackers could disrupt SSH services, but impact is limited to denial of service.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires sending specially crafted SSH packets to trigger the memory allocation issue. No authentication is required to send the malformed request.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Go 1.23.3 and Go 1.22.12

Vendor Advisory: https://groups.google.com/g/golang-announce/c/w-oX3UxNcZA

Restart Required: Yes

Instructions:

1. Update Go to version 1.23.3 or 1.22.12. 2. Rebuild any applications using crypto/ssh package. 3. Restart SSH services using the updated applications.

🔧 Temporary Workarounds

Disable GSSAPI authentication

all

Disable GSSAPI authentication in SSH server configuration to prevent exploitation

In sshd_config: set 'GSSAPIAuthentication no'

🧯 If You Can't Patch

  • Disable GSSAPI authentication in SSH configuration
  • Implement network controls to limit SSH access to trusted sources only

🔍 How to Verify

Check if Vulnerable:

Check if SSH server uses Go crypto/ssh package and has GSSAPI authentication enabled. Review sshd_config for 'GSSAPIAuthentication yes'.

Check Version:

go version

Verify Fix Applied:

Verify Go version is 1.23.3 or 1.22.12, and SSH services have been restarted after update.

📡 Detection & Monitoring

Log Indicators:

  • Multiple failed GSSAPI authentication attempts
  • SSH service crashes or restarts
  • High memory usage by SSH processes

Network Indicators:

  • Unusual volume of SSH connection attempts with GSSAPI negotiation
  • Malformed SSH packets targeting port 22

SIEM Query:

source="sshd" AND ("GSSAPI" OR "authentication failure") | stats count by src_ip

🔗 References

📤 Share & Export