CVE-2025-8277
Low · 3.1CVSS
3.1
EPSS
0.4%
Published
Sep 9, 2025
CISA due date
—
Cloudanix analysis
A bug in a common secure-connection library can make programs slowly run out of memory and crash when they receive repeated bad setup messages during encrypted connections.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- High
- Impact
- Denial Of Service
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Memory leak in libssh during repeated incorrect KEX guesses where memory is not freed on rekey operations, exhausting heap and triggering crashes especially under libgcrypt.
Why it matters to the business
Client applications relying on SSH connections can experience gradual memory exhaustion leading to instability or denial of service, disrupting remote access and automated workflows over time.
How an attack unfolds
An attacker acting as a malicious SSH server repeatedly sends invalid KEX guess messages during the key exchange phase; the client fails to release allocated memory on each failed rekey attempt, eventually depleting resources and crashing the process.
How to fix it
Upgrade libssh to the latest stable release that corrects KEX memory handling; recompile any dependent applications against the patched library and restart affected services.
How to confirm the fix worked
Review libssh release notes for KEX memory fixes, run memory profiling tools during simulated KEX exchanges, and confirm absence of growing heap allocations after repeated invalid guesses.
Typical attack path
- Establish an SSH connection to a vulnerable libssh-based client
- Send a series of deliberately incorrect KEX guess packets
- Force repeated rekey operations without proper memory cleanup
- Monitor until heap exhaustion causes process crash or unresponsiveness
How to detect it
Inspect SSH client logs for repeated KEX failure or rekey events, correlate with system memory metrics showing steady growth in processes using libssh, and review core dumps or crash reports from affected applications.
What your security team should do
- Prioritize patching libssh in all client deployments within standard maintenance windows
- Inventory applications and scripts using libssh and schedule upgrades
- Enable resource limits and monitoring on long-lived SSH client processes
- Track upstream libssh announcements for any follow-on patches
The record
A flaw was found in libssh's handling of key exchange (KEX) processes when a client repeatedly sends incorrect KEX guesses. The library fails to free memory during these rekey operations, which can gradually exhaust system memory. This issue can lead to crashes on the client side, particularly when using libgcrypt, which impacts application stability and availability.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | libssh | 0 | No fix |
| Debian:12 | libssh | 0 | No fix |
| Debian:13 | libssh | 0 | No fix |
| Debian:14 | libssh | 0 | No fix |
| SUSE:Linux Enterprise Micro 5.1 | libssh | 0 | 0.9.8-150200.13.12.1 |
| SUSE:Linux Enterprise Micro 5.2 | libssh | 0 | 0.9.8-150200.13.12.1 |
| SUSE:Linux Enterprise Micro 5.3 | libssh | 0 | 0.9.8-150400.3.12.1 |
| SUSE:Linux Enterprise Micro 5.4 | libssh | 0 | 0.9.8-150400.3.12.1 |
| SUSE:Linux Enterprise Micro 5.5 | libssh | 0 | 0.9.8-150400.3.12.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP6 | libssh | 0 | 0.9.8-150600.11.6.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP7 | libssh | 0 | 0.9.8-150600.11.6.1 |
| SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 | libssh | 0 | 0.9.8-3.18.1 |
| SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 | libssh | 0 | 0.6.3-12.18.1 |
| openSUSE:Leap 15.6 | libssh | 0 | 0.9.8-150600.11.6.1 |
| openSUSE:Tumbleweed | libssh | 0 | 0.11.3-1.1 |
Related vulnerabilities
- CVE-2025-4877 There's a vulnerability in the libssh package where when a libssh consumer passes in an… Also affects libssh
- CVE-2025-8114 A flaw was found in libssh, a library that implements the SSH protocol. Also affects libssh
- CVE-2025-4878 A vulnerability was found in libssh, where an uninitialized variable exists under certain… Also affects libssh
- CVE-2025-5987 A flaw was found in libssh when using the ChaCha20 cipher with the OpenSSL library. Also affects libssh
- CVE-2025-5351 A flaw was found in the key export functionality of libssh. Also affects libssh
- CVE-2025-5372 A flaw was found in libssh versions built with OpenSSL versions older than 3.0… Also affects libssh
- CVE-2025-5318 A flaw was found in the libssh library in versions less than 0.11.2. Also affects libssh
- CVE-2015-3146 The (1) SSH_MSG_NEWKEYS and (2) SSH_MSG_KEXDH_REPLY packet handlers in package_cb.c in… Also affects libssh