Skip to content
Open redirect Write-up Intermediate

From an Open Redirect in a Brazilian Bank to Session Token Leak

The redirect_uri parameter in the bank's authentication URL was not validated, allowing an attacker to redirect users to a malicious site after login. The session token was appended to the redirect URL, so the attacker could capture it and take over the user's account.

heitorgouvea.me

Published on heitorgouvea.me

This publication aims to share an open redirect vulnerability[1] discovered on the Caixa Econômica Federal website, through which it was possible to expose user session tokens.

The author, on heitorgouvea.me

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

How it worked

Root cause

Likely the application did not validate the redirect_uri parameter, allowing arbitrary redirects, and it included the session token in the redirect URL.

Impact

An attacker could capture the session token and gain access to the user's account, viewing confidential information such as full name, CPF, address, and financial details.

What the attacker needed

Victim clicks a link; victim logs in

The fix

The vulnerability was fixed according to the timeline.

How it was found

  1. Identify the authentication URL with a redirect_uri parameter.
  2. Change the redirect_uri value to a malicious URL.
  3. Enter valid credentials and log in.
  4. Observe that the user is redirected to the malicious URL with a code parameter appended.
  5. Capture the code parameter, which is the session token.

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 write-up has not been written yet. The Original tab links to the source.

When you log in to a website, it often sends you back to where you came from using a 'redirect' link. If the site doesn't check where it's sending you, an attacker can make it send you to their own site instead. Here, the site also included a secret code (session token) in that redirect, so the attacker could steal the code and use it to log in as you.

What is Open redirect?

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.

Similar reports

View all

Same bug class and techniques, clearest first.

Open redirect

The lesson behind this report.

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.