Skip to content
Access control Write-up Beginner

Eyeglass Adventures: From Typos to Admin Access — A Hacker’s Tale

The edit profile endpoint accepted a userType field set to admin, granting admin access, and also allowed setting a password via mass assignment. The attacker could then log in as admin by using an OTP code as the password.

khode4li Follow

Published on medium.com

Yo, what’s up fellow hackers! I’m back with another story about my latest finding on this eyeglasses website.

Khod4li, 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 mass assignment: the server blindly accepted and saved extra fields (userType, password) from the profile update request without checking if the user was allowed to change them.

Impact

An attacker could gain admin access to the website and log in as an administrator, potentially controlling the site.

What the attacker needed

A user account; ability to intercept and modify requests

How it was found

  1. Sign up and log in with OTP, then go to the edit profile page.
  2. Intercept the edit profile request and notice the userType field in the response.
  3. Add userType set to admin in the JSON request and send it.
  4. Find the admin panel by adding admin as a subdomain.
  5. Add a password field to the edit profile request and set it to a value.
  6. Log in as admin using the OTP code as the password.

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.

The website let users change their profile, but it also accepted extra fields that should be off-limits, like a field that says whether you are an admin. By adding that field to the request, the user became an admin. The site also let them set a password even though that was not a normal feature, and they could log in using a one-time code as the password.

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.

More by khode4li

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.