Out-of-bounds Read Affecting libssh package, versions <0.8.0~20170825.94fa1e38-1ubuntu0.7+esm4


Severity

Recommended
medium

Based on Ubuntu security rating.

Threat Intelligence

EPSS
0.06% (18th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-UBUNTU1804-LIBSSH-10499346
  • published21 Aug 2025
  • disclosed24 Jun 2025

Introduced: 24 Jun 2025

CVE-2025-5318  (opens in a new tab)
CWE-125  (opens in a new tab)

How to fix?

Upgrade Ubuntu:18.04 libssh to version 0.8.0~20170825.94fa1e38-1ubuntu0.7+esm4 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream libssh package and not the libssh package as distributed by Ubuntu. See How to fix? for Ubuntu:18.04 relevant fixed versions and status.

A flaw was found in the libssh library. An out-of-bounds read can be triggered in the sftp_handle function due to an incorrect comparison check that permits the function to access memory beyond the valid handle list and to return an invalid pointer, which is used in further processing. This vulnerability allows an authenticated remote attacker to potentially read unintended memory regions, exposing sensitive information or affect service behavior.

CVSS Base Scores

version 3.1