I Was Logged Out — But the API Still Trusted Me
The logout endpoint did not invalidate JWTs, and the dashboard API response was cached publicly without varying on a custom header, so an attacker could reuse a token after logout and potentially serve one user's cached data to another.
infosecwriteups.com
Published on infosecwriteups.com
Free Link🎈
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 logout endpoint did not revoke JWTs and the dashboard response was marked publicly cacheable without including the custom header in the Vary header.
Impact
An attacker could access a user's dashboard data after logout and potentially retrieve another user's cached data without authentication.
What the attacker needed
A valid user account; ability to send custom headers
The fix
The logout endpoint should invalidate JWTs, and authenticated responses should not be publicly cacheable or should include the custom header in the Vary header.
How it was found
- Log in and obtain a JWT.
- Call the logout endpoint and receive a 200 OK.
- Reuse the same JWT to request the dashboard summary.
- Observe that the authenticated response is returned.
- Send an authenticated request with a custom client-type header.
- Send the same request without authentication and receive the same cached response.
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 out, the app should stop trusting your session token. Here, the token kept working, and the server also told caches to store the private dashboard response publicly. That means someone else might see your data without logging in.
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.