CVE-2025-15661: libssh2 out-of-bounds heap read in sftp_symlink

CVE-2025-15661 · Severity: medium · CVSS 6.5 · Published 2026-06-18

libssh2 is a widely used library that allows applications to communicate securely using the SSH protocol. A flaw in how the library handles certain SFTP responses could allow a malicious server or a man-in-the-middle attacker to crash the application or potentially access sensitive information from the computer's memory. This could lead to service disruptions or the exposure of private data during secure file transfer operations.

Technologies: Libssh2. Vendors: Libssh2.

Quick answers

Is CVE-2025-15661 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2025-15661 being exploited in the wild.
How severe is CVE-2025-15661?
Medium severity, with a CVSS score of 6.5, published 18 June 2026.
Which products and versions are affected?
Libssh2 through 1.11.1.
Is there a fix for CVE-2025-15661?
A patch was published on 2025-10-10: Fix merged into master branch via commit 2dae302 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2025-15661 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2025-15661?
Check whether you run Libssh2 at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

An out-of-bounds (OOB) heap read vulnerability exists in libssh2 through version 1.11.1 within the sftp_symlink() function in src/sftp.c. The issue stems from missing validation of the available packet buffer size before a memcpy operation when processing SSH_FXP_NAME responses for SFTP READLINK and REALPATH operations. A malicious SSH server or man-in-the-middle attacker can provide a link_len value larger than the actual packet data, triggering a buffer over-read. This can result in the disclosure of heap memory contents or a denial-of-service (crash). The vulnerability is fixed in commit 2dae302 by implementing a buffer struct to enforce bounds checking.

Affected products

  • libssh2 libssh2 through 1.11.1

Timeline

  • 2025-10-10: patched: Fix merged into master branch via commit 2dae302
  • 2026-06-18: disclosed: CVE published and NVD record created

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.