Improper Otp Implementation To Full Account Takeover
An OTP endpoint returned the one-time code in its own HTTP response, and the code was not bound to a session, had no enforced expiry, and could be reused. Combined with an email-validation endpoint that confirmed accounts and leaked internal IDs, an unauthenticated attacker could log in as an administrator.
A one-time password (OTP) meant to act as a second authentication factor was returned directly in the body of the HTTP response that triggered its own generation. No interception, no phishing, no SIM-swap — just reading the API’s own response told you the code needed to log in as someone else.
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
The OTP-issuing endpoint returned the generated code in the HTTP response instead of only sending it out-of-band, and the code lacked session binding, expiry, and single-use enforcement.
Impact
An unauthenticated attacker could take over any discoverable account, including an administrator, gaining full control of the platform; no defence such as CSP or a WAF is mentioned as limiting the exploit.
What the attacker needed
No account needed; access to the public API; victim account must be discoverable
The fix
The OTP endpoint should return only a generic acknowledgement, store the code server-side bound to the user and session with a short expiry and single use, and account-lookup endpoints should give generic responses.
How it was found
- Review the production JavaScript bundle to find candidate email addresses.
- Send each email to the email-validation endpoint to confirm which are registered and obtain their internal IDs.
- Request an OTP for a confirmed account; the response body contains the code.
- Submit the leaked OTP as the second factor to complete login for that 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.
A one-time password (OTP) is a short code sent to your email or phone as a second proof of identity after your password. Here the server was supposed to email the code but also put it in the reply to whoever asked, so anyone could read it. The attacker could then use that code to log in as an administrator because the code was not tied to a session and could be reused.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.