Engineer working on a laptop connected to a device test rig, surrounded by wiring harnesses and test hardware

Firmware vulnerabilities & fixes

libssh and libssh2 vulnerabilities in embedded firmware: find the library, rank the CVEs, patch or backport

Last updated:

The libssh and libssh2 vulnerabilities in embedded firmware that matter most as of 2026-11-16 are CVE-2018-10933, a libssh server authentication bypass fixed in 0.7.6 and 0.8.4, and the nine libssh2 client memory bugs fixed in 1.8.1 on 2019-03-18. Terrapin (CVE-2023-48795) touches both. libssh2 1.11.1, the newest release, also needs 2026 patches that exist only as commits. Find which library each binary loads, its version and patches, then upgrade or backport and restrict algorithms and host keys.

Key takeaways

  • libssh and libssh2 are SSH libraries that a vendor's own programs link to, while OpenSSH and Dropbear are ready-made SSH servers and clients that run as their own processes.
  • libssh2 most often reaches a device through libcurl, and libssh through management daemons that need an SSH server or client inside their own process.
  • Two patterns stand out.
  • The libssh authentication bypass lets a client log in to a libssh-based server without any credentials.

How are libssh and libssh2 different from OpenSSH and Dropbear?

libssh and libssh2 are SSH libraries that a vendor's own programs link to, while OpenSSH and Dropbear are ready-made SSH servers and clients that run as their own processes. The libssh2 home page describes it as "a client-side C library implementing the SSH2 protocol", so it can connect out but never accept an SSH login. libssh covers both sides: its project page calls it a library "implementing the SSHv2 protocol on client and server side", which means a device can expose an SSH or SFTP service that is neither OpenSSH nor Dropbear.

That difference changes how you triage. A device can run Dropbear as its login server, link libcurl against libssh2 for SFTP uploads and embed a NETCONF server built on libssh, all in one image. Each has its own CVEs and fixes. For the two daemons, see our guides on OpenSSH vulnerabilities in embedded firmware and Dropbear SSH vulnerabilities; this guide covers only the two libraries.

Where do libssh and libssh2 ship in embedded devices?

libssh2 most often reaches a device through libcurl, and libssh through management daemons that need an SSH server or client inside their own process. Everything curl says that for SCP and SFTP support curl must be built with one of two SSH libraries, libssh2 or libssh. curl's CMake build turns libssh2 on by default, while OpenWrt's curl package keeps SCP and SFTP off unless its LIBCURL_SSH2 option is selected, which then pulls in libssh2. Our libcurl vulnerabilities in embedded firmware guide covers curl's own CVEs; a libcurl that links libssh2 inherits libssh2's too.

Typical device uses are clients: a gateway that pushes configuration backups or logs to an SFTP server, or an updater that downloads images over SFTP. On the server side, the clearest case is network management: OpenWrt's libnetconf2 package, the NETCONF library under the Netopeer2 server, depends on libssh to carry NETCONF messages over SSH.

The build systems carry both libraries, and their defaults differ. On 2026-11-16:

Build system libssh libssh2
OpenWrt packages 0.12.2, mbedTLS backend, server and SFTP built in (WITH_SERVER=ON, WITH_SFTP=ON) 1.11.1, OpenSSL or mbedTLS backend, no CVE patches in the package
Buildroot 0.12.1, server support only when BR2_PACKAGE_LIBSSH_SERVER is selected 1.11.1 with ten patches covering eight CVE ids
Yocto (OpenEmbedded) 0.11.5 in meta-oe 1.11.1 in OpenEmbedded-Core with patches for ten CVE ids

The OpenWrt libssh Makefile and libssh2 Makefile also declare cpe:/a:libssh:libssh and cpe:/a:libssh2:libssh2, the identifiers NVD files these CVEs under. Our embedded Linux build systems and SBOM guide explains how those package records become SBOM entries.

Which libssh and libssh2 CVEs matter most for device makers?

Which CVEs matter depends first on the library and then on the role: libssh server bugs need a device that accepts SSH connections through libssh, while libssh2 bugs need a device that connects out to a server an attacker controls or can impersonate. Fixed versions come from the libssh advisories and the libssh2 changelog; scores are NVD's unless marked, EPSS values are FIRST's for 2026-11-15, and KEV status is from CISA's catalog version 2026.11.13, which lists no libssh or libssh2 CVE.

CVE Library and role What it is Affected Fixed CVSS EPSS
CVE-2018-10933 libssh server Client sends a success message in place of an authentication request and is treated as logged in 0.6.0 up to the fixes 0.7.6, 0.8.4 (October 2018) 9.1 0.918
CVE-2019-3855 to CVE-2019-3863 libssh2 client Nine integer overflows and out-of-bounds reads or writes triggered by a malicious server Up to and including 1.8.0 1.8.1 (2019-03-18) 8.8 to 9.1 (3855: 8.8) 0.035 to 0.093
CVE-2023-48795 (Terrapin) Both, client and server A machine in the middle deletes the first encrypted packet, downgrading extension negotiation libssh below 0.10.6 and 0.9.8; libssh2 through 1.11.0 libssh 0.10.6, 0.9.8; libssh2 1.11.1 5.9 (libssh: 3.7) 0.935
CVE-2026-15370 libssh SFTP server Stack buffer overflow when listing a directory with long, attacker-chosen file names 0.11.0 to 0.11.4, 0.12.0 0.11.5, 0.12.1 (2026-07-21) 7.3 (libssh: 6.7) 0.002
CVE-2026-55200 libssh2 client Missing upper bound on the packet length field leads to heap corruption 1.11.1 Commit 97acf3d only 8.3 0.039
CVE-2026-66035 libssh2 client Pre-authentication heap overflow on the encrypt-then-MAC decrypt path Through 1.11.1 Commit 42e33d8 only 7.5 (CNA) 0.005

Two patterns stand out. Terrapin's high EPSS reflects how widely it is scanned for across all SSH software, not a device-specific exploit, and its real impact on these libraries is a downgrade, not code execution. The libssh2 2026 CVEs, by contrast, are memory-safety bugs with no fixed release: a scan that only compares against "latest version" will call 1.11.1 clean while it is not. Our KEV and EPSS prioritisation guide explains how to weigh these signals.

How does the libssh authentication bypass (CVE-2018-10933) work?

The libssh authentication bypass lets a client log in to a libssh-based server without any credentials. libssh's advisory explains that "By presenting the server an SSH2_MSG_USERAUTH_SUCCESS message in place of the SSH2_MSG_USERAUTH_REQUEST message which the server would expect to initiate authentication, the attacker could successfully authentciate without any credentials". The library's state machine then allowed the client to open channels, so whatever the vendor's server does with a channel, such as a shell, an SFTP subsystem or a NETCONF session, is reachable unauthenticated.

The bug is in the server code of libssh 0.6 and later, fixed in 0.8.4 and 0.7.6, and the advisory states there is no workaround. A product that uses libssh only as a client is outside its scope, which is why establishing the role matters before ranking it. Old builds were fixed by backport: the Debian tracker for CVE-2018-10933 lists 0.6.3-4+deb8u3 for jessie (DLA-1548-1) and 0.7.3-2+deb9u1 for stretch (DSA-4322-1).

Later libssh server flaws follow the same theme on smaller scale. CVE-2023-2283 accepts an invalid signature when a memory allocation fails, affecting 0.9.0 to 0.9.6 and 0.10.0 to 0.10.4 with the OpenSSL backend only, and libssh's advisory notes it may happen "if not enough memory or the memory usage is limited", a realistic condition on a small device. CVE-2026-59851 in 0.12.0 lets any client with valid Kerberos credentials log in as any user when GSSAPI key exchange is enabled, which OpenWrt's libssh package compiles out. Our guide on how to fix authentication bypass in embedded firmware covers the same class of bug in vendor code.

