GHSA-2m8m-jhrm-w6j2: OS Command Injection

Published Aug 5, 2026
·
Updated

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 commands - backend/sftp/sftp.go:1663-1699 — Fs.run - backend/sftp/sftp.go:1988-2067 — Object.Hash - backend/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:

go 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-Content statement created a marker file. - The stronger test invoked the exact production Object.Hash path and MD5 PowerShell command against a fake SSH session backed by local PowerShell. - A valid prefix file allowed Get-FileHash to 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:

1. Configure an SFTP remote whose command shell is PowerShell. 2. Enable or autodetect the PowerShell hash command. 3. Place a file whose name contains a smart quote followed by a harmless marker-writing statement and PowerShell comment syntax. 4. Trigger an rclone operation that calculates the remote hash. 5. 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 Software

1 affected componentFixes available
go/github.com/rclone/rclone<=1.74.4
1.75.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/rclone/rclone to a version that resolves this vulnerability.

    Fixed in 1.75.0
  2. Configuration

    Disable or strictly control the option that enables/autodetects the PowerShell hash command so that PowerShell is not used as the SSH command shell for remote hashing.

    rclone (SFTP backend) PowerShell hash command (enable or autodetect) = disable
  3. Configuration

    Update the SFTP PowerShell quoting helper (quoteOrEscapeShellPath) to escape all PowerShell single-quote delimiters, including the Unicode smart quotes U+2018, U+2019, U+201A, and U+201B, not only ASCII apostrophe U+0027.

    rclone (SFTP backend) quoting behavior quoteOrEscapeShellPath handling of PowerShell single-quote delimiters = escape Unicode smart quotes U+2018/U+2019/U+201A/U+201B in addition to ASCII apostrophe U+0027
  4. Compensating control

    Configure the SFTP remote so its command shell is not PowerShell (i.e., do not use PowerShell as the SSH command shell for server-side hashing).

  5. Compensating control

    Mitigate by preventing attacker-controlled filenames from reaching the SFTP remote (e.g., restrict who can create/rename remote files used in the hashing workflow), since exploitation requires control of the remote filename that is interpolated into the PowerShell command.

Event History

Aug 5, 2026
Advisory Published
via GitHub·08:37 PM
Data Sourced
via GitHub·08:37 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203