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 where an insecure default configuration on Windows allows unprivileged local users to 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 quietly gave every unprivileged Windows user the ability to hijack SSH connections made by any application on the same machine. CVE-2025-14821, scored at CVSS 7.8, demonstrates 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.

The libssh library provides a programmable SSH2 implementation used by developers to embed secure shell functionality into applications. Its adoption footprint is significant: GitHub uses libssh to power its git SSH infrastructure (serving millions of daily requests), KDE integrates 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 systems, libssh defaults to loading its configuration from the C:\etc directory. This is a direct carry over from Unix conventions, where /etc is a system owned directory protected by strict file permissions. The critical distinction on Windows is that the root of the C: drive typically permits standard, unprivileged users to create new directories when they do not already exist.

Attack Flow

The exploitation path is straightforward and requires no sophisticated tooling:

  1. Directory creation: An unprivileged local user identifies that the C:\etc directory does not exist on the target Windows system, or that it exists with permissive ACLs. The attacker creates C:\etc if necessary.

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

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

  4. Trusted host manipulation: Through the malicious configuration, the attacker can alter the known hosts database or redirect host key verification, causing the victim application to trust attacker controlled endpoints.

  5. Security downgrade: The configuration can force weaker cryptographic algorithms or disable security features on SSH connections, making interception and decryption feasible.

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

Why This Matters

The simplicity of this attack is what makes it noteworthy. There is no memory corruption, no race condition, and no complex exploit chain involved. The entire vulnerability hinges on a platform assumption: that the configuration directory is protected by the operating system. On Unix, /etc is owned by root and writable only by privileged users. On Windows, C:\etc has no such inherent protection.

This affects all three pillars of the CIA triad. Confidentiality is compromised through interception of SSH traffic. Integrity is undermined by the ability to modify trusted host keys and connection parameters. Availability can be impacted through denial of service via malformed configurations that cause connection failures.

Affected Systems and Versions

The vulnerability affects libssh installations on Windows systems running versions prior to the security releases. Specifically:

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

The vulnerability is specific to Windows deployments. Unix and Linux systems are not affected 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, including applications that may not be obviously SSH related but use libssh as a dependency for secure communications.

Vendor Security History

The libssh maintainers have demonstrated a proactive security posture. The February 10, 2026 security release that addressed CVE-2025-14821 also resolved multiple other vulnerabilities concurrently, including SCP protocol path traversal issues and buffer underflow conditions. The breadth of fixes in a single coordinated release suggests the team conducted a broader internal security audit rather than addressing only the reported issue. This pattern of concurrent, multi class vulnerability resolution is a positive indicator of the project's security maturity.

References

Detect & fix
what others miss

Security magnifying glass visualization