Why do the 2019 libssh2 CVEs put devices at risk as clients?

The 2019 libssh2 CVEs put devices at risk because a device running libssh2 trusts the bytes a server sends it. The libssh2 advisory for CVE-2019-3855 describes a malicious server sending a crafted packet that triggers an integer overflow, then an out-of-bounds memory write, in all versions up to and including 1.8.0. The other eight CVEs released with it on 2019-03-18 are integer overflows in keyboard-interactive and exit-signal handling and out-of-bounds reads in SFTP and packet parsing. libssh2 1.8.2 followed on 2019-03-25 because, per the changelog, one patch in 1.8.1 was misapplied and broke user authentication.

On a device, the server is whatever the product connects to: a backup target, a log collector or an update mirror. An attacker who controls it, or who can sit in the path and answer first, reaches the parsing code. Checking the server's host key limits who the device talks to, but it does not remove this class of bug, because packets are parsed before and during the key exchange. NVD's record for the 2026 libssh2 flaw CVE-2026-66035 calls it a "pre-authentication heap buffer overflow" that "allows a malicious SSH server to corrupt heap metadata in any connecting client". Only patched code closes it.

Distributions fixed the 2019 bugs in older versions too. The Debian tracker for CVE-2019-3855 shows libssh2 1.4.3-4.1+deb8u2 for jessie (DLA-1730-1) and 1.7.0-1+deb9u1 for stretch (DSA-4431-1), both far below 1.8.1 and both fixed.

What does Terrapin (CVE-2023-48795) mean for libssh and libssh2?

Terrapin lets an attacker in the network path remove the first encrypted message of an SSH connection without either side noticing, and only when certain algorithms are negotiated. The Terrapin researchers state that the connection "must be secured by either ChaCha20-Poly1305 or CBC with Encrypt-then-MAC". libssh's advisory says the practical outcome is removing the EXT_INFO message, which "could cause downgrade to SHA1" for RSA signatures, fixed in 0.10.6 and 0.9.8; its workaround is to disable the [email protected] cipher and the *[email protected] MACs.

libssh2 is a closer call. NVD lists it as affected through 1.11.0, and the libssh2 changelog shows 1.11.1 adding "strict KEX" to fix it. But libssh2 offers no ChaCha20-Poly1305, and encrypt-then-MAC MACs first arrived in 1.11.0. The Debian tracker for CVE-2023-48795 marks its libssh2 packages for buster, bullseye and bookworm, up to 1.10.0, as not affected because "ChaCha20-Poly1305 and CBC-EtM support not present". A libssh2 below 1.11.0 is a strong "not affected" candidate; a 1.11.0 build that still offers CBC ciphers is the one to fix. Both peers need strict key exchange for the fix to take effect, so a patched library talking to an unpatched SSH server or client still depends on the algorithm workaround.

How do you identify libssh or libssh2 and its version in a firmware image?

Identify which library is present, which programs load it, and which version and patches it carries.

  1. Shared librariesIn the unpacked root file system, look for libssh.so* and libssh2.so*. OpenWrt installs libssh2 with ABI version 1 and copies every libssh* file for libssh.
  2. Who loads themRun readelf -d on candidate programs and look for libssh or libssh2 in the NEEDED entries. A libcurl that lists libssh2 supports SFTP and SCP. Statically linked programs show nothing here, so fall back to strings.
  3. Version stringsBoth libraries build their default identification string from the version: libssh sends SSH-2.0-libssh_ plus its version, and libssh2 sends SSH-2.0-libssh2_ plus its version, for example SSH-2.0-libssh2_1.11.1. Search the library or the static binary for those prefixes. Applications can override the string, with libssh2_session_banner_set() on the libssh2 side, so a missing or odd banner is not proof either way.
  4. On a running deviceA server built on libssh shows its banner to anyone who connects to the port. libcurl reports its SSH backend in the libssh_version field of curl_version_info(), which curl -V prints.
  5. Package metadataOpenWrt's opkg database, Buildroot's package list and Yocto's manifests give the version, and the Buildroot and Yocto recipes list the CVE patches applied, which no version string shows.
  6. Role and build optionsFor libssh, establish whether the server side is compiled in and used, and whether SFTP server and GSSAPI support are present, since several CVEs depend on them.

