CVE-2026-71312: rclone PowerShell Smart-Quote Filename Injection Enables Vulnerability

HIGH
Advisory Identifier: GHSA-2m8m-jhrm-w6j2
CVSS 8.0
CWE-78
Published
Advisory Summary

CVE-2026-71312 is a HIGH (CVSS 8.0) powershell smart-quote filename injection enables vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting rclone libraries in the Go ecosystem. The issue involves powershell smart-quote filename injection enables sftp server-side command execution. Remediation is available by upgrading affected packages to version 1.75.0.

CVE-2026-71312 at a Glance

CVE Identifier CVE-2026-71312
GHSA Identifier GHSA-2m8m-jhrm-w6j2
Severity HIGH
CVSS v3.1 Base Score 8.0
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product rclone
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-71312

To remediate this vulnerability, upgrade all affected rclone dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/rclone/rclone fixed: 1.75.0
Upgrade github.com/rclone/rclone to 1.75.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/rclone/rclone

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-71312, inspect your project dependencies for rclone:

inspect dependencies for github.com/rclone/rclone

Analyze the terminal output to locate any version of rclone in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.75.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In rclone, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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.

CVE-2026-71312 Affected rclone Versions

1 component(s)
Fixed Versions:
1.75.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/rclone/rclone
Go
< 1.75.0
1.75.0

References

Frequently Asked Questions

What is CVE-2026-71312?
CVE-2026-71312 is a security vulnerability in rclone involving PowerShell Smart-Quote Filename Injection Enables SFTP Server-Side Command Execution under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which rclone versions are affected?
Affected versions include releases prior to 1.75.0 across affected packages: github.com/rclone/rclone.
What version fixes CVE-2026-71312?
Upgrading to 1.75.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/rclone/rclone affected?
Yes, github.com/rclone/rclone is affected in releases prior to 1.75.0. Upgrade your dependency to 1.75.0 or later.
What is the CVSS score of CVE-2026-71312?
CVE-2026-71312 has a CVSS v3.1 base score of 8.0 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-71312?
CVE-2026-71312 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check Go dependencies for CVE-2026-71312?
Run the dependency tree command: 'inspect dependencies for github.com/rclone/rclone'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2m8m-jhrm-w6j2",
  "modified" : "2026-08-05T20:37:56Z",
  "published" : "2026-08-05T20:37:56Z",
  "aliases" : [ "CVE-2026-71312" ],
  "summary" : "rclone: PowerShell Smart-Quote Filename Injection Enables SFTP Server-Side Command Execution",
  "details" : "## 1. Summary\n\nrclone 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.\n\n## 2. Affected Assets & Attack Surface\n\n- Audited commit: `a0c09f1381ae93e2a9a33c529d170186c61ad058`\n- Backend: `backend/sftp`\n- Relevant code:\n  - `backend/sftp/sftp.go:1802-1812` — PowerShell hash commands\n  - `backend/sftp/sftp.go:1663-1699` — `Fs.run`\n  - `backend/sftp/sftp.go:1988-2067` — `Object.Hash`\n  - `backend/sftp/sftp.go:2071-2090` — `quoteOrEscapeShellPath`\n- Exposed input: remote filename controlled by an SFTP collaborator, upstream storage source, or other party able to create or rename files.\n- Required execution context: PowerShell as the SSH command shell, SSH exec enabled, and server-side hashing invoked.\n\n## 3. Technical Root Cause Analysis\n\nFor PowerShell, `quoteOrEscapeShellPath` wraps a path in ASCII apostrophes and doubles only `U+0027`:\n\n```go\nreturn \"'\" + strings.ReplaceAll(shellPath, \"'\", \"''\") + \"'\", nil\n```\n\nWindows 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.\n\nThe security boundary fails because shell syntax is constructed by string concatenation rather than passing data through a non-code channel.\n\n## 4. Proof-of-Concept & Evidence\n\n- Each of the four Unicode smart quotes was passed through the production quoting function and used to terminate the path literal.\n- A harmless injected `Set-Content` statement created a marker file.\n- The stronger test invoked the exact production `Object.Hash` path and MD5 PowerShell command against a fake SSH session backed by local PowerShell.\n- A valid prefix file allowed `Get-FileHash` to complete; the appended statement then executed.\n- The filename used only characters permitted by Windows filesystems and did not depend on slash, colon, pipe, or ASCII apostrophe.\n- The focused test passed normally and under Go's race detector.\n\nReproduction outline:\n\n1. Configure an SFTP remote whose command shell is PowerShell.\n2. Enable or autodetect the PowerShell hash command.\n3. Place a file whose name contains a smart quote followed by a harmless marker-writing statement and PowerShell comment syntax.\n4. Trigger an rclone operation that calculates the remote hash.\n5. Observe the marker created with the SSH account's permissions.\n\n## 5. Impact Assessment\n\nSuccessful 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.\n\nThe 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/rclone/rclone"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.75.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.74.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rclone/rclone/security/advisories/GHSA-2m8m-jhrm-w6j2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rclone/rclone/commit/e122fba1a57641b63a580aa26c026903a84e2e88"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rclone/rclone"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rclone/rclone/releases/tag/v1.75.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-05T20:37:56Z",
    "nvd_published_at" : null
  }
}