Integer Overflow Vulnerability in libssh2: Potential Out-of-Bounds Read Risk

libssh2 Updated 02 Oct 2025

Summary

16/07/2019
N/A
Yes i
High
8.1

ALPINE-CVE-2019-13115: In libssh2 before 1.9.0, kex_method_diffie_hellman_group_exchange_sha256_key_exchange in kex.c has an integer overflow that could lead to an out-of-bounds read in the way packets are read from the server. Affects libssh2 versions < 1.9.0-r0. Fixed in 1.9.0-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 Your last release was probably never penetration tested 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, allowing secure communication over unsecured networks. It is commonly utilized in applications requiring secure file transfers and remote command execution. The library's functionality includes key exchange, encryption, and authentication mechanisms. However, a vulnerability has been identified in versions prior to 1.9.0, which could lead to serious security risks.

Vulnerability Detail

In libssh2 versions before 1.9.0, the function kex_method_diffie_hellman_group_exchange_sha256_key_exchange in kex.c contains an integer overflow. This flaw can result in an out-of-bounds read when packets are processed from the server. A remote attacker who compromises an SSH server could exploit this vulnerability to disclose sensitive information or trigger a denial of service condition on the client system when a user connects to the server. This issue is related to an _libssh2_check_length mistake and is distinct from other vulnerabilities addressed in version 1.8.1, such as CVE-2019-3855.

How To Fix

Minimum fixed version

1.9.0-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

If immediate updating is not feasible, consider restricting access to the SSH server or implementing network-level controls to limit exposure to potential attacks. Additionally, monitor your systems for any unusual activity that may indicate exploitation attempts.

Conclusion

The integer overflow vulnerability in libssh2 poses significant risks to applications utilizing this library. It is crucial to update to the patched version 1.9.0-r0 or later to safeguard against potential exploits. Regular monitoring and using tools like Vulert can help maintain security in open-source software.

See every vulnerability recorded for libssh2 →

Share this vulnerability

FAQ

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

All versions of libssh2 prior to 1.9.0 are affected by this vulnerability.

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

Exploitation of this vulnerability could lead to sensitive information disclosure or denial of service conditions on client systems.

Yes, you can restrict access to the SSH server and monitor for unusual activity as a temporary measure.

Related vulnerabilities

Recent vulnerabilities recorded for libssh2.

How To Fix

Minimum fixed version

1.9.0-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