Skip to content

GHSA-486v-q2wf-fp2r BIT-rclone-2026-88013 CVE-2026-88013 GO-2026-6463

rclone: http backend forwards custom/auth headers to a different host on redirect

Medium Go
Severity
3.7 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.19%
Chance of exploitation in the next 30 days. Higher than 8.30% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-200 Exposure of Sensitive Information to an Unauthorized Actor
CWE-319 Cleartext Transmission of Sensitive Information
CWE-522 Insufficiently Protected Credentials
Fix
1.75.1
Upgrade github.com/rclone/rclone to this version or later

Description

Vulnerability Details

File: backend/http/http.go Lines: 285 (client construction — no CheckRedirect), 505-510 (addHeaders, writes configured secret headers onto every request), 533-534 / 700-701 / 782-785 (f.httpClient.Do(req) used by List/stat/download)

Root Cause

The http backend lets a user attach arbitrary secret headers to every request via --http-headers/headers= (documented for authentication: '"Cookie","name=value","Authorization","xxx"'). The backend's HTTP client is built with fshttp.NewClient(ctx), which never sets http.Client.CheckRedirect, so it falls back to Go's stdlib default redirect policy.

Go's default policy only strips four header names (Authorization, Www-Authenticate, Cookie, Cookie2), and only when the redirect target's host differs from the original — every other configured header is copied to the redirect target unconditionally, regardless of host or scheme. Even the four protected names survive a same-host https:// → http:// downgrade, since Go only checks host equality, not scheme.

Any redirect response from the configured remote — whether from server compromise, an open redirect, a CDN/mirror failover to a different domain, or a malicious server from the start — causes rclone to resend every configured secret header (and, for a scheme downgrade, Authorization/Cookie in cleartext) to the new destination.

