Automated Threat Modeling

Brief Summary: libssh CVE-2025-14821 Insecure Default Configuration Enables Local Man in the Middle Attacks on Windows

A short review of CVE-2025-14821, a high-severity flaw in libssh. On Windows, an insecure default configuration lets unprivileged local users hijack SSH connections by planting malicious configuration files in the C:\etc directory.

CVE Analysis

5 min read

ZeroPath CVE Analysis
ZeroPath CVE Analysis

2026-04-07

Brief Summary: libssh CVE-2025-14821 Insecure Default Configuration Enables Local Man in the Middle Attacks on Windows
Experimental AI-Generated Content

This CVE analysis is an experimental publication that is completely AI-generated. The content may contain errors or inaccuracies and is subject to change as more information becomes available. We are continuously refining our process.

If you have feedback, questions, or notice any errors, please reach out to us.

[email protected]

Introduction

An insecure default configuration in the libssh library let every unprivileged Windows user hijack SSH connections made by any application on the same machine. CVE-2025-14821, scored at CVSS 7.8, shows how a Unix directory convention, ported to Windows without adjusting for the platform's permission model, can turn a configuration file path into a full local man-in-the-middle attack vector.

libssh is a programmable SSH2 implementation that developers use to embed secure shell functionality in applications. It is widely deployed. GitHub uses it to power its git SSH infrastructure, which serves millions of requests a day. KDE uses it for SFTP file transfers, and Cockpit relies on it for SSH public key authentication across bastion hosts. Any Windows deployment embedding libssh was potentially affected.

Technical Information

The root cause of CVE-2025-14821 falls under CWE-427 (Uncontrolled Search Path Element). On Windows, libssh loads its configuration from the C:\etc directory by default. The path is a direct carry-over from Unix, where /etc is a system-owned directory protected by strict file permissions. Windows is different: the root of the C: drive typically lets standard, unprivileged users create new directories that do not already exist.

Attack Flow

Exploitation is straightforward and needs no sophisticated tooling.

  1. An unprivileged local user finds that C:\etc does not exist on the target Windows system, or that it exists with permissive ACLs. If necessary, the attacker creates C:\etc.

  2. The attacker places a crafted libssh configuration file in C:\etc. The file can specify custom trusted host keys, preferred cipher suites, proxy commands, or other SSH parameters.

  3. When any application on the system that embeds libssh initializes an SSH connection, the library automatically reads and applies the attacker-controlled configuration during startup.

  4. Through that configuration, the attacker can alter the known hosts database or redirect host key verification, so the victim application trusts attacker-controlled endpoints.

  5. The configuration can also force weaker cryptographic algorithms or disable security features on SSH connections, which makes interception and decryption feasible.

  6. With connections redirected or cryptography weakened, the attacker can intercept, read, and potentially modify SSH traffic in transit.

Why This Matters

What makes this attack noteworthy is how simple it is. It involves no memory corruption, race condition, or complex exploit chain. The whole vulnerability rests on one platform assumption, which is that the operating system protects the configuration directory. On Unix, /etc is owned by root and writable only by privileged users. On Windows, C:\etc has no such inherent protection.

The flaw touches all three parts of the CIA triad. An attacker who intercepts SSH traffic breaks confidentiality. The ability to modify trusted host keys and connection parameters undermines integrity. A malformed configuration that causes connection failures can deny service, which hurts availability.

Affected Systems and Versions

The vulnerability affects libssh installations on Windows running versions earlier than the security releases:

ComponentVulnerable VersionsPatched VersionRelease Date
libssh stable branchVersions prior to 0.11.40.11.4February 10, 2026
libssh new release branchVersions prior to 0.12.00.12.0February 10, 2026

Only Windows deployments are affected. Unix and Linux systems are not, because /etc is a system-protected directory by default. Any Windows application that links against or bundles a vulnerable version of libssh is potentially exposed. That includes applications that may not look SSH-related but use libssh as a dependency for secure communications.

Vendor Security History

The libssh maintainers have shown a proactive approach to security. The February 10, 2026 security release that fixed CVE-2025-14821 also fixed several other vulnerabilities, including SCP protocol path traversal issues and buffer underflow conditions. That many fixes in one coordinated release suggests the team ran a broader internal security audit instead of patching only the reported issue. Fixing several classes of vulnerability at once is a good sign of the project's security maturity.

References

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization