GHSA-8c48-q9wj-3w37: CRLF Injection

Published Aug 5, 2026
·
Updated

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 961266888fe797390c535386f3b3aa46f4853602 on 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/ftp@v0.2.1-0.20251026020404-6602e981a1bb - Dependency command formatting: ftp.go:604-610, with path-bearing callers at ftp.go:893-947, 1010-1026, and 1069-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:

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

Affected Software

1 affected componentFixes available
go/github.com/rclone/rclone<1.75.0
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

    Implement CR/LF input validation for all FTP command arguments at the command-construction sink in backend/ftp/ftp.go (e.g., around ftp.go:1071-1173 and ftp.go:1309-1428): reject any arguments containing CR or LF and fail the operation with an error (do not normalize). Include filenames/paths, usernames, passwords, rename arguments, and all formatted fields that are interpolated into FTP control-channel commands.

    rclone FTP backend (backend/ftp/ftp.go) FTP command argument validation = Reject CR (\r) and LF (\n) in every FTP command argument at the lowest command-construction boundary; return an error rather than silently normalizing unsafe arguments
  3. Configuration

    Keep the default encoder protection as defense in depth, and explicitly reject any manually configured FTP encoding that can restore raw CR/LF by omitting Ctl/CrLf. The vulnerable case described is a valid nondefault configuration that restores raw CR/LF when it decodes via FromStandardPath before command-line interpolation (mentioned as `encoding = Slash`). Ensure the wizard/config accepts only encodings whose masks include Ctl and CrLf, and error out when Ctl/CrLf are omitted (backend/ftp/ftp.go:232-248, 768-785).

    rclone FTP encoding configuration (backend/ftp/ftp.go) Manual custom FTP encoding that can restore CR/LF = Reject configurations that omit Ctl/CrLf (i.e., encodings where the resulting representation can restore raw CR/LF before attacker-controlled interpolation)
  4. Operational

    Add end-to-end tests that cover CR, LF, CRLF, and each path command, including tests verifying rejection (error returned, not normalization) for injected CR/LF payloads and ensuring the command sink never emits attacker-controlled independent commands (e.g., the observed injected DELE command behavior on a test server).

Event History

Aug 5, 2026
Advisory Published
via GitHub·08:33 PM
Data Sourced
via GitHub·08:33 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