GHSA-486v-q2wf-fp2r: Infoleak

Published Sep 10, 2026
·
Updated

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 go // backend/http/http.go:285 client := fshttp.NewClient(ctx) // no CheckRedirect set ... f.httpClient = client // used by readDir / NewObject / Object.Open go // 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: ini [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:

go 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/httpinternaltest.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 Software

1 affected componentFixes available
go/github.com/rclone/rclone>=1.49.0<=1.75.0
1.75.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/rclone/rclone to a version that resolves this vulnerability.

    Fixed in 1.75.1
  2. Upgrade

    Upgrade rclone http backend (backend/http/http.go) to a version that resolves this vulnerability.

    Fixed in v1.76.0-DEVPatch cfdc9d0
  3. Configuration

    In backend/http/http.go, set the HTTP client's CheckRedirect to redirectCheckFn(opt) (instead of leaving it unset). The check must call rest.RefuseHTTPSDowngradeRedirectFn(req, via) and, when len(via)>0 and req.URL.Host != via[0].URL.Host, remove all configured secret headers from the redirect request (i.e., do not re-add opt.Headers on host change).

    backend/http (fshttp.NewClient/http.Client) CheckRedirect = redirectCheckFn(opt) that uses rest.RefuseHTTPSDowngradeRedirectFn and strips opt.Headers on any cross-host redirect (Location host differs from via[0].URL.Host)
  4. Configuration

    Ensure addHeaders continues to set configured headers on the initial request, but redirectCheckFn(opt) deletes each configured header key (opt.Headers[i]) from the redirect request whenever the redirect target host changes (req.URL.Host != via[0].URL.Host).

    backend/http addHeaders/redirect behavior opt.Headers handling on redirect = strip on cross-host redirect
  5. Compensating control

    As a mitigation until the fix is applied, avoid configuring sensitive credentials via --http-headers/headers= for HTTP remotes that may receive redirects to untrusted domains (e.g., disable/avoid HTTP remotes or redirect-capable endpoints you do not control).

Event History

Sep 10, 2026
Advisory Published
via GitHub·11:02 PM
Data Sourced
via GitHub·11:02 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Who is exposed to this issue?

Users of rclone's HTTP backend are exposed when they configure secret headers through --http-headers or headers=. The risk arises if the configured remote returns a redirect, including redirects caused by compromise, an open redirect, or CDN/mirror failover.

2

What does an attacker need to exploit it?

An attacker needs the HTTP backend to follow a redirect to a destination they control or can observe. Configured headers other than Authorization, Www-Authenticate, Cookie, and Cookie2 are forwarded across redirects regardless of destination host or scheme; the named headers can also survive a same-host HTTPS-to-HTTP downgrade.

3

Are default configurations affected?

The issue depends on users explicitly configuring headers that contain secrets for the HTTP backend. The provided information identifies --http-headers and headers= as the mechanisms that add those headers to every request.

4

What can be done if patching is not immediately possible?

Avoid configuring secret headers with the HTTP backend where possible, especially custom header names. Avoid remotes that may redirect requests, and do not rely on Authorization or Cookie headers being protected from same-host HTTPS-to-HTTP redirects.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203