Summary
rclone: FTP Command Arguments Permit CRLF Injection When Custom Encoding Preserves Newlines
1. Summary
A valid but nondefault FTP filename encoding can restore raw CR/LF immediately before an attacker-controlled path is interpolated into the line-oriented FTP control channel. The dependency does not reject CR or LF in command arguments, so a filename can inject an independent authenticated command. A real test server observed the injected DELE command.
The default FTP encoding and the configuration-wizard examples include Ctl and are not vulnerable to the demonstrated filename. A manual custom encoding that omits Ctl/CrLf is mandatory and is reflected as High attack complexity. The credible trust boundary is a lower-trust source namespace feeding a more-privileged FTP destination: if the attacker already has equivalent rights on that destination, the report establishes a bug but no privilege gain. Protocol framing must still be enforced at the command sink because a filename-compatibility encoder is not a safe substitute for command-argument validation.
2. Affected Assets & Attack Surface
- Verified rclone revision:
a0c09f1381ae93e2a9a33c529d170186c61ad058(v1.74.0-240-ga0c09f138) - Current-master check: the relevant paths remained present at commit
961266888fe797390c535386f3b3aa46f4853602on 2026-07-18 - rclone FTP encoding:
backend/ftp/ftp.go:232-248,768-785 - Encoder masks/conversion:
lib/encoder/encoder.go:36-68,121-152,1144-1165 - FTP command sinks:
backend/ftp/ftp.go:1071-1173,1309-1428 - Dependency:
github.com/jlaffaye/[email protected] - Dependency command formatting:
ftp.go:604-610, with path-bearing callers atftp.go:893-947,1010-1026, and1069-1080 - Preconditions: an attacker can create a filename in a source namespace, the victim copies/syncs it to an FTP destination with greater authority, and that destination uses a manually configured encoding that leaves CR/LF raw
- Platform note: Unix and some remote backends can supply newline-bearing names; a local Windows source cannot create the demonstrated filename
3. Technical Root Cause Analysis
Rclone represents control characters safely in its internal Standard encoding. Immediately before an FTP operation, FromStandardPath decodes that representation and applies the configured backend mask. If the mask omits Ctl/CrLf, raw newlines are restored. The dependency then formats the resulting argument onto a CRLF-delimited control stream through textproto.Conn.Cmd without validating it. Reversible filename representation is therefore being used as the only protection for a protocol-command boundary.
4. Proof-of-Concept & Evidence
The source filename was equivalent to:
victim\r\nDELE other-secret\r\nNOOP
With the default encoding, no raw newline reached the command. With the valid nondefault configuration encoding = Slash, FromStandardPath restored raw CRLF. During a real FTP path operation, the server parsed DELE other-secret as an independent authenticated command. This establishes injection, not merely unsafe serialization. The test did not establish confidentiality impact or operating-system command execution.
5. Impact Assessment
Injected commands run with the configured FTP account's permissions. Demonstrated direct impact is deletion of a different path, with corresponding integrity and availability loss inside that account. Other FTP filesystem commands may be reachable, but confidentiality and arbitrary operating-system command execution are not claimed. The privilege-boundary case requires the victim's FTP account to have more authority than the attacker has in the source namespace.
6. Remediation Guidance
- Reject CR and LF in every FTP command argument at the lowest command-construction boundary.
- Apply the check to paths, usernames, passwords, rename arguments, and all other formatted fields.
- Return an error rather than silently normalizing an unsafe argument.
- Keep the default encoder protection as defense in depth and reject an FTP encoding configuration that can restore CR/LF.
- Add end-to-end tests for CR, LF, CRLF, and each path command.
Impact
CVE-2026-71311 has a CVSS score of 6.4 (Medium). The vector is network-reachable, low privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.75.0); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-71311? CVE-2026-71311 is a medium-severity security vulnerability in github.com/rclone/rclone (go), affecting versions < 1.75.0. It is fixed in 1.75.0.
- How severe is CVE-2026-71311? CVE-2026-71311 has a CVSS score of 6.4 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of github.com/rclone/rclone are affected by CVE-2026-71311? github.com/rclone/rclone (go) versions < 1.75.0 is affected.
- Is there a fix for CVE-2026-71311? Yes. CVE-2026-71311 is fixed in 1.75.0. Upgrade to this version or later.
- Is CVE-2026-71311 exploitable, and should I be worried? Whether CVE-2026-71311 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-71311 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-71311? Upgrade
github.com/rclone/rcloneto 1.75.0 or later.