Integer Overflow Vulnerability in libssh2: Potential Remote Code Execution Risk

libssh2 Updated 02 Oct 2025

Summary

25/03/2019
N/A
Yes i
Unrated
Not published

DEBIAN-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.8.0-2.1. Fixed in 1.8.0-2.1. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

libssh2 is a widely used library that provides an API for implementing SSH2 client and server functionality. It is utilized in various applications to facilitate secure communication over networks. The library supports features such as secure file transfer and remote command execution. However, prior to version 1.8.1, libssh2 contained a critical vulnerability that could be exploited by attackers to execute arbitrary code on client systems.

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 allows a remote attacker, who compromises an SSH server, to potentially execute code on the client system when a user connects to the server. The flaw arises from improper handling of user input, leading to an out-of-bounds write, which can be exploited to gain unauthorized access or control over the affected system.

How To Fix

Minimum fixed version

1.8.0-2.1

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

If updating the package is not immediately possible, consider restricting access to the affected SSH server or using alternative secure communication methods until the vulnerability can be addressed. Additionally, ensure that users are aware of the risks associated with connecting to potentially compromised servers.

Conclusion

The integer overflow vulnerability in libssh2 poses a significant risk of remote code execution on client systems. It is crucial for users and administrators to update to the patched version 1.8.0-2.1 or later to mitigate this risk. Awareness and proactive measures are essential to safeguard systems against potential exploitation.

See every vulnerability recorded for libssh2 →

Share this vulnerability

FAQ

The vulnerability is an integer overflow that can lead to out-of-bounds writes, allowing remote code execution on client systems.

You can use Vulert's playground at Vulert Scanner to check if your application is affected without needing to sign up.

Versions of libssh2 prior to 1.8.1 are vulnerable to this integer overflow issue.

Consider restricting access to the affected SSH server and inform users about the risks of connecting to potentially compromised servers.

You can visit Vulert at https://vulert.com for real-time monitoring and alerts on open-source vulnerabilities.

Related vulnerabilities

Recent vulnerabilities recorded for libssh2.

How To Fix

Minimum fixed version

1.8.0-2.1

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