Logic Flaw in 2FA
An API endpoint that sends a one-time login code by email could be called without first supplying a password, so the password step of the two-factor login could be skipped entirely. The same endpoint also returned a verbose response for unregistered emails, allowing account enumeration.
medium.com
Published on medium.com
Asslamualaiakum kawan, sebenarnya ini bukan kerentanan serius, tapi yang namanya flaw is flaw, dan akan berdampak pada kerentanan lain.
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 magic-link request endpoint was designed as a standalone login path and never enforced that the password step had been completed before issuing the code.
Impact
An attacker who controls the victim's email inbox could log in without knowing the password, and anyone could enumerate which email addresses are registered; the author notes the flaw is not severe on its own but could combine with other issues.
What the attacker needed
Access to the victim's email inbox; knowledge of the victim's email address
How it was found
- Find the endpoint that requests a magic login link.
- Send a request to that endpoint with a registered email address.
- Observe that a one-time code and login link are emailed without any password being supplied.
- Send the same request with an unregistered email and observe the verbose error response.
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.
Many sites protect accounts with two steps: something you know (a password) and something you have (a code sent to your email). Here the site had a separate endpoint that emails a login code, and it did not check that the password step had been completed first. That means the password protection could be bypassed, and the endpoint also revealed whether an email address had an account.
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.