Skip to content
IDOR Write-up Beginner

# How a Misconfigured API Endpoint Helped Me Earn a $$$ Bounty

The API endpoint for user badges accepted POST requests with a badgeId and no proper authorisation checks, allowing a user to award themselves any badge without earning it. The attacker could add arbitrary badges to their account.

medium.com

Published on medium.com

Hey everyone, I’m R3DD. I’ve been into cybersecurity for almost 2 years now, and recently started bug bounty hunting.

R3DD, 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 API endpoint lacked proper authorisation checks and allowed all HTTP methods, so a POST request with a badgeId could award a badge without verifying the user's entitlement.

Impact

An attacker could award themselves any badge without earning it, potentially affecting the integrity of the badge system.

What the attacker needed

A user account; ability to send API requests

The fix

The API should enforce proper authorisation checks and restrict HTTP methods to only those necessary.

How it was found

  1. Send an OPTIONS request to /api/user-badges to see which HTTP methods are allowed.
  2. Change the GET request to /api/user-badges into a POST request.
  3. Observe the error message saying badgeId is required.
  4. Add an Authorization bearer token and set Content-Type to application/json.
  5. Obtain a badgeId from the /api/badges response and send it in a POST request to /api/user-badges.
  6. Refresh the website to see the badge added to the 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.

An API is a way for programs to talk to each other. Here, the website's badge system let a user send a request to give themselves a badge, even though they hadn't earned it. The server didn't check if the user was allowed to do that.

What is IDOR?

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.