CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-59995

CVE-2026-59995: Relative Path Traversal in OpenSSH sftp Client

Amit Schendel
Amit Schendel
Senior Security Researcher

Aug 21, 2026·6 min read·3 visits

Executive Summary (TL;DR)

OpenSSH sftp clients prior to 10.4 are vulnerable to relative path traversal, allowing a compromised SFTP server to write arbitrary files on the client system during command-line downloads.

A relative path traversal vulnerability (CWE-23) in the client-side sftp utility of OpenSSH before version 10.4 allows malicious or compromised SFTP servers to write or overwrite files outside the intended destination directory when a user executes a direct one-shot download command.

Vulnerability Overview

The client-side sftp(1) tool provided by OpenSSH is widely utilized for secure file transfers over SSH. In configurations where a user invokes a direct, one-shot download command utilizing the specific syntax sftp server:/path ., the sftp client establishes a connection to the specified remote server, retrieves target files, and writes them locally. This operation creates an implicit trust relationship regarding the filenames returned by the remote entity.

Historically, the client application failed to adequately validate and sanitize file paths returned by remote endpoints. If an attacker controls or compromises the target SFTP server, they can manipulate the SFTP protocol responses to dictate exactly where the files are written on the local client host. This vulnerability belongs to the Relative Path Traversal class (CWE-23).

The vulnerability is constrained primarily by the privileges of the local user running the sftp command. Because the issue occurs within the client-side filename parser, standard server-side configurations do not mitigate the flaw. Users utilizing interactive SFTP sessions or automated scripts targeting unvetted remote hosts are particularly exposed.

Root Cause Analysis

During a typical SFTP session, name resolution and directory listings are handled via protocol-specific packets. When the client executes a one-shot transfer command, it sends a request for the remote file path. The server processes this request and responds with file attributes and filenames using SSH2_FXP_NAME packets. These packets contain the metadata that the client uses to write files to the local disk.

The critical bug resides in how the sftp(1) client processes the filenames extracted from these packets. The client constructs the target write path by appending the remote-provided filename to the user-supplied local target directory, which is typically the current working directory (.). Before the release of OpenSSH 10.4, the client failed to sanitize relative directory traversal components (such as ../) present within the filenames returned by the server.

Consequently, the local destination path is calculated using simple string concatenation without canonicalization checks. If the server returns a filename structured as ../../.ssh/authorized_keys, the client resolves the local path to ./../../.ssh/authorized_keys. This calculation forces the file creation routine to traverse outside of the intended target directory and write to arbitrary locations within the boundaries of the executing user's filesystem permissions.

Code Analysis and Technical Mitigation

A review of the vulnerable path-generation logic indicates that the sftp client handled remote filename parsing directly within the remote file download loops. Below is a structural representation of the vulnerable filename handling logic compared to the hardened validation implemented in version 10.4.

// Vulnerable logic pattern in sftp-client.c before OpenSSH 10.4
char *local_path;
char *remote_filename = get_filename_from_packet(payload);
 
// Naive concatenation of the local destination and the remote filename
local_path = path_append(destination_directory, remote_filename);
 
// Opens the file path directly, traversing parent directories if present in remote_filename
int file_descriptor = open(local_path, O_WRONLY | O_CREAT | O_TRUNC, 0600);

To correct this security flaw, OpenSSH 10.4 introduced a path sanitization routine. This routine strips relative path sequences and prevents the local sftp client from executing path operations outside the designated root directory of the download request. If directory traversal sequences are identified, the operation is rejected before file descriptors are opened.

// Hardened validation pattern in sftp-client.c in OpenSSH 10.4
char *local_path;
char *remote_filename = get_filename_from_packet(payload);
 
// New verification step to prevent path traversal
if (has_directory_traversal(remote_filename)) {
    fatal("Security violation: remote server returned invalid filename '%s'", remote_filename);
    cleanup_and_exit(1);
}
 
// Safely concatenate after validation passes
local_path = path_append(destination_directory, remote_filename);

The fix is robust because it prevents the path resolution mechanism from executing if any path component attempts to go up the directory tree relative to the target location. This completely eliminates the threat vectors utilizing relative directory sequences via SFTP client downloads.