How should you configure and harden libssh and libssh2 in a product?

Hardening these libraries is the job of the product that links them, because neither ships a configuration file like sshd_config that an operator would edit. The main levers are what you compile in, which algorithms you allow and how you check the peer.

For a libssh server, build only what the product uses. Buildroot leaves the server off unless it is selected, while OpenWrt's package builds server and SFTP support in for every user of the library. In code, restrict algorithms with ssh_bind_options_set(): SSH_BIND_OPTIONS_CIPHERS_C_S and _S_C, SSH_BIND_OPTIONS_HMAC_C_S and _S_C, SSH_BIND_OPTIONS_KEY_EXCHANGE and SSH_BIND_OPTIONS_HOSTKEY_ALGORITHMS. libssh's option documentation notes that it processes system-wide configuration files automatically unless SSH_BIND_OPTIONS_PROCESS_CONFIG is set to false, so either ship a known configuration file or turn that off. Implement the authentication and authorization callbacks yourself, and keep GSSAPI out of the build unless Kerberos is a product requirement. Generate a unique host key per device; our hard-coded credentials guide explains why shared keys are a finding.

For a libssh2 or libcurl client, verify the server. The libcurl options CURLOPT_SSH_KNOWNHOSTS and CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 both default to NULL, and curl's documentation strongly suggests setting the known-hosts file for SCP and SFTP "to make sure that the network communication is done with the intended server and not an impostor". Pinning the SHA256 of the server's public key suits a device that talks to one fixed server. Programs using libssh2 directly check keys with the libssh2_knownhost_* functions and can drop algorithms with libssh2_session_method_pref(), for example removing CBC ciphers to rule out Terrapin on 1.11.0. Since 1.11.0, libssh2 can also compile out weak algorithms with LIBSSH2_NO_* build options such as LIBSSH2_NO_DSA, LIBSSH2_NO_RSA_SHA1 and LIBSSH2_NO_AES_CBC, and 1.11.1 disables DSA by default.

For both, keep SSH traffic on the interfaces it needs. A NETCONF or SFTP service built on libssh belongs on a management network, never on a WAN port.

How does a device maker patch or backport libssh and libssh2?

  1. libssh: move to a maintained seriesThe 2026 security releases went to the 0.12 and 0.11 series only: the 0.12.1 and 0.11.5 announcement of 2026-07-21 lists eleven CVEs for 0.12.1 and nine for 0.11.5, and the 0.12.2 release on 2026-07-28 added a fix for CVE-2026-59843 that was missed in 0.12.1. A product on 0.10 or older needs a series upgrade or a distribution's backports.
  2. libssh2: backport, because no release has the fixeslibssh2 1.11.1 dates from 2024-10-16 and is still the newest release on 2026-11-16, so 2026 fixes such as CVE-2026-55200 and CVE-2026-66035 exist only as commits on its main branch. Build systems carry them as patches: Buildroot's libssh2.mk applies ten patches and records eight CVE ids as fixed, and the OpenEmbedded-Core recipe applies patches for ten CVE ids. OpenWrt's package builds plain 1.11.1, so an OpenWrt-based product has to add them itself.
  3. Mitigate meanwhileFor Terrapin, drop ChaCha20-Poly1305 and encrypt-then-MAC MACs. For libssh server CVEs, take the server off untrusted interfaces. For libssh2 client CVEs, limit which servers the device connects to and pin their keys, accepting that this narrows exposure but does not fix memory-safety bugs.
  4. Release with evidenceRegenerate the SBOM, record the library version and patch list, and state per CVE whether the product is affected. Our CSAF and VEX for device makers guide shows the format, for example "not affected" for CVE-2018-10933 when libssh is used only as a client.

