rclone: PowerShell Smart-Quote Filename Injection Enables SFTP Server-Side Command ExecutionGHSA-2m8m-jhrm-w6j2
HIGHFix: rclone/rclone@e122fbaGHSA-2m8m-jhrm-w6j2 is a high-severity (CVSS 8) OS Command Injection vulnerability in github.com/rclone/rclone. A fix is available for github.com/rclone/rclone — see the affected versions and patch details below.
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for GHSA-2m8m-jhrm-w6j2.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-2m8m-jhrm-w6j2 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 388,997 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
github.com/rclone/rcloneReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
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
- Audited commit:
a0c09f1381ae93e2a9a33c529d170186c61ad058 - Backend:
backend/sftp - Relevant code:
backend/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—quoteOrEscapeShellPath
- Exposed input: remote filename controlled by an SFTP collaborator, upstream storage source, or other party able to create or rename files.
- Required execution context: PowerShell as the SSH command shell, SSH exec enabled, and server-side hashing invoked.
3. 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
- Each of the four Unicode smart quotes was passed through the production quoting function and used to terminate the path literal.
- A harmless injected
Set-Contentstatement created a marker file. - The stronger test invoked the exact production
Object.Hashpath and MD5 PowerShell command against a fake SSH session backed by local PowerShell. - A valid prefix file allowed
Get-FileHashto complete; the appended statement then executed. - The filename used only characters permitted by Windows filesystems and did not depend on slash, colon, pipe, or ASCII apostrophe.
- The focused test passed normally and under Go's race detector.
Reproduction outline:
- Configure an SFTP remote whose command shell is PowerShell.
- Enable or autodetect the PowerShell hash command.
- Place a file whose name contains a smart quote followed by a harmless marker-writing statement and PowerShell comment syntax.
- Trigger an rclone operation that calculates the remote hash.
- Observe the marker created with the SSH account's permissions.
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/rclone/rclone | all versions | 1.75.0go get github.com/rclone/rclone@v1.75.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/rclone/rclone, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/rclone/rclone to 1.75.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-2m8m-jhrm-w6j2 is resolved across your whole dependency graph.
Workarounds
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This is an Important vulnerability in rclone, a command-line file synchronization program, that allows for server-side command execution. An attacker can craft malicious SFTP filenames containing Unicode smart quotes to inject and execute arbitrary PowerShell commands on the system running rclone. This occurs when…
avoid connecting rclone to SFTP servers that use PowerShell as their SSH command shell, or disable server-side hashing with --sftp-disable-hashcheck. Do not process files from untrusted sources on SFTP remotes backed by PowerShell.Source: Red Hat security advisory for GHSA-2m8m-jhrm-w6j2 (CC BY 4.0)
Frequently Asked Questions
Is GHSA-2m8m-jhrm-w6j2 in your dependencies?
Find it across Go, including transitive dependencies.