GHSA-gx4c-2hqx-cw2r: Low severity go/github.com/rclone/rclone vulnerability

Published Aug 5, 2026
·
Updated

Vulnerability Details

File: backend/s3/s3.go Lines: 1359-1380 (functions s3CheckRedirect / s3RedirectCrossesHost)

Root Cause Commit e7b1eb774 (released in v1.74.3) added a CheckRedirect policy for the S3 HTTP client whose purpose is to strip the X-Amz-Security-Token header (the AWS STS session token) whenever a redirect chain "crosses a host", so the token isn't forwarded to an unintended origin.

s3RedirectCrossesHost decides this purely by comparing url.URL.Host (hostname[:port]); it never looks at url.URL.Scheme. A redirect that keeps the exact same host:port but changes the scheme from https:// to http:// therefore compares as "same host" and X-Amz-Security-Token is not stripped — it is sent again, this time over plaintext HTTP.

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 }

Attack Scenario 1. The user configures an s3 remote (or --s3-endpoint pointing at a self-hosted/third-party S3-compatible service) using temporary credentials that include an STS sessiontoken (common for assumed-role / CI / Kubernetes IRSA setups). 2. The configured endpoint responds to a request with a 3xx redirect to the same host:port but with http:// instead of https:// (TLS-front misconfiguration, maintenance redirect, or a malicious/compromised storage provider trying to harvest the token). 3. rclone's S3 HTTP client follows the redirect and re-sends the request, including X-Amz-Security-Token, over the now-unencrypted connection to that same host. 4. Any passive observer on that now-plaintext network path can read the STS session token from the request headers.

Impact Disclosure of the AWS STS session token (X-Amz-Security-Token) in cleartext for the remainder of its validity window. This is the exact class of leak that e7b1eb774 was written to close — it just doesn't cover the scheme-downgrade axis of "crossing a host".

Vulnerable Code 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 }

Recommended Fix Also compare URL.Scheme, so a scheme downgrade on the same host is treated the same as a host change:

go 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 }

Verification Added a unit test (backend/s3/redirectschemetest.go) that calls the real, unmodified s3RedirectCrossesHost / s3CheckRedirect with an https://bucket.example.com -> http://bucket.example.com redirect chain.

On unpatched code (commit 16091ce365, current master / v1.74.3): - s3RedirectCrossesHost returns false - s3CheckRedirect leaves X-Amz-Security-Token: SECRET-SESSION-TOKEN intact on the outgoing (plaintext) request.

=== RUN TestSchemeDowngradeNotDetectedAsCrossHost redirectschemetest.go:23: initial=https://bucket.example.com final=http://bucket.example.com s3RedirectCrossesHost=false --- PASS: TestSchemeDowngradeNotDetectedAsCrossHost (0.00s)

After applying the one-line fix above (also adding scheme comparison), the token is correctly stripped and all existing redirect tests (TestClientRemovesSecurityTokenOnCrossHostRedirect, TestClientDoesNotRestoreSecurityTokenAfterCrossHostRedirect, TestClientKeepsSecurityTokenOnSameHostRedirect, TestClientStopsAfterTenRedirects) continue to pass.

A minimal fix commit is ready and can be pushed to a private fork once this report is acknowledged.

Affected Software

1 affected componentFixes available
go/github.com/rclone/rclone<=1.74.3
1.74.4

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.74.4
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch e7b1eb774
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in v1.74.3

Event History

Aug 5, 2026
Advisory Published
via GitHub·08:43 PM
Data Sourced
via GitHub·08:43 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of GHSA-gx4c-2hqx-cw2r?

The severity of GHSA-gx4c-2hqx-cw2r is low with a CVSS score of 3.1.

2

What causes the GHSA-gx4c-2hqx-cw2r vulnerability?

The GHSA-gx4c-2hqx-cw2r vulnerability is caused by a change in the CheckRedirect policy for the S3 HTTP client that strips the X-Amz-Security-Token header.

3

How can I fix GHSA-gx4c-2hqx-cw2r?

To fix GHSA-gx4c-2hqx-cw2r, upgrade to version 1.74.4 or later.

4

What components are affected by GHSA-gx4c-2hqx-cw2r?

GHSA-gx4c-2hqx-cw2r affects the backend S3 functionality in the rclone software.

5

When was GHSA-gx4c-2hqx-cw2r published?

GHSA-gx4c-2hqx-cw2r was published on August 5, 2026.

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