When Different Responses Reveal More Than Intended
The OTP login endpoint returned different HTTP statuses and response bodies depending on whether the submitted email address belonged to an existing account, allowing account enumeration. The same endpoint also sent a genuine OTP email on every successful request without any cooldown or throttling, enabling inbox flooding.
medium.com
Published on medium.com
Cybersecurity
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.
Context
Authentication endpoints are among the most security-sensitive parts of any application, and during security testing even a small difference in how an application responds to user input can reveal information that was never intended to be exposed. This write-up covers the methodology behind identifying two related security issues in an OTP authentication flow:
- Account enumeration through observable response differences
- Unrestricted OTP email triggering resulting in inbox flooding
The issue was responsibly reported through a bug bounty program and was later marked as a duplicate of an existing report. The purpose of the article is educational and focuses on the testing methodology, validation process, impact analysis and lessons learned.
The target was an OTP-based authentication flow, specifically an endpoint responsible for initiating the login process using an email address. Conceptually, the endpoint accepted an email address and attempted to initiate an OTP authentication flow.

The first question the researcher wanted to answer was simple: does the application respond differently depending on whether an account exists? That is an important question when testing authentication functionality.
Setup
The report does not describe specific accounts, roles, tools or versions. For the email-flooding test the researcher used a mailbox under their own control. The enumeration test compared an email address associated with an existing account against a randomly generated email address with no associated account.
Finding it
The researcher tested the same request using two different types of identifiers:
- An email address associated with an existing account
- A randomly generated email address with no associated account
The results were different. For an existing account, the server returned a successful response containing authentication-flow information. For an unknown account, the server returned a different HTTP status and an authentication-flow error. Conceptually:
Existing account ↓HTTP 200 ↓Authentication flow created
Unknown account ↓HTTP 400 ↓Authentication flow error
This created what is commonly called an enumeration oracle. An attacker does not need access to account data: simply observing the difference between responses can reveal whether a particular identifier is registered.
Exploitation
Step 1: Compare responses for known and unknown identifiers
The first step was to send the same request with an email address tied to an existing account and with a randomly generated address. The known account produced HTTP 200 with authentication-flow information; the unknown address produced HTTP 400 with an authentication-flow error. That difference is the enumeration oracle.
Step 2: Rule out alternative explanations
A single test is not enough to conclude that account enumeration exists. The different responses could potentially be caused by other factors, such as email-provider restrictions or input validation. To eliminate these possibilities, the researcher tested multiple randomly generated addresses across different email providers and domains. The response remained consistent:
- Known accounts produced the successful response
- Unknown addresses produced the authentication-flow error
The behaviour was stable across repeated requests.
Step 3: Compare with another authentication endpoint
The researcher also compared the behaviour with another authentication endpoint that returned a uniform response for unknown identifiers. This comparison was particularly useful because it demonstrated that the application already used anti-enumeration behaviour elsewhere in its authentication flow.
Step 4: Test OTP email delivery
The same endpoint had another interesting behaviour: every successful request triggered the delivery of a genuine OTP email. The researcher tested this only using a mailbox under their own control, sending multiple requests within a short testing window. The result was straightforward:
Multiple requests ↓Multiple successful responses ↓Multiple unique authentication flows ↓Multiple genuine OTP emails delivered
During the controlled test, each request resulted in another OTP email, with no observable cooldown or throttling preventing repeated delivery. This demonstrates why testing actual consequences is important. Simply saying "there is no rate limit" is often not enough to demonstrate meaningful security impact; instead, the testing showed a measurable outcome: repeated requests could repeatedly trigger legitimate security emails.
Why the combination matters
Each issue has its own security implications, but together they can create a more useful attack path:
Observable response differences ↓Identify potentially valid accounts ↓Target confirmed identifiers ↓Repeatedly trigger OTP emails
The first behaviour can reduce uncertainty about which identifiers belong to real users. The second behaviour can then be abused to generate unwanted authentication emails for those accounts. This is a good example of why individual findings should not always be evaluated completely in isolation.
Root cause
The report does not describe the implementation. Conceptually, the endpoint returned a successful response with authentication-flow information for known accounts and a different HTTP status with an authentication-flow error for unknown ones, so the response itself acted as an oracle. The same endpoint generated and delivered a genuine OTP email on every successful request, with no observable cooldown or throttling. The comparison with another authentication endpoint that returned a uniform response for unknown identifiers showed that the application already used anti-enumeration behaviour elsewhere in its authentication flow.
Impact
The demonstrated issues could contribute to several problems.
Account enumeration
An attacker may be able to determine whether an email address is associated with the platform. This information can potentially be useful for targeted phishing campaigns or other account-targeting activity.
Inbox flooding
Repeated OTP requests can generate multiple legitimate emails within a short period. This can create notification fatigue and make it more difficult for users to distinguish important security messages from unwanted ones.
Increased targeting accuracy
When account enumeration is possible, an attacker can potentially focus on identifiers known to belong to actual users instead of blindly targeting a large list of unknown addresses.
Fix
The mitigations it sets out are:
- Use consistent responses. The application should avoid revealing whether an account exists through differences in HTTP status codes, response bodies, response timing and error messages. Unknown identifiers should produce a response that is indistinguishable from the response used for valid identifiers.
- Apply rate limiting. Rate limits should consider multiple dimensions, including per account or email address, per IP address, and per session or device where appropriate.
- Introduce a cooldown. OTP emails generally do not need to be generated repeatedly within seconds, and a cooldown between requests for the same identifier can significantly reduce abuse.
- Monitor abnormal activity. Repeated authentication requests targeting many identifiers, or excessive requests targeting one identifier, should be detected and investigated.
Variants to test
- Other authentication endpoints in the same flow. Send the same request with a known and an unknown identifier and compare status codes, response bodies, error messages and timing. A positive result is any observable difference that correlates with account existence, especially when other endpoints in the flow return uniform responses.
- Different identifier types. Repeat the comparison across multiple randomly generated addresses and across different email providers and domains. A positive result is a consistent split between known and unknown identifiers rather than a one-off difference caused by provider restrictions or input validation.
- Repeated requests for OTP delivery. Send multiple requests for the same identifier within a short window using a mailbox you control. A positive result is multiple genuine OTP emails delivered with no observable cooldown or throttling.
- Combined path. Confirm an identifier through the response difference, then trigger repeated OTP emails for it. A positive result is a confirmed account that can be made to receive repeated legitimate security emails.
One of the most useful lessons from this research was that authentication testing is not only about searching for authentication bypasses or account takeover vulnerabilities. Small implementation differences can sometimes expose useful information, and a simple question such as "does the application behave differently when the account exists?" can lead to meaningful findings. The most important part is not just identifying a potentially interesting behaviour, but validating it carefully, eliminating alternative explanations, measuring the real-world consequence and reporting the issue responsibly.
What happened, in plain words
A security researcher was testing the login page of a website that lets you sign in by receiving a one-time code (OTP) by email. They noticed that the website answered slightly differently depending on whether the email address they typed in belonged to a real account or not. That difference is enough for someone to work out which email addresses are registered on the site, which is called account enumeration. They also noticed that every time the site accepted a request, it sent a real code email, and nothing seemed to stop someone from asking for many of them in a row, which is called inbox flooding. They reported both issues through a bug bounty program, and the report was later marked as a duplicate of an earlier submission. This article walks through the same steps for someone who has never done security testing before.
The starting point: what an OTP login is
Many websites do not ask for a password. Instead, you type your email address, the site sends a short code to that address, and you type the code back to prove the address is yours. The code is called a one-time password, or OTP, because it is meant to be used once and then thrown away.
The part of the website that handles this is called an endpoint. An endpoint is simply a specific address on the server that accepts a particular kind of request and does a particular job, like a counter in a shop that only deals with one type of transaction. When you fill in a form in your browser and press a button, your browser sends a request to an endpoint, and the endpoint sends back a response.
Responses come with a status code, which is a three-digit number that summarises what happened. You have probably seen 404 when a page does not exist. Two codes matter here:
- 200 means the request succeeded.
- 400 means the server decided the request was not acceptable.
The researcher's target was the endpoint that starts the login process when you give it an email address. The first question they wanted to answer was simple: does the application respond differently depending on whether an account exists?
That question matters because a login form is one of the most sensitive parts of any website. If the form quietly tells strangers which email addresses have accounts, that is information the site never meant to give away.

Finding the difference
The researcher sent the same request twice, changing only the email address:
- Once with an email address that belonged to an existing account.
- Once with a randomly generated email address that belonged to nobody.
The two answers were not the same. For the real account, the server returned a successful response that contained information about the authentication flow, meaning details about the login process it had just started. For the unknown address, the server returned a different status code and an error about the authentication flow.
In shorthand, the two outcomes looked like this:
Existing account ↓HTTP 200 ↓Authentication flow created
Read this line by line. Existing account is the situation being described: the email address typed in belongs to a real user. The arrow ↓ means "which led to". HTTP 200 is the status code the server sent back, the code for success. Authentication flow created means the server went ahead and set up a login attempt for that address.
Unknown account ↓HTTP 400 ↓Authentication flow error
Again line by line. Unknown account is the situation: the email address belongs to nobody. HTTP 400 is the status code, the code for a request the server rejected. Authentication flow error means the server did not set up a login attempt and instead reported a problem.
This pattern has a name: an enumeration oracle. An oracle, in the old sense, is something you ask a question and that gives you an answer. Here the website itself is the oracle. An attacker does not need to break into anything or read any database. They only need to type an address, look at which of the two answers comes back, and they learn whether that address is registered.
Checking that the difference really was about accounts
One test proves very little. The two different answers could have had innocent causes. Perhaps the site treats some email providers differently, or perhaps it rejects addresses that look unusual before it even checks whether an account exists. If that were true, the difference would tell you something about the address format, not about whether an account exists.
To rule those explanations out, the researcher repeated the test with several randomly generated addresses, spread across different email providers and different domains. The pattern held every time:
- Known accounts produced the successful response.
- Unknown addresses produced the authentication-flow error.
The behaviour was stable across repeated requests, so it was not a fluke or a temporary glitch.
The researcher then did something clever: they tried a different authentication endpoint on the same site, one that returned the same answer for unknown identifiers no matter what. That comparison was useful because it showed the site already knew how to avoid leaking this kind of information elsewhere in its login process. That comparison was useful because it showed the site already used anti-enumeration behaviour elsewhere in its login process.
The second finding: code emails on demand
The same endpoint had another behaviour worth noting. Every time a request succeeded, the site sent a genuine OTP email to the address that had been typed in.
The researcher tested this only using a mailbox under their own control. They sent several requests within a short window of time. The result was straightforward:
Multiple requests ↓Multiple successful responses ↓Multiple unique authentication flows ↓Multiple genuine OTP emails delivered
Line by line. Multiple requests means the researcher asked the site to start a login several times. Multiple successful responses means the site said yes each time. Multiple unique authentication flows means each request started its own separate login attempt rather than reusing one. Multiple genuine OTP emails delivered means real code emails arrived in the mailbox, one per request.
During the controlled test, every request produced another email. Nothing visible slowed the researcher down: no cooldown, no limit on how often the same address could be asked for, no throttling. A cooldown is a rule that says "wait a while before trying again". Throttling is a broader version of the same idea, a cap on how many requests are accepted in a period.
This is why testing the actual consequence matters. Saying "there is no rate limit" is a claim about a missing control, and on its own it is often not enough to show that anything bad can happen. A rate limit is a cap on how many requests a client may make in a given time. What the researcher showed instead was a measurable outcome: repeated requests could repeatedly trigger legitimate security emails. That is a fact about the real world, not just about a setting.
Why the two findings belong together
Each issue stands on its own, but together they form a more useful path for an attacker:
Observable response differences ↓Identify potentially valid accounts ↓Target confirmed identifiers ↓Repeatedly trigger OTP emails
Line by line. Observable response differences is the first finding: the site answers differently for real and fake addresses. Identify potentially valid accounts is what that lets someone do: sort a list of addresses into real and fake. Target confirmed identifiers means the attacker now focuses only on the addresses known to belong to real people. Repeatedly trigger OTP emails is the second finding: those confirmed addresses can then be made to receive unwanted code emails over and over.
The first behaviour removes the guesswork about which addresses belong to real users. The second behaviour then turns that knowledge into a nuisance for those users. This is a good example of why findings should not always be judged completely in isolation: two moderate issues can add up to something more useful than either alone.
What harm could come from this
The demonstrated issues could contribute to several problems.
Account enumeration
An attacker may be able to work out whether an email address is associated with the platform. That knowledge can be useful for targeted phishing, where a message is crafted for a specific person and looks more convincing because the sender knows they really do have an account. It can also help with other activity aimed at particular accounts.
Inbox flooding
Repeated OTP requests can generate several legitimate emails within a short period. This creates notification fatigue: when real security emails arrive mixed in with a stream of unwanted ones, users find it harder to tell which messages matter. A person who receives many code emails in a short time may start ignoring all of them.
Better targeting
When account enumeration is possible, an attacker can focus on addresses known to belong to real users instead of blindly sending to a large list of unknown ones. Effort goes where it is more likely to pay off.
How the risk could be reduced
The report sets out four mitigations.
- Use consistent responses. The site should avoid revealing whether an account exists through differences in HTTP status codes, response bodies, response timing or error messages. An unknown identifier should produce a response that cannot be told apart from the response for a valid one. The everyday comparison is a receptionist who says exactly the same sentence whether or not a person works at the company, so that a caller learns nothing from the answer.
- Apply rate limiting. Limits should consider several dimensions: per account or email address, per IP address, and per session or device where appropriate. An IP address is the number that identifies a connection on the internet, roughly like a return address on an envelope. Limiting only one dimension leaves room to work around the others.
- Introduce a cooldown. OTP emails generally do not need to be generated repeatedly within seconds, so a cooldown between requests for the same identifier can significantly reduce abuse. The comparison is a doorbell that will not ring again for a minute after being pressed.
- Monitor abnormal activity. Repeated authentication requests aimed at many identifiers, or excessive requests aimed at one identifier, should be detected and investigated. Detection does not stop the behaviour by itself, but it turns silent abuse into something the defenders can see.
Other places to look for the same pattern
The report lists variants worth testing if you are learning this kind of work.
- Other authentication endpoints in the same flow. Send the same request with a known and an unknown identifier, and compare status codes, response bodies, error messages and timing. A positive result is any observable difference that lines up with whether the account exists, especially when other endpoints in the flow give the same answer regardless.
- Different identifier types. Repeat the comparison across several randomly generated addresses and across different email providers and domains. A positive result is a consistent split between known and unknown identifiers, rather than a one-off difference caused by provider restrictions or input validation.
- Repeated requests for OTP delivery. Send several requests for the same identifier within a short window, using a mailbox you control. A positive result is multiple genuine OTP emails arriving with no visible cooldown or throttling.
- The combined path. Confirm an identifier through the response difference, then trigger repeated OTP emails for it. A positive result is a confirmed account that can be made to receive repeated legitimate security emails.
What to take away
One of the most useful lessons from this research is that authentication testing is not only about hunting for authentication bypasses or account takeover vulnerabilities. Those are the dramatic failures, where someone gets in without permission or takes over someone else's account. Small implementation differences can also expose useful information.
A simple question such as "does the application behave differently when the account exists?" can lead to meaningful findings. The important part is not just spotting an interesting behaviour, but validating it carefully, ruling out alternative explanations, measuring the real-world consequence and reporting the issue responsibly.
This report was ultimately marked as a duplicate of an earlier submission, meaning the issue had already been found and reported independently by someone else. The testing process was still a valuable learning experience, and it shows why carefully analysing authentication workflows is worth the effort.
Glossary
- Account enumeration: working out which email addresses or usernames have accounts on a site by observing how it responds.
- Authentication: the process of proving who you are, usually by logging in.
- Authentication flow: the sequence of steps a site walks you through to log you in.
- Bug bounty program: a scheme where a company invites outside researchers to report security problems, often for a reward.
- Cooldown: a rule that forces a wait before the same action can be repeated.
- Duplicate: a report describing a problem that has already been reported by someone else.
- Endpoint: a specific address on a server that accepts a particular kind of request and performs a particular job.
- Enumeration oracle: any behaviour of a system that answers a question you were not meant to be able to ask, such as whether an account exists.
- HTTP status code: a three-digit number in a response that summarises the outcome, such as 200 for success or 400 for a rejected request.
- Identifier: the piece of information that names an account, here an email address.
- Inbox flooding: filling someone's mailbox with many messages, here genuine OTP emails triggered on demand.
- IP address: the number that identifies a connection on the internet, roughly like a return address on an envelope.
- Notification fatigue: the state of ignoring messages because too many of them arrive, including ones that matter.
- OTP (one-time password): a short code sent to you, meant to be used once to prove you control an address or device.
- Phishing: a message crafted to trick someone into doing something, often made more convincing by personal details.
- Rate limit: a cap on how many requests a client may make in a given period.
- Response body: the content of a reply from a server, as opposed to its status code.
- Response timing: how long a server takes to reply, which can itself reveal information.
- Throttling: slowing down or capping repeated requests, a broader form of rate limiting.
- Validation: checking that a finding is real by repeating it and ruling out innocent explanations.