Worked example: how would you triage libssh2 in a gateway image?

Synthetic example, not a real product. An industrial gateway image based on OpenWrt uploads hourly logs to a customer's SFTP server through libcurl, and the package list shows libssh2 1.11.1.

  1. Confirm the library and rolereadelf -d shows libcurl.so.4 needs libssh2.so.1, and the library contains SSH-2.0-libssh2_1.11.1. No program links libssh, so no libssh server CVE applies.
  2. Match the CVEsThe 2019 CVEs and Terrapin are fixed in 1.11.1 and recorded as not affected. CVE-2026-55200 and CVE-2026-66035 apply: the package has no patch directory, and both bugs sit on the client's packet-parsing path.
  3. Check exposureThe upload uses the customer's server name over the customer network, and the logging code sets neither CURLOPT_SSH_KNOWNHOSTS nor a key pin, so anyone who can answer for that server name can send the gateway crafted packets.
  4. FixAdd the upstream fix commits as patches, using the Buildroot or OpenEmbedded-Core patch sets as references, set CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 from a key the customer provisions, rebuild, re-scan and publish a VEX statement per CVE.

How does AI-assisted analysis help with libssh and libssh2 findings?

SoftWSP's automated scan unpacks a firmware image, catalogs the software packages in the extracted file system with their versions (the inventory our firmware SBOM guide describes), and matches each one against CVE records, CISA's KEV catalog and FIRST's EPSS scores. This is deterministic code: the code scores, and AI narrates. You can inspect the resulting CycloneDX file in the free SBOM viewer.

Version matching follows NVD's records and inherits their limits, which are visible with these two libraries. A match needs the package mapped to libssh:libssh or libssh2:libssh2, which a statically linked copy inside another program does not get for free. Some records are hard to place: NVD's CPE for CVE-2026-59843 names libssh with no version range at all, so a version comparison cannot decide it from the record alone, and any distribution or build-system backport looks unfixed to a plain version match. AI's part is the written explanation of what matched, citing the component, version and record behind each sentence. An engineer reviews every finding before the report is delivered, and that review is where the library's role, the compiled-in server and SFTP code, the offered algorithms, host-key checking and any backported patch become a documented "affected" or "fixed" decision.

For where SSH libraries fit in a full assessment, see the OWASP Firmware Security Testing Methodology guide, or device & firmware security services to have a specific image reviewed.

This guide draws on libssh's security advisories and release announcements, the libssh2 home page, changelog, CVE-2019-3855 advisory and fix commits, the Terrapin research site, Everything curl and the libcurl option documentation, the OpenWrt, Buildroot and OpenEmbedded-Core package files, the Debian Security Tracker, NVD, CISA's KEV catalog (version 2026.11.13) and FIRST EPSS data dated 2026-11-15, all read directly on 2026-11-16.

Put this guide to work

Frequently asked questions

What is the difference between libssh, libssh2, OpenSSH and Dropbear?

OpenSSH and Dropbear are complete SSH programs: a server daemon and a client that a device runs as processes. libssh and libssh2 are C libraries that other programs link to speak SSH. libssh implements both the client and the server side, so a vendor can build its own SSH or SFTP server on it. libssh2 is client-only, which is why it mostly appears behind libcurl's SCP and SFTP support and in daemons that upload backups or logs. The CVEs, version numbers and fixes of the four projects are separate, so a scan has to identify which one each binary actually uses.

Which libssh and libssh2 vulnerabilities matter most for embedded devices?

As of 2026-11-16, start with CVE-2018-10933 if a product runs a server built on libssh 0.6 up to the 0.7.6 and 0.8.4 fixes: a client could skip authentication by sending a success message, and its EPSS score is 0.918. For libssh2, the nine CVEs fixed in 1.8.1 on 2019-03-18 (CVE-2019-3855 to CVE-2019-3863) let a malicious server corrupt client memory. In 2026, libssh2 1.11.1, the newest release, picked up new fixes such as CVE-2026-55200 that exist only as commits and distribution patches. None of these CVEs was in CISA's KEV catalog as of version 2026.11.13.

