Hijacking User Privileges: The Story of a Patched Vulnerability in Open Bug Bounty
A contact form on a shopping site stored the user's email and password in cookies, and the server trusted those cookie values without checking them. By changing the email cookie, an attacker could send messages to the site administrator while pretending to be another user.
Published on take0verx0.medium.com
After enjoying a day of festivities and relaxation with friends on Eid-ul-Adha, I was feeling the effects of a hearty meal. As the evening settled in, I decided to channel my energy into something productive.
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 used user-controlled cookie values (email and password) as the identity of the user without validating them server-side.
Impact
An attacker could impersonate another user and send messages to the site administrator as that user; the same issue was also seen while buying diamonds.
What the attacker needed
Victim's email known; ability to intercept requests
How it was found
- Browse to the contact page and fill in the form.
- Intercept the resulting POST request and inspect the cookies.
- Notice the email and password are stored in cookies.
- Edit the email cookie to another user's address and forward the request.
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, the site usually gives your browser a random code so it can remember you. Here the site instead put your email address and password into cookies, which are small pieces of data your browser sends back on every request. Because the server believed whatever email was in the cookie, anyone could edit it and act as a different person.
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.