This is the exact vulnerability class already fixed for the s3 backend (9328763/7543a7a, GHSA-8mxv-9xhp-86h4 and the webdav backend (59b513b, GHSA-h4mf-4v27-hggj, wiring rest.RefuseHTTPSDowngradeRedirectFn). backend/http was not touched by either fix.

Vulnerable Code

// backend/http/http.go:285
client := fshttp.NewClient(ctx)   // no CheckRedirect set
...
f.httpClient = client             // used by readDir / NewObject / Object.Open
// backend/http/http.go:505-510
func addHeaders(req *http.Request, opt *Options) {
	for i := 0; i < len(opt.Headers); i += 2 {
		key := opt.Headers[i]
		value := opt.Headers[i+1]
		req.Header.Add(key, value)
	}
}

Attack Scenario

  1. User configures an http remote: url=https://good.example.com/files/, headers=X-Api-Key,SECRET-TOKEN.
  2. At some point good.example.com returns a redirect whose Location points at a different host (compromise, open redirect, CDN change, or malice from the start).
  3. User runs any operation (ls, cat, copy, mount, serve) against the remote.
  4. rclone follows the redirect with the default client and resends X-Api-Key: SECRET-TOKEN to the new, untrusted destination.
  5. The attacker's server captures the secret from the incoming request.

Impact

Exfiltration of API keys / bearer tokens / session cookies configured for one host, to any host the (trusted-at-configuration-time) remote later redirects to. All operations on the http backend (list, stat, download, mount, serve) are affected. No special rclone privileges or unusual user interaction are needed beyond a normal sync/list/copy once the redirect exists.

Dynamic Confirmation

Built rclone from source at cfdc9d0 (current master, v1.76.0-DEV) and configured:

[testhttp]
type = http
url = http://127.0.0.1:9090/
headers = X-Api-Key,SUPER-SECRET-TOKEN-abc123

Server A (port 9090, the "configured" host) 302-redirects every request to Server B (port 9091, a different host). Running rclone cat testhttp:file.txt caused Server B — which was never configured with any credential — to receive:

Header: X-Api-Key: SUPER-SECRET-TOKEN-abc123
Header: Referer: http://127.0.0.1:9090/file.txt

rclone printed Server B's response body as if it were the real file, confirming the full stat→redirect→download round trip leaks the header and trusts the redirect target.

Vulnerable Code / Fix

A minimal fix (implemented, tested, and verified to close the leak while preserving redirect functionality) wires the client to rest.RefuseHTTPSDowngradeRedirectFn (already used by webdav) and strips the configured opt.Headers on any cross-host redirect:

client := fshttp.NewClient(ctx)
client.CheckRedirect = redirectCheckFn(opt)
...
func redirectCheckFn(opt *Options) func(req *http.Request, via []*http.Request) error {
	return func(req *http.Request, via []*http.Request) error {
		if err := rest.RefuseHTTPSDowngradeRedirectFn(req, via); err != nil {
			return err
		}
		if len(via) > 0 && req.URL.Host != via[0].URL.Host {
			for i := 0; i < len(opt.Headers); i += 2 {
				req.Header.Del(opt.Headers[i])
			}
		}
		return nil
	}
}

A regression test (TestRedirectStripsHeadersOnHostChange) was added to backend/http/http_internal_test.go, confirmed to fail without the fix and pass with it. Full backend/http and lib/rest test suites pass with the fix applied. I have a fix branch ready to push to a private fork once this report is acknowledged.

Verification

Dynamically confirmed on rclone master @ cfdc9d0 (post v1.75.0) in a local test harness — see "Dynamic Confirmation" above. Fix verified to eliminate the leak via the same harness (secret header absent from Server B after the fix; functionality — file download via redirect — unaffected).

Affected versions

Go

PackageVulnerableFixed in
github.com/rclone/rclone
>= 1.49.0, < 1.75.1
1.75.1

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

github.com/rclone/rclone Go → 1.75.1

go
go get github.com/rclone/rclone@v1.75.1 && go mod tidy

Severity breakdown

CVSS 3.1 3.7

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

Weakness

CWE-200: Exposure of Sensitive Information to an Unauthorized Actor

The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.

How to prevent it
  • Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.

CWE-319: Cleartext Transmission of Sensitive Information

The product transmits sensitive or security-critical data in cleartext in a communication channel that can be sniffed by unauthorized actors.

How to prevent it
  • Architecture and Design: Before transmitting, encrypt the data using reliable, confidentiality-protecting cryptographic protocols.
  • Implementation: When using web applications with SSL, use SSL for the entire session from login to logout, not just for the initial login page.
  • Implementation: When designing hardware platforms, ensure that approved encryption algorithms (such as those recommended by NIST) protect paths from security critical data to trusted user applications.
  • Testing: Use tools and techniques that require manual (human) analysis, such as penetration testing, threat modeling, and interactive tools that allow the tester to record and modify an active session. These may be more effective than strictly automated techniques. This is especially the case with weaknesses that are related to design and business rules.
  • Operation: Configure servers to use encrypted channels for communication, which may include SSL or other secure protocols.

CWE-522: Insufficiently Protected Credentials

The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval.

How to prevent it
  • Architecture and Design: Use an appropriate security mechanism to protect the credentials.
  • Architecture and Design: Make appropriate use of cryptography to protect the credentials.
  • Implementation: Use industry standards to protect the credentials (e.g. LDAP, keystore, etc.).

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-38xv-hf3p-h7mq
rclone: source object names can escape the configured root on upload
Medium Also affects github.com/rclone/rclone
GHSA-2p48-j3qc-rx9f
rclone: S3 multipart declared-length memory exhaustion
High Also affects github.com/rclone/rclone
GHSA-p569-5gjg-9cmj
rclone: RC per-server auth-proxy bypass
Critical Also affects github.com/rclone/rclone
GHSA-xwwr-4h3p-r22c
rclone serve s3: --auth-proxy without --auth-key authenticates nobody - full SigV4 signature bypass
Critical Also affects github.com/rclone/rclone
GHSA-c476-6w5q-jw77
rclone: FTP cross-session auth-proxy backend confusion
High Also affects github.com/rclone/rclone
GHSA-f8g7-2xjc-7mfh
rclone: Directory metadata (chmod/chown/chtimes) applied through a planted symlink in rclone local --links escapes the destination
High Also affects github.com/rclone/rclone
GHSA-p6m2-r3w9-mpxw
rclone local: crafted Range request against a translated symlink panics (DoS)
Medium Also affects github.com/rclone/rclone
GHSA-66hp-wgxq-6f5q
rclone archive/zip: Zip Slip via unsanitized zip entry names lets a malicious archive escape its own namespace
Medium Also affects github.com/rclone/rclone
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor