Critical Out of Bounds Read Vulnerability in libssh2

libssh2 Updated 02 Oct 2025

Summary

21/03/2019
N/A
Yes i
Critical
9.1

ALPINE-CVE-2019-3858: An out of bounds read flaw was discovered in libssh2 before 1.8.1 when a specially crafted SFTP packet is received from the server. Affects libssh2 versions < 1.8.1-r0. Fixed in 1.8.1-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

libssh2 is a widely used C library that implements the SSH2 protocol, enabling secure communication over a network. It is utilized in various applications for secure file transfers and remote command execution. The library is known for its lightweight design and ease of integration, making it a popular choice among developers. However, a critical vulnerability has been identified that could compromise the security of applications relying on this library.

Vulnerability Detail

An out of bounds read flaw was discovered in libssh2 before version 1.8.1. This vulnerability arises when a specially crafted SFTP packet is received from a server. A remote attacker who compromises an SSH server may exploit this flaw to cause a Denial of Service (DoS) or potentially read sensitive data from the client’s memory. The vulnerability has a CVSS score of 9.1, indicating its critical nature and the significant risk it poses to affected systems.

How To Fix

Minimum fixed version

1.8.1-r0

This is the first release that contains the fix.

sudo apk add --upgrade libssh2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary measure, if updating the package is not immediately feasible, consider restricting access to the SSH server to trusted IP addresses only. This can help mitigate the risk of exploitation until the library is updated.

Conclusion

The out of bounds read vulnerability in libssh2 poses a significant risk to applications using this library. It is crucial for developers and system administrators to update to the patched version to safeguard against potential attacks. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time, ensuring ongoing security.

See every vulnerability recorded for libssh2 →

Share this vulnerability

FAQ

The vulnerability is an out of bounds read flaw that can lead to Denial of Service or unauthorized data access.

You can use the Vulert playground at Vulert Scanner to check if your application is affected without any signup.

The CVSS score of this vulnerability is 9.1, indicating a critical severity level.

Update the libssh2 package to version 1.8.1-r0 or later to mitigate the vulnerability.

While specific exploits may not be publicly available, the nature of the vulnerability allows for potential Denial of Service attacks and data leakage.

Related vulnerabilities

Recent vulnerabilities recorded for libssh2.

How To Fix

Minimum fixed version

1.8.1-r0

This is the first release that contains the fix.

sudo apk add --upgrade libssh2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback