Net::LibSSH for Perl: Missing server host key verification in connect
Summary
Net::LibSSH for Perl did not check the SSH server host key against known_hosts when connecting, so the strict_hostkeycheck and knownhosts settings had no effect. An attacker who can redirect or intercept the connection can impersonate the server and receive the password if password authentication is used, as well as commands and data sent over the session. Exploitation requires a network position between client and server, but no authentication.
Affected
- Net-LibSSH (CPAN) versions before 0.004
Fixed in
- Net-LibSSH 0.004 (released 2026-09-20)
Workaround
Unknown. The vendor documents no workaround; the upgrade is the only documented fix. Do not use strict_hostkeycheck => 0 as a workaround, because it disables the host key check entirely.
Exploitation
- No exploitation observed and no public proof of concept found at the time of research.
- CISA SSVC assessment: exploitation none, automatable yes, technical impact total.
- Positive Technologies rates the issue 5.8 (Medium).
Our recommendation
- Upgrade Net-LibSSH to 0.004 or later, and upgrade Rex-LibSSH to 0.004 where it is used.
- Identify in-house Perl scripts and Rex automation that use Net::LibSSH.
- Before upgrading, add the target servers' host keys to known_hosts, because connections to unknown hosts will now fail.
- Until the upgrade is done, limit these SSH connections to networks you control and verify host keys out of band.
Public exploits
PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.
Research sources
- Net-LibSSH 0.004 changes (MetaCPAN) metacpan.org
- Fix commit 29f509aa (patch) github.com
- Net-LibSSH 0.004 release (GitHub) github.com
- CPAN Security Group advisory (oss-sec) seclists.org
- Rex-LibSSH 0.004 (MetaCPAN) metacpan.org
- Rex-LibSSH 0.004 release (GitHub) github.com
- CVE record summary (OpenCVE) app.opencve.io
- Positive Technologies assessment (Vulners) vulners.com
Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 31 Oct 2026, 05:34.
Original description (NVD)
Net::LibSSH versions before 0.004 for Perl authenticate to an unverified server because connect never checks the host key against known_hosts. connect reports success as soon as ssh_connect returns SSH_OK. libssh leaves the known-hosts check to the application, and this binding never makes it, so the strict_hostkeycheck and knownhosts options are set on the session and then decide nothing. Password, agent and public-key authentication, channel and SFTP operations all run on a session whose peer was never identified, so an attacker who can redirect the connection receives the password when password authentication is used, and commands and data sent over the session.
Sources
The tracker combines official, freely usable data sources – updated continuously:
- NVD (NIST) – CVEs, rating (CVSS), affected products
- CISA KEV – vulnerabilities confirmed by CISA as actively exploited
- CISA Vulnrichment – CISA assessment (SSVC) in the official CVE record
- FIRST EPSS – probability of exploitation
- Microsoft MSRC – Patch Tuesday: vulnerabilities, severity, updates
- PoC-in-GitHub – public proof-of-concept repositories
- Metasploit (Rapid7) – modules of the Metasploit Framework
- Exploit-DB (OffSec) – archive of public exploits (links only)
- Patch days: official vendor pages (linked per vendor) (Vendor patch days)
This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.
Affected? We can help.
We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.
