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

libssh2 Updated 02 Oct 2025

Summary

22/08/2023
N/A
Yes i
Unrated
Not published

DEBIAN-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 versions < 1.9.0-2+deb11u1. 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 Devnack Penetration testing for web, API and mobile 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 library that provides an API for implementing SSH2 client functionality in applications. It is utilized for secure file transfers and remote command execution. The library is known for its lightweight design and ease of integration into various programming environments. However, a vulnerability has been identified that allows attackers to exploit out of bounds memory access, potentially leading to unauthorized access or application crashes.

Vulnerability Detail

An issue was discovered in the function _libssh2_packet_add in libssh2 version 1.10.0. This vulnerability allows attackers to access memory locations outside the intended bounds, which can lead to various security risks, including data corruption, application crashes, and unauthorized access to sensitive information. The vulnerability arises from improper handling of packet data, making it crucial for users to address it promptly to maintain application security.

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

As a temporary workaround, consider disabling features that rely on libssh2 until the package can be updated. This may involve modifying application configurations to avoid using SSH functionalities provided by the library.

Conclusion

The vulnerability CVE-2020-22218 in libssh2 poses significant security risks due to out of bounds memory access. It is essential for users to update to the patched versions of the library to safeguard their applications. Utilizing tools like Vulert can help monitor and manage vulnerabilities effectively.

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 security breaches.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Check your application against this vulnerability using the Vulert playground at Vulert Scanner.

The risks include data corruption, application crashes, and unauthorized access to sensitive information, which can compromise the security of your application.

Yes, patches are available for various Debian versions. Ensure you update to the specified patched versions to mitigate the risk.

If an immediate update is not possible, consider disabling features that rely on libssh2 until the vulnerability can be addressed.

Related vulnerabilities

Recent vulnerabilities recorded for libssh2.

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