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-71312

CVE-2026-71312: OS Command Injection via Unicode Smart Quote Shell Bypass in rclone SFTP Backend

Amit Schendel
Amit Schendel
Senior Security Researcher

Aug 6, 2026·9 min read·1 visit

Executive Summary (TL;DR)

rclone versions prior to 1.75.0 are vulnerable to remote OS command injection when executing server-side hashing on Windows SFTP targets. Attackers can leverage Unicode smart quotes in file paths to bypass single-quote sanitization and execute arbitrary PowerShell commands.

An incomplete sanitization vulnerability exists in rclone's SFTP backend before version 1.75.0 when performing server-side hashing operations on Windows hosts. Due to PowerShell treating Unicode smart quotes as equivalent to ASCII single quotes, malicious file paths can escape command string delimiters and execute arbitrary commands on the remote system.

Vulnerability Overview

The rclone utility is a command-line application used to synchronize, transfer, and manage files across various storage providers. To minimize network resource usage during synchronization or validation phases, rclone supports server-side hashing operations within its SFTP backend (backend/sftp/sftp.go). This optimization operates by establishing an SSH connection and running diagnostic command-line utilities directly on the remote SFTP host rather than downloading entire files to perform hashing locally.

Because the commands are constructed on the client and executed on the remote system, the names of files and directories must be safely formatted as command-line arguments. This interaction exposes an attack surface where file path data acts as input to the shell interpreter running on the remote host. If an attacker can manipulate files in an SFTP repository, they can introduce malicious input that alters the structure of the executed shell command.

The vulnerability, tracked as CVE-2026-71312, belongs to the OS Command Injection class (CWE-78). It arises due to a character-set sanitization mismatch between rclone's Go-based validation routines and the Windows PowerShell interpreter. In environments where the remote SFTP host runs Windows and executes commands via PowerShell, an attacker can bypass standard sanitization routines to achieve unauthenticated remote code execution within the context of the active SSH user session.

Root Cause Analysis

