Skip to main content
Vulnerability Database/CVE-2026-94423

CVE-2026-94423: Net::LibSSH Authentication Bypass Vulnerability

CVE-2026-94423 is an authentication bypass flaw in Net::LibSSH for Perl that fails to verify host keys, allowing attackers to intercept credentials and data. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-94423 Overview

CVE-2026-94423 affects Net::LibSSH versions before 0.004 for Perl. The binding authenticates to unverified SSH servers because connect() never checks the host key against known_hosts. The strict_hostkeycheck and knownhosts options are passed to libssh but ssh_session_is_known_server() is never consulted, so any peer is accepted silently. Password, agent, and public-key authentication, plus channel and SFTP operations, all run on a session whose peer was never identified. An attacker able to redirect the connection receives the password when password authentication is used, along with any commands and data sent over the session. The weakness is classified as [CWE-322: Key Exchange without Entity Authentication].

Critical Impact

Any attacker positioned to intercept or redirect the SSH connection can silently proxy traffic, harvest credentials, and read or modify session data without triggering a host key warning.

Affected Products

  • Net::LibSSH for Perl versions prior to 0.004
  • Perl applications relying on Net::LibSSH::connect() with default strict_hostkeycheck
  • SFTP and remote command workflows built on top of the vulnerable binding

Discovery Timeline

  • 2026-10-21 - CVE-2026-94423 published to NVD
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2026-94423

Vulnerability Analysis

Net::LibSSH wraps the libssh C library and exposes a connect() method that applications use to establish SSH sessions. The binding treats a successful return from ssh_connect as proof that the session is safe to authenticate against. libssh deliberately delegates the host key check to the calling application through ssh_session_is_known_server(). The Perl binding never calls that function, so the strict_hostkeycheck and knownhosts options have no effect on the session outcome.

Because the server identity is never confirmed, every follow-on operation on the session, including password authentication, agent forwarding, public-key authentication, channel execution, and SFTP transfers, trusts a peer that was never validated. The weakness aligns with Missing Required Cryptographic Step and matches CWE-322 for Key Exchange without Entity Authentication.

Root Cause

The root cause is a missing host key verification call inside the connect() implementation. The binding exposes host key options at the API layer but never wires them to the underlying libssh verification routine. Applications written against the documented behavior assume strict checking is active when in fact the session is accepted unconditionally.

Attack Vector

An attacker who can redirect TCP traffic between the Perl client and the intended SSH server, through ARP spoofing, DNS poisoning, BGP hijacking, or a compromised network hop, can terminate the connection on an attacker-controlled host. The client completes the SSH handshake with the attacker, authenticates, and sends session traffic in clear view of the man-in-the-middle. When password authentication is used, the plaintext password is handed directly to the attacker.

text
+  - SECURITY: connect() now verifies the server host key against known_hosts
+    (CWE-322, reported privately via CPANSec). Previously
+    strict_hostkeycheck was passed to libssh but ssh_session_is_known_server()
+    was never consulted, so any server -- including a man-in-the-middle --
+    was accepted silently. With the default strict_hostkeycheck => 1,
+    connect() now returns 0 with error() naming the problem when the host key
+    is unknown, changed, of a different type, or known_hosts cannot be read;
+    the session is disconnected and stays spent.

Source: GitHub Commit Patch

Detect Identity Attacks the Moment Authentication Fails

Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.

Stop Identity Attacks

Detection Methods for CVE-2026-94423

Indicators of Compromise

  • Unexpected SSH sessions from Perl automation hosts to IP addresses not present in your inventory of managed SSH endpoints.
  • Successful SSH authentication events on hosts that cannot be correlated with a legitimate client fingerprint or source network path.
  • Perl processes loading Net::LibSSH at versions 0.001, 0.002, or 0.003 on production systems.
  • known_hosts files that remain empty or unchanged despite scripted SSH activity against new remote peers.

Detection Strategies

  • Inventory installed CPAN modules across managed systems and flag Net::LibSSH installations earlier than 0.004.
  • Monitor outbound SSH connections initiated by Perl interpreters and compare destinations against an allowlist of approved SSH targets.
  • Alert when SSH sessions complete authentication without a corresponding known_hosts entry update or lookup event on the client.

Monitoring Recommendations

  • Capture process-level telemetry for Perl invocations and record command-line arguments that reference SSH or SFTP targets.
  • Enable network flow logging between automation hosts and SSH destinations to retroactively identify redirected sessions.
  • Correlate authentication logs on target SSH servers with client-side session records to detect sessions that never reached the intended host.

How to Mitigate CVE-2026-94423

Immediate Actions Required

  • Upgrade Net::LibSSH to version 0.004 or later on every host running Perl SSH automation.
  • Populate known_hosts for all SSH destinations used by Perl clients, for example with ssh-keyscan, before resuming automated workflows.
  • Rotate any credentials, SSH keys, and API tokens that may have been transmitted over sessions established by vulnerable versions.
  • Audit source code for calls to Net::LibSSH::connect() and confirm that strict_hostkeycheck is left at its secure default.

Patch Information

The fix landed in Net::LibSSH0.004, available from CPAN. The patched connect() now calls ssh_session_is_known_server() and returns 0 with an error message when the host key is unknown, has changed, is of a different type, or known_hosts cannot be read. The session is disconnected and marked spent on failure. See the GitHub Commit Patch and the MetaCPAN Release Changes for full details, and the OpenWall OSS Security Discussion for public disclosure context.

Workarounds

  • Route Perl SSH automation through a trusted jump host whose connection to the final target is independently verified.
  • Prefer public-key authentication over password authentication to limit the credential exposure if a session is intercepted.
  • Isolate automation hosts on network segments where ARP spoofing and DNS redirection are constrained by switch and resolver controls.
bash
# Upgrade the vulnerable module and seed known_hosts for each target
cpanm Net::LibSSH@0.004
mkdir -p ~/.ssh && chmod 700 ~/.ssh
ssh-keyscan -H ssh.example.com >> ~/.ssh/known_hosts

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.