How I Bypassed Authentication And Earned a 300$ Bounty
The application stored its authentication state in browser localStorage, which the user could edit. By inserting a crafted object with a fake session key and admin role, the attacker gained access to the internal dashboard and could manage users and groups.
medium.com
Published on medium.com
Hello everyone, in this article I will be sharing a detailed walkthrough of an authentication bypass vulnerability I identified during my testing of a public program on Bugcrowd.
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 trusted client-side authentication state stored in localStorage without server-side validation.
Impact
The attacker could view, edit, and delete users, and create, manage, and delete groups, effectively bypassing SSO authentication.
What the attacker needed
Access to the target subdomain; ability to edit localStorage in browser
How it was found
- Collected subdomains and ran Eyewitness on them.
- Manually tested each subdomain and picked one with an SSO login dashboard.
- Analyzed the JavaScript files loaded by the application.
- Noticed the app stored authentication state in localStorage.
- Opened developer tools console and used localStorage.setItem() to insert a crafted authentication object.
- Refreshed the page and gained access to the dashboard.
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.
Websites often keep login information in the browser, such as in localStorage, which is a small storage area on your computer. If the site trusts that stored data without checking with the server, anyone can change it to pretend to be an admin. Here, the tester edited the stored login data and refreshed the page to get in.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.