github.com/rclone/rclone
Affected
- introduced
0, fixed1.75.0(semver)
Fixed versions
1.75.0
Fix
- Fixed version
1.75.0go get github.com/rclone/[email protected]
Advisory
Also known as: BIT-rclone-2026-71312, CVE-2026-71312, GO-2026-6182
rclone: PowerShell Smart-Quote Filename Injection Enables SFTP Server-Side Command Execution
1. Summary
rclone interpolates remote SFTP paths into PowerShell hash commands. Its quoting helper escapes only ASCII apostrophe, although PowerShell accepts four Unicode smart quotes as single-quote delimiters. An attacker-controlled filename can therefore terminate the intended path literal and append PowerShell statements executed as the victim's SSH account.
2. Affected Assets & Attack Surface
a0c09f1381ae93e2a9a33c529d170186c61ad058backend/sftpbackend/sftp/sftp.go:1802-1812 — PowerShell hash commandsbackend/sftp/sftp.go:1663-1699 — Fs.runbackend/sftp/sftp.go:1988-2067 — Object.Hashbackend/sftp/sftp.go:2071-2090 — quoteOrEscapeShellPath3. Technical Root Cause Analysis
For PowerShell, quoteOrEscapeShellPath wraps a path in ASCII apostrophes and doubles only U+0027:
return "'" + strings.ReplaceAll(shellPath, "'", "''") + "'", nil
Windows PowerShell also treats U+2018, U+2019, U+201A, and U+201B as single-quote delimiters. Those characters pass through the rclone encoder and can close the quoted path. The completed string is sent as shell source through an SSH exec request.
The security boundary fails because shell syntax is constructed by string concatenation rather than passing data through a non-code channel.
4. Proof-of-Concept & Evidence
Set-Content statement created a marker file.Object.Hash path and MD5 PowerShell command against a fake SSH session backed by local PowerShell.Get-FileHash to complete; the appended statement then executed.Reproduction outline:
5. Impact Assessment
Successful exploitation provides arbitrary command execution as the victim's SSH account. This can permit file theft, modification, deletion, credential access, persistence, and lateral movement allowed by that account.
The attacker needs filename-control capability but does not need the victim's SSH credentials or an interactive shell. The rclone user's hash operation supplies the execution step.
High Basis: The source's own band: HIGH
0, fixed 1.75.0 (semver)1.75.0
1.75.0go get github.com/rclone/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0