Exploitation Methodology

Exploiting CVE-2026-59995 requires a specific sequence of actions and conditions. First, the attacker must configure or compromise an SFTP server to serve modified file metadata. Standard SFTP daemons will not perform path traversal attacks of this nature; therefore, a custom or patched daemon is necessary to inject traversal payloads inside the SSH2_FXP_NAME protocol packets.

Next, the attacker must entice a target user into initiating a file transfer utilizing the one-shot syntax. This is typically achieved via social engineering, phishing, or modified documentation guides directing the victim to run a command such as:

sftp attacker-controlled-server:/files/manual.pdf .

When the victim executes this command, the rogue server responds with the file payload but specifies the filename as ../../.bashrc or ../../.ssh/authorized_keys. The vulnerable sftp client translates this path relative to the active target directory (.), executing the write outside the expected parameters. If the command is executed within a user's home directory, files such as shell profile configurations can be overwritten, leading to persistent code execution upon subsequent shell interactive logins.

Impact Assessment

The National Vulnerability Database evaluates this vulnerability with a CVSS 3.1 base score of 4.2 (Medium). This severity rating represents the combination of a remote attack vector with a high attack complexity and mandatory user interaction. The scope of the vulnerability is unchanged because the impact does not cross to separate virtualized security boundaries beyond the local system execution layer.

The integrity impact is assessed as low because file creation and manipulation are strictly bounded by the filesystem permissions of the local user running the sftp command. An attacker cannot overwrite root-level configuration files (such as /etc/passwd or /etc/shadow) unless the victim executes the vulnerable client session with superuser privileges.

However, in typical developer and administrator environments, local user privileges are sufficient to achieve persistence. Overwriting user-level startup scripts (.profile, .bashrc) or appending keys to .ssh/authorized_keys allows complete user-level compromise. The EPSS score currently sits at 0.0025, which reflects a low current threat profile in the wild, and the vulnerability is not currently tracked on the CISA KEV list.

Remediation and Mitigation Guidance

The primary remediation strategy is upgrading the client-side OpenSSH suite to version 10.4 or higher. Operating system packages should be updated using local package distribution managers to ensure the binary is patched.

For systems where immediate upgrades are not possible, several configuration-based and operational workarounds can minimize the exposure surface. Users must refrain from utilizing the command-line format that maps remote files directly to the current directory (sftp server:file .). Instead, interactive sftp shell sessions should be used, where the target location is verified or controlled through specific interactive subcommands.

Additionally, automate SFTP workflows inside isolated directories that do not contain sensitive system configuration files. Restricting outbound SSH/SFTP access at the host firewall layer can ensure that client systems only initiate transfer sessions with trusted corporate servers, effectively blocking attempts to connect with untrusted, malicious remote infrastructure.

Technical Appendix

CVSS Score
4.2/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:L
EPSS Probability
0.25%
Top 83% most exploited

Affected Systems

OpenSSH sftp client prior to version 10.4

Affected Versions Detail

Product
Affected Versions
Fixed Version
OpenSSH sftp
OpenBSD
< 10.410.4
AttributeDetail
CWE IDCWE-23
Attack VectorNetwork
CVSS Score4.2 (Medium)
EPSS Score0.0025 (16.73%)
ImpactLow Integrity, Low Availability
Exploit StatusNone
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1203Exploitation for Client Execution
Execution
T1566.002Phishing: Spearphishing Link
Initial Access
T1565.001Data Manipulation: Stored Data Manipulation
Impact
T1485Data Destruction
Impact
CWE-23
Relative Path Traversal

The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize relative path sequences such as '../' that can resolve to a location outside of the directory.

Vulnerability Timeline

OpenSSH 10.4 is officially released, fixing the sftp(1) relative path traversal vulnerability.
2026-07-06
Public announcement published on the oss-security mailing list by Damien Miller.
2026-07-06
CVE-2026-59995 is officially published and assigned by the MITRE Corporation.
2026-07-08
Google Open Source Vulnerabilities (OSV) database records modified.
2026-08-14