How do I find libssh or libssh2 and its version in a firmware image?

List the shared libraries in the unpacked root file system and look for libssh.so and libssh2.so files, then run readelf -d on programs to see which ones load them. Both libraries put their version in the SSH identification string they send by default, SSH-2.0-libssh_ followed by the libssh version or SSH-2.0-libssh2_ followed by the libssh2 version, so a strings search of the library or a statically linked binary usually finds it. Package records from OpenWrt, Buildroot or Yocto give the same version plus any CVE patches applied, which matter because a version alone cannot show a backport.

Is libssh2 affected by Terrapin (CVE-2023-48795)?

NVD lists libssh2 through 1.11.0 as affected, and libssh2 1.11.1 added strict key exchange to fix it. In practice the attack needs ChaCha20-Poly1305 or a CBC cipher with an encrypt-then-MAC MAC. libssh2 has no ChaCha20-Poly1305, and its encrypt-then-MAC support arrived in 1.11.0, so the Debian Security Tracker marks its libssh2 1.10.0 and older packages not affected because the needed algorithms are not present. A 1.11.0 build that offers CBC with -etm MACs is the case to fix.

Does SoftWSP find libssh and libssh2 in my firmware automatically?

SoftWSP's automated scan catalogs the software packages in an unpacked firmware file system with their versions and matches them against CVE records, CISA's KEV catalog and FIRST EPSS scores. AI then writes a plain-language summary that cites the component, version and record behind each finding, and an engineer reviews it. Whether a product actually builds the libssh server, which algorithms a device offers, whether it verifies host keys and whether a distribution or vendor patch already closes a matched CVE is part of that engineer review, not an automatic verdict.

Sources

  1. libssh: security advisories (index)
  2. libssh security advisory: CVE-2018-10933, authentication bypass in server code
  3. libssh security advisory: CVE-2023-2283, authorization bypass in pki_verify_data_signature
  4. libssh security advisory: CVE-2023-48795, prefix truncation (Terrapin)
  5. libssh security advisory: CVE-2026-15370, stack buffer overflow in the SFTP server
  6. libssh: 0.12.1 and 0.11.5 security releases (2026-07-21)
  7. libssh: 0.12.2 security release (2026-07-28)
  8. libssh2: project home page (capabilities, latest release)
  9. libssh2: changelog
  10. libssh2 security advisory: CVE-2019-3855
  11. libssh2 commit 97acf3d: additional boundary checks for packet length (CVE-2026-55200)
  12. libssh2 commit 42e33d8: fix potential heap overflow on ETM decrypt (CVE-2026-66035)
  13. Terrapin Attack (Ruhr University Bochum)
  14. Everything curl: build dependencies (SSH libraries)
  15. libcurl: CURLOPT_SSH_KNOWNHOSTS
  16. libcurl: CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256
  17. OpenWrt packages: libssh package Makefile
  18. OpenWrt packages: libssh2 package Makefile
  19. OpenWrt packages: libnetconf2 package Makefile
  20. Buildroot: libssh2 package (libssh2.mk)
  21. Buildroot: libssh package (libssh.mk and Config.in)
  22. OpenEmbedded-Core: libssh2 1.11.1 recipe
  23. Debian Security Tracker: CVE-2018-10933
  24. Debian Security Tracker: CVE-2019-3855
  25. Debian Security Tracker: CVE-2023-48795
  26. NIST NVD: CVE-2018-10933
  27. NIST NVD: CVE-2019-3855
  28. NIST NVD: CVE-2023-48795
  29. NIST NVD: CVE-2026-55200
  30. NIST NVD: CVE-2026-66035
  31. CISA: Known Exploited Vulnerabilities (KEV) Catalog
Was this guide helpful?

In this cluster

libssh and libssh2 vulnerabilities in embedded firmware: find the library, rank the CVEs, patch or backport