Skip to content
IDOR Write-up Beginner

Cómo una API mal diseñada expuso los datos de todos los usuarios: IDOR, contraseñas en texto plano…

The whoami endpoint accepted a userId parameter and returned user data without authentication, allowing enumeration of MongoDB ObjectIds to extract names and emails. The registration endpoint also returned the plaintext password and email verification token in its response.

C37webak1ix Follow

Published on medium.com

Todos hemos escuchado alguna vez eso de que “la seguridad no es un producto, es un proceso”. También hemos oído que “nunca confíes en la entrada del usuario”, “siempre hashea las contraseñas” y “los mensajes de error no deberían revelar información interna”.

C37webak1ix, 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 endpoint trusted a client-supplied userId instead of deriving the user from the authentication token, and the registration response serialised sensitive fields.

Impact

An attacker could enumerate user IDs to extract names and emails without authentication, and could obtain plaintext passwords and verification tokens from registration responses, enabling account takeover.

What the attacker needed

None for the IDOR; ability to send HTTP requests

The fix

The endpoint was fixed to require authentication and ignore the userId parameter, and the registration response was changed to no longer include the password or verification token.

How it was found

  1. Send a request to the whoami endpoint with a userId parameter and no Authorization header.
  2. Observe that the server returns the user data for that ID without authentication.
  3. Change the userId to another value to retrieve a different user's data.
  4. Send a registration request and observe the response includes the password and verification token.
  5. Use the token in the login URL to verify the account without email access.

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, a user lookup endpoint was supposed to show only your own details, but it let anyone ask for any user's details by changing an ID number, with no login needed. The sign-up response also included the password and verification code, so anyone who saw that response could take over the account.

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.