To understand the root cause of CVE-2026-71312, one must analyze how rclone handles paths for PowerShell environments. When configuring remote calls, the SFTP backend relies on a validation helper function named quoteOrEscapeShellPath to sanitize path strings. Prior to the fix in version 1.75.0, this function sanitized PowerShell arguments by wrapping the entire path inside ASCII single-quote (') delimiters and doubling any literal ASCII single-quote characters present in the file name.

While doubling an ASCII single quote is the correct escaping syntax for PowerShell string literals, the sanitization mechanism assumed that the standard single quote was the only character capable of terminating a single-quoted string literal. This assumption is incorrect when targeting a Windows PowerShell interpreter. The PowerShell lexer is designed to recognize and support several Unicode smart quote characters as syntactically identical to the ASCII single quote.

These Unicode smart quotes include the Left Single Quotation Mark (‘, U+2018), the Right Single Quotation Mark (’, U+2019), the Single Low-9 Quotation Mark (‚, U+201a), and the Single High-Reversed-9 Quotation Mark (‛, U+201b). Because the vulnerable version of rclone only neutralized the standard ASCII single quote, filenames containing any of these Unicode smart quotes were forwarded to the remote host without modification or escaping.

When the remote Windows host processed the constructed command, the PowerShell lexer matched the leading ASCII single quote delimiter with the first occurrence of a Unicode smart quote in the file path. The lexer interpreted the smart quote as the closing boundary of the string literal, while all subsequent characters in the filename were parsed as live, executable PowerShell code rather than static string content. This parsing behavior allows an attacker to completely escape the string literal and inject arbitrary shell statements.

Code Analysis & Patch Review

The core vulnerability resides within backend/sftp/sftp.go. The original sanitization routine was implemented using simple string substitution for ASCII single quotes. The following code comparison highlights the vulnerability and the subsequent fix introduced in version 1.75.0.

// Vulnerable implementation in rclone < 1.75.0
func quoteOrEscapeShellPath(shellType string, shellPath string) (string, error) {
	// PowerShell
	if shellType == "powershell" {
		return "'" + strings.ReplaceAll(shellPath, "'", "''") + "'", nil
	}
	// ...
}

In this vulnerable implementation, strings.ReplaceAll only targets the ASCII single quote ('). The Unicode characters U+2018, U+2019, U+201a, and U+201b are left unchanged inside shellPath. To remediate this issue, the maintainers defined a dedicated multi-character replacer using Go's strings.NewReplacer to target all five characters.

// Patched implementation in rclone 1.75.0
var powerShellQuoteEscaper = strings.NewReplacer(
	"'", "''",
	"‘", "‘‘",
	"’", "’’",
	"‚", "‚‚",
	"‛", "‛‛",
)
 
func quoteOrEscapeShellPath(shellType string, shellPath string) (string, error) {
	// PowerShell
	if shellType == "powershell" {
		return "'" + powerShellQuoteEscaper.Replace(shellPath) + "'", nil
	}
	// ...
}

By leveraging strings.NewReplacer, the updated function ensures that if any of the five quote characters are detected inside the path, they are doubled. In PowerShell, doubling a delimiter acts as a literal escape sequence, preserving the character within the string boundary without terminating the string. This implementation effectively prevents command breakout via the PowerShell lexer.

While this fix is complete for single-quoted contexts, developers should remain aware of potential Unicode normalization layers. If a Windows host performs 'Best-Fit' character mappings or unicode normalization (e.g., NFC/NFD transformations) after receiving the arguments, other characters might be converted into quotes. Furthermore, if double-quoted strings are ever used in adjacent command constructions, a similar vulnerability could arise involving smart double quotes such as “ (U+201C) and ” (U+201D), which must be neutralized similarly.

Exploitation Methodology

To exploit CVE-2026-71312, an attacker requires write privileges on the remote SFTP share and must wait for, or induce, the victim to execute an rclone operation that triggers server-side hashing on that directory. The primary technical prerequisite is that the target SFTP server must reside on a Windows operating system that uses PowerShell as its default shell for executing SSH terminal commands.

The attack begins with the construction of a malicious filename containing a Unicode smart quote followed by the command payload. For example, the attacker can use the Right Single Quotation Mark (’, U+2019) to terminate the path and inject a secondary command separated by a semicolon. The final character in the filename is typically a comment delimiter (#) to discard any residual syntax added by rclone.

file’; calc; #.txt

When the victim runs a verification command like rclone hash md5 sftp:dir/, the utility generates the following remote execution command:

Get-FileHash 'dir/file’; calc; #.txt' -Algorithm MD5

When the command string reaches the remote host, PowerShell parses it sequentially. The parser treats the segment 'dir/file’ as a complete, single-quoted string because the smart quote terminates the string started by the ASCII apostrophe. The semicolon (;) is evaluated as a statement separator, and the secondary command calc is executed immediately. The trailing hash character (#) instructs the parser to ignore the rest of the command, suppressing syntax errors that would otherwise prevent execution.

Impact Assessment

The successful exploitation of CVE-2026-71312 leads directly to arbitrary command execution on the target Windows system. The impact of this command execution depends on the configuration of the remote SSH server and the access control permissions of the user account running the SFTP daemon. In standard configurations, commands are executed with the security privileges of the logged-in SSH user.

If the SSH session runs under an administrative context, the attacker can achieve complete compromise of the system. This allows for arbitrary file deletion, modification of system binaries, installation of persistent backdoors, and lateral movement within the network. Even in lower-privileged contexts, an attacker can access sensitive local resources, read confidential files accessible to that user account, and disrupt service availability.

The CVSS v3.1 score is calculated as 8.0 (High Severity) with the vector CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H. The attack vector is classified as Network, as the initial vector is delivered via a remote file upload. Attack complexity is Low since there are no specialized conditions or random variables in the parsing mechanism. Privileges Required is Low because any valid user account with write access to the SFTP share can plant the malicious file name. User Interaction is Required because the payload remains inert until an administrative or automated tool executes a server-side hashing command.

Remediation & Detection Guidance

The primary remediation path is upgrading the rclone client to version 1.75.0 or later. This update modifies the command-building engine to escape the complete set of five PowerShell-compatible single-quote characters, neutralizing any breakout attempts at the client level.

If upgrading rclone is not immediately possible, administrators can apply several server-side workarounds to mitigate the risk:

  • Change Remote Default Shell: Reconfigure the SSH server on the remote Windows host to use standard Command Prompt (cmd.exe) or a bash-compatible shell instead of PowerShell as the default shell for interactive commands.
  • Disable Server-Side Hash Operations: Avoid executing commands such as rclone hash, rclone check, or rclone sync with server-side hashing flags against untrusted Windows-based SFTP remotes.
  • Input Validation on SFTP Server: Implement file-name filters or sanitization policies directly on the SFTP server software to block the creation or upload of filenames containing non-ASCII Unicode characters, especially those in the U+2018 to U+201B range.

For detection, security teams should look for process creation events (Windows Security Event ID 4688) or PowerShell command logs (Event ID 4104) containing unusual path arguments. Suspicious patterns include command lines referencing Get-FileHash or file execution paths that combine Unicode smart quotes with command separators (;, &, |) and comment characters (#). Additionally, monitor for child processes of the SSH service spawning shell environments to run administrative binaries or external network tools.

Official Patches

rcloneOfficial patch implementing multi-character replacement for PowerShell
rcloneRelease notes for rclone v1.75.0 containing the fix

Fix Analysis (1)

Technical Appendix

CVSS Score
8.0/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

Affected Systems

rclone installations prior to version 1.75.0 interacting with Windows-based SFTP servers using PowerShell

Affected Versions Detail

Product
Affected Versions
Fixed Version
rclone
rclone
< 1.75.01.75.0
AttributeDetail
CWE IDCWE-78
Attack VectorNetwork (AV:N)
CVSS v3.1 Score8.0
Exploit StatusPoC / Theoretical
CISA KEV StatusNot Listed
ImpactRemote Command Execution (RCE)
RemediationUpgrade to v1.75.0 or higher

MITRE ATT&CK Mapping

T1059.001PowerShell
Execution
T1190Exploit Public-Facing Application
Initial Access
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

The software constructs an OS command using externally-influenced input, but does not neutralize or incorrectly neutralizes special elements that can modify the intended OS command.

Known Exploits & Detection

GitHub Security AdvisoryDetails on the Unicode smart quote bypass in quoteOrEscapeShellPath

Vulnerability Timeline

Fix authored and committed to rclone repository
2026-07-14
rclone v1.75.0 released containing the fix
2026-08-05
GitHub Security Advisory GHSA-2m8m-jhrm-w6j2 published
2026-08-05
CVE-2026-71312 published to NVD and CVE databases
2026-08-05

References & Sources

  • [1]GHSA-2m8m-jhrm-w6j2
  • [2]Fix Commit e122fba
  • [3]rclone v1.75.0 Release
  • [4]CVE-2026-71312 Record

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

•16 minutes ago•GHSA-H4MF-4V27-HGGJ
7.4

GHSA-H4MF-4V27-HGGJ: WebDAV Credential Disclosure via Same-Host HTTPS-to-HTTP Redirect in rclone

A protocol downgrade vulnerability in rclone's WebDAV backend allows sensitive credentials, cookies, and authentication headers to be transmitted in cleartext. This occurs when a remote server redirects an HTTPS request to a plaintext HTTP URL on the same host, which the Go HTTP client default behavior permits without checking the protocol transport layer. This report provides a detailed technical analysis of the root cause, exploit mechanics, patch diff, and remediation strategies.

Amit Schendel
Amit Schendel
0 views•7 min read
•about 2 hours ago•CVE-2026-59733
8.8

CVE-2026-59733: Path Traversal and Authorization Bypass in Rclone serve restic

A critical path traversal and authorization bypass vulnerability exists in the rclone serve restic command when multi-user isolation is enabled using the --private-repos flag. Due to a middleware desynchronization flaw, authenticated users can access, modify, or delete backup repositories belonging to other tenants.

Alon Barad
Alon Barad
1 views•5 min read
•about 3 hours ago•GHSA-GX4C-2HQX-CW2R
3.1

GHSA-gx4c-2hqx-cw2r: Cleartext Transmission of Sensitive AWS STS Tokens in rclone S3 Backend via Scheme Downgrade Redirects

A logic vulnerability in the rclone S3 backend implementation allows an unauthenticated adjacent-network attacker to intercept temporary AWS STS credentials. During HTTP redirection handling, the application fails to verify whether a protocol scheme change occurred (such as transitioning from HTTPS to HTTP). If a secure request is redirected to an unencrypted endpoint on the same host, rclone continues to forward the highly sensitive X-Amz-Security-Token header in cleartext.

Amit Schendel
Amit Schendel
2 views•6 min read
•about 4 hours ago•CVE-2025-15366
5.9

CVE-2025-15366: Protocol Command Injection in Python CPython imaplib Standard Library

CVE-2025-15366 is a command injection vulnerability in Python's standard imaplib module, occurring due to the improper neutralization of carriage returns (\r), line feeds (\n), and null bytes (\x00). When an application passes user-controlled input into standard IMAP library calls, an attacker can break out of the line-oriented protocol context and execute arbitrary IMAP directives with the privileges of the authenticated session.

Amit Schendel
Amit Schendel
8 views•7 min read
•about 4 hours ago•CVE-2026-59732
5.0

CVE-2026-59732: Path Traversal (Zip Slip) Vulnerability in rclone archive extract

A path traversal vulnerability (Zip Slip variant) exists in rclone's archive extract functionality before version 1.74.4. The command fails to sanitize relative directory components in archive headers, allowing files to be written outside the target directory or cloud prefix. This issue can result in arbitrary file writes or cloud object overwrites depending on the permissions of the credentials used. Nick Craig-Wood authored the patch on June 29, 2026, which was released in version 1.74.4 on July 14, 2026. This vulnerability is assigned CVE-2026-59732 and is cataloged as GHSA-4vr5-p2gc-h23p. This report provides a detailed root cause analysis, code-level diff, and remediation steps.

Amit Schendel
Amit Schendel
2 views•8 min read
•about 5 hours ago•CVE-2026-71313
6.9

CVE-2026-71313: Local Directory Traversal in rclone via Unsafe Encoding Configurations

A local encoding path traversal vulnerability exists in rclone versions from v1.51.0 up to v1.75.0. When non-default local encoding parameters (such as Slash, None, or Raw) are specified, rclone's standard decoder maps safely encoded fullwidth dot-dot characters back into native directory traversal components. Since the local backend historically lacked a post-resolution path containment check, these relative segments resolved outside the designated synchronization root, allowing arbitrary file creation and modification on the host system.

Amit Schendel
Amit Schendel
4 views•7 min read