Skip to content
SSRF Disclosed report Intermediate

Authorization header leak in ssrf_filter via cross-host redirect leads to credential theft and unauthorized access

The ssrf_filter library rebuilds redirected requests from the original request options, so when a redirect points to a different host it still sends the caller's Authorization header there. An attacker who controls a redirect target can capture the bearer token and replay it against a protected API to read private data.

argareksapatii Follow

Originally disclosed on HackerOne

  • Disclosed after 14 days

Summary:

ssrf_filter follows redirects by rebuilding each redirected request from the original request options. When a redirect crosses to a different host, it still reapplies caller-supplied sensitive state such as the Authorization header.

As a result, an attacker-controlled redirect target can receive credentials that were intended only for the original request origin.

I verified impact with a local proof of concept. A bearer token attached to the initial request was forwarded to a different host, captured there, and then successfully replayed against a separate protected API endpoint, which returned private data. This demonstrates credential theft followed by unauthorized access, not just passive header disclosure.

Steps To Reproduce:

  1. Clone the repository and enter the project root:

    Bash
    git clone https://github.com/arkadiyt/ssrf_filter
    cd ssrf_filter
    
  2. Run the attached bearer-token replay PoC:

    Bash
    ruby artifacts/ssrf_filter_redirect_leak_2026-04-01/01_bearer_token_replay.rb
    
  3. The PoC starts three local servers:

    • redirector.test, which returns a 302 redirect to collector.test
    • collector.test, which records the inbound Authorization header
    • api.test, which exposes /private and only returns data when the correct bearer token is presented
  4. Observe that SsrfFilter.get(...) follows the redirect and forwards the original Authorization header to collector.test.

  5. Observe that the stolen token is then replayed to api.test/private and succeeds.

Expected output:

[:fetch_response, "200", "stolen"]
[:stolen_token, "Bearer service-token-123"]
[:replay_response, "200", "private-data"]

Interpretation:

  • Authorization is forwarded across an origin change.
  • The leaked bearer token is reusable.
  • Reuse of the stolen token grants access to protected data.

Note: for local-only reproduction, the PoC temporarily allows loopback addresses so the entire harness can run on one machine. That adjustment is only for the lab setup and is not part of the vulnerability itself. The issue is the forwarding of sensitive credentials across cross-host redirects.

Supporting Material/References:

  • Evidence bundle: ssrf_filter/artifacts/ssrf_filter_redirect_leak_2026-04-01.zip
  • Bearer token replay PoC: ssrf_filter/artifacts/ssrf_filter_redirect_leak_2026-04-01/01_bearer_token_replay.rb
  • Evidence outputs: ssrf_filter/artifacts/ssrf_filter_redirect_leak_2026-04-01/evidence_outputs.md
  • Draft report: ssrf_filter/artifacts/ssrf_filter_redirect_leak_2026-04-01/report_draft.md
  • Relevant code path: ssrf_filter/lib/ssrf_filter/ssrf_filter.rb
    • redirect loop reuses the original request options
    • redirected requests reapply headers/body/request_proc
    • redirects are not differentiated between same-host and cross-host targets

The original report as published on HackerOne, by argareksapatii. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the redirect loop rebuilds each redirected request from the original options, reapplying headers such as Authorization without checking whether the redirect stays on the same host.

Impact

A bearer token intended for one origin could be captured by a different host and replayed to reach protected data, though the demonstration ran only against local servers with loopback temporarily allowed.

What the attacker needed

Attacker controls a redirect target; caller sends credentials with the request

The fix

The library should strip sensitive headers such as Authorization on cross-host redirects, or refuse to follow them with credentials attached.

How it was found

  1. Clone the library repository and enter the project root.
  2. Run the supplied bearer-token replay proof of concept.
  3. The proof of concept starts a redirector server, a collector server and a protected API server.
  4. The library follows the redirect and forwards the original Authorization header to the collector.
  5. The captured token is replayed against the protected endpoint and returns private data.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a program fetches a web address, the server can reply with a redirect, meaning 'go and fetch this other address instead'. This library kept attaching the caller's login token to the new request even when the new address belonged to a completely different server. So whoever ran that other server received the token and could use it to log in as the caller.

What is SSRF?

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.

More by argareksapatii

View all

3 more disclosed reports, best first.

More from arkadiyt-projects

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.