CVE-2026-15370: libssh stack buffer overflow in SFTP server directory listing

CVE-2026-15370 · Severity: medium · CVSS 6.7 · Published 2026-07-21

A security vulnerability exists in libssh, a library used to provide secure communication for applications. When a server using this library lists files in a directory, it may incorrectly handle very long filenames, leading to a system crash or allowing an attacker to run unauthorized commands. This could potentially allow a user with limited access to gain higher privileges or disrupt server operations.

Technologies: Libssh. Vendors: Libssh.

Quick answers

Is CVE-2026-15370 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-15370 being exploited in the wild.
How severe is CVE-2026-15370?
Medium severity, with a CVSS score of 6.7, published 21 July 2026.
Which products and versions are affected?
Libssh unspecified.
Is there a fix for CVE-2026-15370?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is CVE-2026-15370 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2026-15370?
Check whether you run Libssh 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

A stack-based buffer overflow (CWE-121) exists in the libssh SFTP server implementation within the 'process_readdir()' function in 'src/sftpserver.c'. The vulnerability is caused by unsafe concatenation using 'strcat()' into a fixed-size stack buffer ('long_name') when constructing the 'longname' field for directory listings. An attacker who can control filenames in a directory listed by the SFTP server can provide sufficiently long names to overflow the buffer. While the CVSS vector suggests local access and high complexity, the flaw theoretically allows for memory corruption and arbitrary code execution in the context of the SSH server process.

Affected products

  • libssh libssh unspecified
  • Red Hat Red Hat Enterprise Linux 10 affected
  • Red Hat Red Hat Hardened Images affected

Timeline

  • 2026-07-10: disclosed: Initial report in Red Hat Bugzilla
  • 2026-07-21: advisory: NVD publication date

References

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