Integer Overflow Vulnerability in libssh2: Potential Remote Code Execution Risk

libssh2 Updated 03 Oct 2025

Summary

25/03/2019
N/A
Yes i
High
7.5

UBUNTU-CVE-2019-3856: An integer overflow flaw, which could lead to an out of bounds write, was discovered in libssh2 before 1.8.1 in the way keyboard prompt requests are parsed. Affects libssh2 versions < 1.4.3-2ubuntu0.2+esm2. Fixed in 1.4.3-2ubuntu0.2+esm2. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

libssh2 is a widely used library that provides an API for implementing SSH2 client functionality. It is utilized in various applications to enable secure communication over networks. The library is designed to handle SSH connections, including authentication and data transfer. However, a critical vulnerability has been identified that affects versions prior to 1.8.1, which could allow attackers to exploit the library's handling of keyboard prompt requests.

Vulnerability Detail

An integer overflow flaw was discovered in libssh2 before version 1.8.1, specifically in the way keyboard prompt requests are parsed. This vulnerability could lead to an out-of-bounds write, allowing a remote attacker who compromises an SSH server to execute arbitrary code on the client system when a user connects to the server. The CVSS score for this vulnerability is 7.5, indicating a high severity level.

How To Fix

Minimum fixed version

1.4.3-2ubuntu0.2+esm2

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libssh2

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

Workaround

As a temporary workaround, users can avoid connecting to untrusted SSH servers until the package is updated. Additionally, consider using alternative libraries or methods for SSH connections that do not rely on libssh2 until the vulnerability is resolved.

Conclusion

The integer overflow vulnerability in libssh2 poses a significant risk, allowing remote code execution through compromised SSH servers. It is crucial for users to update their libssh2 packages to the latest patched versions to mitigate this risk. Utilizing tools like Vulert can help monitor and identify vulnerabilities in your applications effectively.

See every vulnerability recorded for libssh2 →

Share this vulnerability

FAQ

libssh2 is a library that provides an API for SSH2 client functionality, enabling secure communication over networks.

The vulnerability allows an attacker to execute arbitrary code on the client system by exploiting the way keyboard prompt requests are handled.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check your application without any signup.

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

If you cannot update the package, avoid connecting to untrusted SSH servers and consider using alternative libraries for SSH connections.

Related vulnerabilities

Recent vulnerabilities recorded for libssh2.

How To Fix

Minimum fixed version

1.4.3-2ubuntu0.2+esm2

This is the first release that contains the fix.

sudo apt-get install --only-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