Skip to content
Cache bugs Write-up Advanced

Explorando uma “Chain”: Cache Poisoning + OpenID Misconfiguration = ATO

A cache stored responses containing authenticated users' session cookies, and the OpenID authorization endpoint accepted arbitrary state and nonce values. An attacker could retrieve a victim's cookies from the cache and use them to obtain a valid JWT, leading to full account takeover.

dk4trin Follow

Published on medium.com

Durante um collab, eu @dk4trin e o Smit Gharat aka @fabrikat0r juntamos nossas forças em um programa privado de bug bounty na plataforma Intigriti, e nos deparamos com um cenário que, à primeira vista, parecia apenas um comportamento estranho de cache. Nada muito alarmante...

Wesley "dk4trin" Santos, on medium.com

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 cache was configured to store responses containing session cookies without distinguishing authenticated from unauthenticated requests, and the OpenID flow failed to validate state and nonce.

Impact

An attacker could obtain a valid JWT for the victim's account, resulting in full account takeover.

What the attacker needed

Victim must be authenticated; attacker must access the cached URL; no special timing required

The fix

The text recommends not caching responses that contain cookies, using Cache-Control: no-store on sensitive endpoints, and validating state and nonce; it does not state that a fix was applied.

How it was found

  1. An unauthenticated user accesses the endpoint with a caching parameter, and the response is cached.
  2. An authenticated user accesses the same endpoint with the same caching parameter.
  3. The server returns a response that includes the authenticated user's session cookies, and this response is also cached.
  4. Anyone who accesses the same URL afterwards receives the cached response containing the victim's cookies.
  5. The attacker uses the stolen cookies to make a request to the OpenID authorization endpoint with arbitrary state and nonce values.
  6. The server accepts the request and issues a valid JWT associated with the victim's account.

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.

A web cache saves copies of pages to serve them faster. Here, the cache saved a page that included a logged-in user's session cookies, so anyone who visited the same URL later got those cookies. Separately, the login system (OpenID) did not check two security values (state and nonce), so the stolen cookies could be turned into a valid login token for the victim's account.

What is Cache bugs?

A cache and the origin disagree about a request, so a poisoned response is served to everyone or a private page is stored as public.

More by dk4trin

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Web cache poisoning and deception

The lesson behind this report.

A cache and the origin disagree about a request, so a poisoned response is served to everyone or a private page is stored as public.