Aug 6, 2026·6 min read·2 visits
The rclone S3 backend does not strip the X-Amz-Security-Token header during HTTPS-to-HTTP redirects on the same host, exposing temporary session tokens to cleartext network sniffing by adjacent attackers.
A logic vulnerability in the rclone S3 backend implementation allows an unauthenticated adjacent-network attacker to intercept temporary AWS STS credentials. During HTTP redirection handling, the application fails to verify whether a protocol scheme change occurred (such as transitioning from HTTPS to HTTP). If a secure request is redirected to an unencrypted endpoint on the same host, rclone continues to forward the highly sensitive X-Amz-Security-Token header in cleartext.
The rclone S3 backend utilizes temporary security credentials, such as AWS Security Token Service (STS) session tokens, to authenticate requests securely. These credentials are transmitted via the X-Amz-Security-Token HTTP header to prove the caller's identity and permissions. To prevent credential leakage, the application contains redirection checking logic that strips sensitive headers if the HTTP redirection chain crosses host boundaries.
However, a design flaw exists in the redirection logic implemented in version 1.74.3. The security checker does not validate the URI scheme (HTTPS versus HTTP) during evaluation. If an initial secure connection to an S3 endpoint is redirected to an unencrypted endpoint on the same host, the application classifies the destination as the same host and follows the redirect without stripping the authorization headers.
As a consequence of this logic failure, the sensitive security token is transmitted over unencrypted HTTP. An attacker positioned on the local network or adjacent routing path can capture this traffic to extract the valid STS token. Once obtained, the attacker can leverage the credentials to perform operations against the backend S3 storage within the validity window of the token.
The root cause of this vulnerability lies in the implementation of the s3RedirectCrossesHost function within the backend/s3/s3.go source file. This helper function is registered in the S3 client configuration to determine whether an HTTP redirect has traversed to an external, untrusted boundary.
In vulnerable versions of the application, the verification logic relies exclusively on the Host field of the parsed Golang url.URL struct. The Host property only represents the hostname and optionally the port (e.g., bucket.example.com). It does not contain the protocol scheme of the resource identifier.
When a server responds to an HTTPS request with an HTTP redirect on the same hostname, the logic compares the original via[0].URL.Host value with the new target req.URL.Host value. Because both strings match, the function incorrectly returns false. This prevents the client from invoking header-stripping protocols, resulting in cleartext transmission of the X-Amz-Security-Token header.
Below is the vulnerable implementation of s3RedirectCrossesHost found in backend/s3/s3.go:
func s3RedirectCrossesHost(req *http.Request, via []*http.Request) bool {
if len(via) == 0 {
return false
}
host := via[0].URL.Host
for _, redirect := range via[1:] {
if redirect.URL.Host != host {
return true
}
}
return host != req.URL.Host
}The implementation evaluates the redirect chain sequentially, but only verifies that redirect.URL.Host matches the original host. It ignores changes in URL.Scheme (e.g. from https to http).
The patched version introduces strict scheme tracking, as seen in the code change below:
func s3RedirectCrossesHost(req *http.Request, via []*http.Request) bool {
if len(via) == 0 {
return false
}
scheme, host := via[0].URL.Scheme, via[0].URL.Host
for _, redirect := range via[1:] {
if redirect.URL.Host != host || redirect.URL.Scheme != scheme {
return true
}
}
return host != req.URL.Host || scheme != req.URL.Scheme
}In the patched logic, both Scheme and Host are tracked from the initial request (via[0]). If either property diverges during the redirect chain, the function evaluates to true, instructing the caller to strip the sensitive headers prior to issuing the subsequent redirect request.
To execute this attack, an adversary must be positioned on an adjacent network or possess the ability to influence routing paths between the rclone client and the S3 target. The attack scenario unfolds as follows:
First, the victim executes an rclone operation against an S3 destination using temporary credentials. If the remote service is misconfigured or a load balancer directs traffic to an unencrypted backend, a redirect response is issued. Alternatively, an attacker on the adjacent network can perform local spoofing (e.g., ARP spoofing or DNS spoofing) to intercept the connection and generate an artificial redirect from port 443 to port 80 on the same host.
When rclone processes the redirect, s3RedirectCrossesHost returns false due to the matching hostnames. The client then sends the follow-up request to the unencrypted HTTP endpoint, carrying the plaintext token. The adjacent network attacker captures the packet stream, extracts the X-Amz-Security-Token, and uses it to access protected S3 resources.
The impact of this vulnerability is limited to environments utilizing temporary S3 credentials, such as AWS STS tokens or similar session token structures. Long-term AWS master access keys, which are handled through different authentication signing mechanisms, are not directly affected by this redirect failure.
The CVSS score is evaluated at 3.1 (Low severity) due to the high barrier to entry. The attacker must possess adjacent network access (AV:A) and the complexity is High (AC:H) because it requires either a backend configuration failure or active network-level poisoning. There is no impact on integrity or availability, as the attack primarily results in confidential credential exposure.
Currently, this vulnerability is not listed on the CISA KEV list, and there are no known public exploits, weaponized execution paths, or reports of active exploitation in the wild.
The primary resolution is upgrading rclone to version 1.74.4 or later, which fully implements the updated s3RedirectCrossesHost checker to strip credentials on scheme downgrades. This represents the only complete remediation for the codebase.
In environments where upgrading the binary is delayed, several infrastructural workarounds should be applied. First, S3 endpoints and reverse proxies must be configured to deny unencrypted HTTP traffic entirely on port 80. This prevents the server from issuing a protocol downgrade redirection.
Additionally, deploying HTTP Strict Transport Security (HSTS) on the network gateway forces clients to automatically rewrite any unencrypted HTTP requests to secure HTTPS before transmission, neutralizing the protocol downgrade entirely.
CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
rclone rclone | >= 1.74.3, < 1.74.4 | 1.74.4 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-319 |
| Attack Vector | Adjacent Network |
| CVSS v3.1 Score | 3.1 |
| Exploit Status | PoC (Unit Test Only) |
| KEV Status | Not Listed |
| Affected Component | backend/s3/s3.go |
The product transmits sensitive information over an unencrypted channel, making it vulnerable to network interception.
An incomplete sanitization vulnerability exists in rclone's SFTP backend before version 1.75.0 when performing server-side hashing operations on Windows hosts. Due to PowerShell treating Unicode smart quotes as equivalent to ASCII single quotes, malicious file paths can escape command string delimiters and execute arbitrary commands on the remote system.
A critical path traversal and authorization bypass vulnerability exists in the rclone serve restic command when multi-user isolation is enabled using the --private-repos flag. Due to a middleware desynchronization flaw, authenticated users can access, modify, or delete backup repositories belonging to other tenants.
CVE-2025-15366 is a command injection vulnerability in Python's standard imaplib module, occurring due to the improper neutralization of carriage returns (\r), line feeds (\n), and null bytes (\x00). When an application passes user-controlled input into standard IMAP library calls, an attacker can break out of the line-oriented protocol context and execute arbitrary IMAP directives with the privileges of the authenticated session.
A path traversal vulnerability (Zip Slip variant) exists in rclone's archive extract functionality before version 1.74.4. The command fails to sanitize relative directory components in archive headers, allowing files to be written outside the target directory or cloud prefix. This issue can result in arbitrary file writes or cloud object overwrites depending on the permissions of the credentials used. Nick Craig-Wood authored the patch on June 29, 2026, which was released in version 1.74.4 on July 14, 2026. This vulnerability is assigned CVE-2026-59732 and is cataloged as GHSA-4vr5-p2gc-h23p. This report provides a detailed root cause analysis, code-level diff, and remediation steps.
A local encoding path traversal vulnerability exists in rclone versions from v1.51.0 up to v1.75.0. When non-default local encoding parameters (such as Slash, None, or Raw) are specified, rclone's standard decoder maps safely encoded fullwidth dot-dot characters back into native directory traversal components. Since the local backend historically lacked a post-resolution path containment check, these relative segments resolved outside the designated synchronization root, allowing arbitrary file creation and modification on the host system.
An security bypass vulnerability exists in Nuxt frameworks where route rules containing mixed-case characters are silently dropped during case-insensitive routing. This occurs because lookups are folded to lowercase, but keys are stored in their original casing in the route-matching trie. As a result, critical authorization middleware, such as appMiddleware, is bypassed, allowing unauthorized access to restricted pages.