References & Sources

  • [1]NVD CVE-2026-59995 Details
  • [2]CVE.org Record
  • [3]OpenSSH 10.4 Official Release Notes
  • [4]oss-security Mailing List Release Announcement
  • [5]OpenSSH UNIX Dev Mailing List Archive
  • [6]Wiz Vulnerability Database Profile
  • [7]OSV JSON Entry

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 2 hours ago•GHSA-RXHG-VCWW-2MPW
8.1

GHSA-RXHG-VCWW-2MPW: SQL Injection via ORDER BY Column Injection in Fleet Activity List Endpoints

A SQL injection vulnerability exists in the activity list endpoints of Fleet Device Management. Authenticated users can manipulate the order_key parameter to sort database queries by arbitrary columns, including columns not projected in the SELECT query. This flaw allows attackers to establish an inference oracle to extract sensitive information from the database.

Amit Schendel
Amit Schendel
3 views•5 min read
•about 5 hours ago•GHSA-7MPF-4465-7FC2
2.0

GHSA-7mpf-4465-7fc2: Stored Cross-Site Scripting in Winter CMS Backend List Widget

A Stored Cross-Site Scripting (XSS) vulnerability exists in the Backend List widget of Winter CMS (winter/wn-backend-module). When a list column is configured with the 'image' type and displays attacker-controlled input, the lack of sanitization in the image URL allows injection of arbitrary HTML attributes, potentially executing malicious scripts in the session of administrators viewing the list.

Amit Schendel
Amit Schendel
2 views•5 min read
•about 6 hours ago•GHSA-MPMW-F6H6-3G26
4.3

GHSA-mpmw-f6h6-3g26: Insecure Direct Object Reference in Winter CMS My Account Controller

An Insecure Direct Object Reference (IDOR) vulnerability was identified in Winter CMS version 1.2.13. The vulnerability exists within the newly introduced Backend\Controllers\MyAccount controller, which utilizes the FormController behavior without appropriate model query scoping or routing controls. This allows authenticated, low-privilege backend users to retrieve sensitive personal and administrative data of other backend accounts by enumerating record identifiers via standard CRUD routes.

Amit Schendel
Amit Schendel
3 views•5 min read
•about 7 hours ago•GHSA-FM29-4MQ3-PHG6
8.1

GHSA-FM29-4MQ3-PHG6: Missing Authorization in Winter CMS ImportExportController Behavior

Winter CMS contains an authorization bypass vulnerability within its ImportExportController behavior. Due to a design flaw in the request lifecycle processing, permissions configured for data import and export operations are not validated during AJAX-based requests, allowing authenticated users with limited privileges to perform unauthorized data exfiltration or database manipulation.

Alon Barad
Alon Barad
4 views•5 min read
•about 8 hours ago•GHSA-5CWR-5JXG-PCF6
8.4

GHSA-5CWR-5JXG-PCF6: Stored Cross-Site Scripting via Improper Cache Sanitization in Winter CMS Custom Styles

Winter CMS versions prior to 1.2.14 are vulnerable to Stored Cross-Site Scripting (XSS) within the administrative backend interface. The flaw resides in the custom styles rendering pipeline for Brand Settings and Editor Settings. An attacker with privileges to modify backend branding or editor configurations can inject arbitrary JavaScript, which is written to the cache without sanitization. Subsequent page requests that result in a cache hit completely bypass output sanitization filters, leading to JavaScript execution in the sessions of other administrative users.

Amit Schendel
Amit Schendel
5 views•6 min read
•about 9 hours ago•GHSA-P2CH-C2C3-4XM5
8.8

GHSA-P2CH-C2C3-4XM5: Cross-Site Request Forgery in Winter CMS AJAX Routing

Winter CMS contains a routing bypass vulnerability that allows Cross-Site Request Forgery (CSRF) attacks to trigger administrative AJAX handlers. Due to case-insensitivity in PHP's method resolution and an insufficiently strict check in the backend controller system, an attacker can invoke these handler methods through lowercase HTTP GET requests, bypassing default CSRF token validation.

Amit Schendel
Amit Schendel
4 views•4 min read