Severity by source
AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L
Attacker must control or MITM the SCP server, a non-trivial prerequisite warranting AC:H; all other metrics align with the advisory.
Primary rating from Vendor (https://github.com/sshnet/SSH.NET).
CVSS VectorVendor: https://github.com/sshnet/SSH.NET
Lifecycle Timeline
3DescriptionCVE.org
Summary
ScpClient.Download(string directoryName, DirectoryInfo directoryInfo) writes files and directories using names returned by the remote SCP server during recursive downloads, with no validation that the resulting path stays inside the requested local directory. A malicious, compromised, or man-in-the-middle SCP server can return names containing ../ sequences (or absolute paths), causing the client to create directories and write/overwrite files anywhere the client process has access. This is similar to OpenSSH CVE-2019-6111, but with directory traversal capability.
Impact
A malicious/compromised/MITM SCP server can create or write files outside the intended download directory, anywhere the client process can write. Overwriting files such as ~/.ssh/authorized_keys, shell rc files, cron entries, or application binaries/config can lead to persistence, privilege escalation, or remote code execution on the client host. Requires the victim to perform a directory download from the attacker-controlled server.
Remediation
The fixed release ensures that remotely-supplied file and directory names are valid local names such that the constructed local path is contained within the given local directory, and throws ScpException when an invalid name is detected.
AnalysisAI
Path traversal in SSH.NET's ScpClient.Download() enables a malicious, compromised, or man-in-the-middle SCP server to write arbitrary files anywhere the client process has write access during recursive directory downloads. All SSH.NET NuGet package versions up to and including 2025.1.0 are affected; the vulnerability is analogous to CVE-2019-6111 in OpenSSH but extends to directory traversal. No public exploit code or CISA KEV listing has been identified at time of analysis, though the integrity impact is high given the file-write primitive can overwrite SSH authorized keys, shell rc files, or application binaries.
Technical ContextAI
SSH.NET (nuget/SSH.NET) is a managed .NET library providing SSH, SCP, and SFTP client functionality. The affected code path is ScpClient.InternalDownload(), which processes SCP protocol 'C' (file) and 'D' (directory) records returned by the remote server. Prior to the fix, the library accepted the server-supplied filename verbatim and combined it with the local destination path using standard path-join semantics, without checking for CWE-22 (Improper Limitation of a Pathname to a Restricted Directory - 'Path Traversal'). A server could return a filename such as '../../../.ssh/authorized_keys' or an absolute path, and the client would write to that resolved location. The fix, introduced in commit 600be0de, adds a static EnsureValidLocalName() method that rejects any name that is empty, equals '.' or '..', or contains characters invalid in a local filename (including directory separators, which on Windows includes backslash - a legal Unix filename character that OpenSSH servers can transmit verbatim).
RemediationAI
Upgrade SSH.NET to version 2026.0.0, which includes the fix at commit 600be0de543765995a189b5d7cd4efac5007f3ce (https://github.com/sshnet/SSH.NET/commit/600be0de543765995a189b5d7cd4efac5007f3ce). This is confirmed as an upstream fix via the GitHub Security Advisory GHSA-q939-rpr3-3284. If an immediate upgrade is not feasible, a targeted workaround is to replace all uses of ScpClient.Download(string, DirectoryInfo) with SFTP-based downloads (SftpClient), which does not share the same unvalidated filename path - note this changes the protocol and may require server-side SFTP subsystem support. Alternatively, restrict which SCP servers the application is permitted to connect to via firewall or SSH known-hosts enforcement, reducing the MITM and malicious-server risk surface; this is a compensating control only and does not fix the underlying traversal flaw.
GNU Bash through 4.3 processes trailing strings after function definitions in the values of environment variables, which
GNU Bash through 4.3 bash43-026 does not properly parse function definitions in the values of environment variables, whi
GNU Bash through 4.3 bash43-025 processes trailing strings after certain malformed function definitions in the values of
freeSSHd.exe in freeSSHd through 1.2.6 allows remote attackers to bypass authentication via a crafted session, as demons
GNU Bash through 4.3 bash43-026 does not properly parse function definitions in the values of environment variables, whi
OpenSSH server (sshd) 9.1 introduced a double-free vulnerability during options.kex_algorithms handling. Rated medium se
sshd in OpenSSH before 7.3, when SHA256 or SHA512 are used for user password hashing, uses BLOWFISH hashing on a static
The kbdint_next_device function in auth2-chall.c in sshd in OpenSSH through 6.9 does not properly restrict the processin
The auth_password function in auth-passwd.c in sshd in OpenSSH before 7.3 does not limit password lengths for password a
Remote code execution in OpenSSH's sshd server (regression of CVE-2006-5051) allows unauthenticated remote attackers to
The SSH USERAUTH CHANGE REQUEST feature in SSH Tectia Server 6.0.4 through 6.0.20, 6.1.0 through 6.1.12, 6.2.0 through 6
A vulnerability was found in OpenSSH when the VerifyHostKeyDNS option is enabled. Rated medium severity (CVSS 6.8), this
Same weakness CWE-22 – Path Traversal
View allSame technique Privilege Escalation
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-60945
GHSA-q939-rpr3-3284