Denial of Service Vulnerability in libssh2: SSH_MSG_KEXINIT Packet Exploit

libssh2 Updated 02 Oct 2025

Summary

13/03/2015
N/A
Yes i
Unrated
Not published

CVE-2015-1782: The kex_agree_methods function in libssh2 before 1.5.0 allows remote servers to cause a denial of service (crash) or have other unspecified impact via crafted length values in an SSH_MSG_KEXINIT packet. Affects libssh2 versions < 1.4.3-4.1. Fixed in 1.4.3-4.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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

libssh2 is a widely used library that provides an API for implementing SSH2 (Secure Shell) protocol functionalities. It is utilized in various applications for secure data transmission over networks. The library is designed to handle SSH connections, including key exchange, authentication, and data encryption. However, prior to version 1.5.0, libssh2 was found to have a vulnerability that could be exploited by remote servers to cause a denial of service, potentially leading to application crashes or other unspecified impacts.

Vulnerability Detail

The vulnerability identified as CVE-2015-1782 originates from the kex_agree_methods function in libssh2 versions before 1.5.0. It allows remote servers to send crafted length values within an SSH_MSG_KEXINIT packet, which can lead to a denial of service condition. This can result in the application crashing or experiencing other unspecified impacts, making it critical for users of the library to address this issue promptly.

How To Fix

Minimum fixed version

1.4.3-4.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 upgrading is not immediately possible, consider implementing network-level controls to restrict access to the SSH service, thereby mitigating the risk of exploitation until a proper fix can be applied.

Conclusion

CVE-2015-1782 represents a significant vulnerability in libssh2 that can lead to denial of service through crafted SSH_MSG_KEXINIT packets. Users are strongly advised to upgrade to the latest version to mitigate risks associated with this vulnerability.

See every vulnerability recorded for libssh2 →

Share this vulnerability

FAQ

CVE-2015-1782 is a vulnerability in libssh2 that allows remote servers to exploit crafted SSH_MSG_KEXINIT packets, leading to potential denial of service.

libssh2 versions prior to 1.5.0 are affected by this vulnerability.

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

The vulnerability can lead to application crashes and other unspecified impacts, affecting the stability and security of applications using libssh2.

If an immediate upgrade is not possible, consider implementing network-level controls to limit access to the SSH service as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for libssh2.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

1.4.3-4.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