Out of Bounds Memory Access in libssh2 - CVE-2020-22218

libssh2 Updated 02 Oct 2025

Summary

22/08/2023
N/A
Yes i
High
7.5

CVE-2020-22218: An issue was discovered in function _libssh2_packet_add in libssh2 1.10.0 allows attackers to access out of bounds memory. Affects libssh2 across 2 version ranges.

< 1.9.0-2+deb11u1 < 635caa90787220ac3773c1d5ba11f1236c22eae8

Fixed in 1.9.0-2+deb11u1. 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 C library that provides an API for implementing SSH2 client and server functionality. It allows applications to securely connect to remote servers and supports various features such as SFTP and SCP. The library is essential for applications requiring secure data transmission over networks. However, a vulnerability has been identified in version 1.10.0 that can lead to out of bounds memory access, potentially compromising the integrity of applications using this library.

Vulnerability Detail

An issue was discovered in the function _libssh2_packet_add in libssh2 version 1.10.0, which allows attackers to access out of bounds memory. This vulnerability can lead to unauthorized access to sensitive data, application crashes, or arbitrary code execution, posing significant risks to the security of applications relying on this library. The vulnerability originates from improper handling of packet data, which can be exploited by malicious actors to manipulate memory access.

How To Fix

Minimum fixed version

1.9.0-2+deb11u1

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 immediate upgrading is not feasible, consider implementing input validation and sanitization to mitigate the risk of exploitation. However, this is not a complete fix and should only be a temporary measure until the library is updated.

Conclusion

CVE-2020-22218 is a significant vulnerability in libssh2 that can lead to severe security risks for applications using this library. It is crucial to upgrade to the latest secure versions to mitigate these risks. Regular monitoring for vulnerabilities using tools like Vulert can help maintain application security.

See every vulnerability recorded for libssh2 →

Share this vulnerability

FAQ

CVE-2020-22218 is a vulnerability in libssh2 that allows attackers to access out of bounds memory, potentially leading to unauthorized access or application crashes.

The vulnerability affects libssh2 version 1.10.0. Versions prior to 1.9.0-2+deb11u1 for Debian 11 and 1.10.0-2 for Debian 12 and 13 are also impacted.

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

The CVSS score of CVE-2020-22218 is 7.5, indicating a high severity level.

If you cannot upgrade immediately, implement input validation and sanitization as a temporary workaround until the library can be updated.

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.9.0-2+deb11u1

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