Get all instacart emails - missing rate limit on /accounts/register
The account registration endpoint returned a different error when an email was already registered, and it had no rate limit, so an attacker could send unlimited requests to check whether any email address had an Instacart account. This allowed building a list of registered users' email addresses.
- Fixed in 6 days
- Paid in 26 days
- Disclosed after 56 days
Hey Instacart team,
When signing up for an account, you enter your email. When this email is already in use, the server responds with "{"errors":{"email":["has already been taken"]}}" This in not a problem, but the fact that you could send this request unlimited times is the issue.
This way we can easily get a list of all users emails signed up at Instacart.
###PoC Send this POST request to "https://www.instacart.com/accounts/register"
POST /accounts/register HTTP/1.1 Host: www.instacart.com User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0 Accept: application/json, text/javascript, /; q=0.01 Accept-Language: en-US,en;q=0.5 X-CSRF-Token: /KCdKtn9A4Oaf7/MAlc/ixhz4h4IPuxEWLRBcAg/heMpt3kcLiMYDZ9ZUnLcHtA5SR+fDrJVorqIuO0h9zr/uQ== Content-Type: application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With: XMLHttpRequest Referer: https://www.instacart.com/ Content-Length: 316 Cookie: build_sha=31340a4bf316c78fff58fe0f5ed3b92ad2c591dc; ahoy_visitor=8ca5f95a-239e-4853-bd06-3f4461c67ae1; ahoy_visit=5493572a-38ab-4bea-ab80-9c005fa2e94b; _instacart_session=Your_Session_Here; ajs_user_id=null; ajs_group_id=null; ajs_anonymous_id=%22c00a35c4-3997-4dc9-841c-85655de95dea%22 DNT: 1 Connection: close
user%5Bsource%5D=web&user%5Bremember_me%5D=1&user%5Bzip_code%5D=22222&user%5Bfirst_name%5D=test&user%5Blast_name%5D=test&user%5Bemail%5D=The_Email_Here&user%5Bpassword%5D=&read_terms=true&authenticity_token=%2FKCdKtn9A4Oaf7%2FMAlc%2Fixhz4h4IPuxEWLRBcAg%2FheMpt3kcLiMYDZ9ZUnLcHtA5SR%2BfDrJVorqIuO0h9zr%2FuQ%3D%3D
The password field is left empty on purpose, so that when the email is not in use, no account will be made.
If the email exists, this will be the response: "{"errors":{"email":["has already been taken"],"password":["can't be blank"]}}"
When the email doesn't exist in the database, then this will be returned: "{"errors":{"password":["can't be blank"]}}"
###Fix
to fix this issue, you could implement an timeout after a number of requests in a period of time. just like it is implemented here: https://www.instacart.com/accounts/password this returns "429 Too Many Requests" when making multiple requests in a short period of time.
If you have any questions, feel free to ask them ;) @003random
Context
Instacart's sign-up flow at www.instacart.com asks a new visitor for an email address, along with a first name, last name, zip code and password. The registration endpoint is POST /accounts/register. When the submitted email is already tied to an account, the server answers with a JSON validation error saying the email has already been taken. That behaviour is normal and useful: it tells a person signing up that they should log in instead.
The problem the researcher found is not the error message itself but the absence of any limit on how often the endpoint can be called. Because the endpoint answers differently depending on whether an email exists, and because nothing throttles repeated calls, the registration form becomes an oracle for checking whether any given email address has an Instacart account.
Setup
The only precondition is the ability to send a registration request, which any visitor can do. The proof of concept uses a captured browser request, including a CSRF token and session cookies, and the researcher notes that the password field is deliberately left empty so that no account is created when the email turns out to be unused.
Finding it
While signing up, the researcher observed that submitting an email that is already registered produces this response:
{"errors":{"email":["has already been taken"]}}
On its own that is expected. What stood out was that the same request could be sent an unlimited number of times. With no rate limit in place, the difference between the response for a known email and the response for an unknown one can be queried at will, which allows an attacker to build a list of all email addresses signed up at Instacart.
Exploitation
Step 1: capture the registration request
The researcher sends the following POST request to https://www.instacart.com/accounts/register:
POST /accounts/register HTTP/1.1
Host: www.instacart.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
X-CSRF-Token: [redacted]
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: https://www.instacart.com/
Content-Length: 316
Cookie: build_sha=[redacted]; ahoy_visitor=[redacted]; ahoy_visit=[redacted]; _instacart_session=[redacted]; ajs_user_id=null; ajs_group_id=null; ajs_anonymous_id=[redacted]
DNT: 1
Connection: close
user%5Bsource%5D=web&user%5Bremember_me%5D=1&user%5Bzip_code%5D=22222&user%5Bfirst_name%5D=test&user%5Blast_name%5D=test&user%5Bemail%5D=__The_Email_Here__&user%5Bpassword%5D=&read_terms=true&authenticity_token=[redacted]
The body is form-encoded. The fields that matter for the check are user[email], which carries the address being tested, and user[password], which is left empty on purpose. The remaining fields (user[source], user[remember_me], user[zip_code], user[first_name], user[last_name], read_terms) are the ordinary registration parameters. The request also carries a CSRF token in both the X-CSRF-Token header and the authenticity_token body field, plus the session and analytics cookies set by the site.
Step 2: send it with an existing email
When the email is already in use, the server responds with both validation errors:
{"errors":{"email":["has already been taken"],"password":["can't be blank"]}}
The email error is the signal that the address exists. The password error appears because the password field was intentionally left empty.
Step 3: send it with an unknown email
When the email is not in the database, the email error is absent and only the password complaint remains:
{"errors":{"password":["can't be blank"]}}
That difference is the whole oracle: presence of the email key means the address is registered, its absence means it is not. Because the password is blank, no account is created in the second case, so the check can be repeated without side effects.
Step 4: repeat at scale
The researcher's point is that the request can be sent unlimited times, which would allow building a list of all users' emails signed up at Instacart.
Root cause
The registration endpoint performs a uniqueness check on the email and reflects the result in its JSON error response, but it applies no throttling to repeated submissions. The design mistake is the combination: a response that distinguishes existing from non-existing addresses, exposed on an endpoint that accepts an unbounded number of requests. The report notes that the password page returns 429 Too Many Requests, while the registration endpoint does not.
Impact
An attacker can determine, for any email address, whether it belongs to an Instacart account, and can do so for as many addresses as they like. Applied to a list of addresses, this produces a list of all users' emails signed up at Instacart. The report frames the exposure in those terms: enumeration of the user base by email address. It does not describe any further access to accounts or data beyond that enumeration.
Fix
The researcher's recommendation is to implement a timeout after a number of requests within a period of time. As a model, the report points to the password page at https://www.instacart.com/accounts/password, which returns 429 Too Many Requests when multiple requests are made in a short period. Applying the same kind of rate limiting to /accounts/register would remove the ability to query the endpoint at scale.
Variants to test
- Other registration and sign-up endpoints. Submit an existing and a non-existing email to any account creation form and compare the JSON or HTML error bodies. A positive result is a response that differs only in a field indicating the email is taken, with no throttling after many repetitions.
- Password reset and login forms. The report cites the password page as already rate limited, but the same enumeration logic applies wherever a form reveals whether an address exists. A positive result is a distinguishable response for known versus unknown addresses combined with no
429after repeated attempts. - Invitation and referral forms. Any feature that checks an email against the user table can leak the same signal. A positive result is a validation message that confirms the address is already registered.
- Timing as a side channel. Where the response body is identical, measure response times for existing and non-existing addresses. A positive result is a consistent, measurable difference that survives repetition.
Hunting notes
This class of bug tends to hide in account lifecycle endpoints: registration, password reset, invitation, and any form that validates an email against the user table. During recon, the signals are JSON validation errors that name the field (has already been taken, not found, already registered) and endpoints that answer quickly and identically on every call with no 429 or Retry-After appearing. Comparing a site's endpoints against each other helps: if one form throttles and another does not, the unthrottled one is worth a closer look, which is exactly how this report frames its fix. The impact case here rests on two things: the two distinct responses, and the researcher's statement that the request can be repeated without limit while leaving the password blank so no account is created. That combination, an enumeration oracle plus no rate limit, is what makes the finding worth reporting rather than a cosmetic error message.
What happened, in plain words
Instacart is an online grocery service. To use it, you create an account with an email address, a first name, a last name, a zip code and a password. When you type an email that is already registered, the site tells you so: it says the email has already been taken. That message is helpful and completely normal, because it tells a returning customer to log in instead of signing up again.
The problem the researcher found is not the message. It is that the sign-up form will answer that question as many times as anyone asks, with no limit. Because the answer is different depending on whether an email exists, and because nothing slows down repeated asking, the form can be used as a checking machine: feed it email addresses one by one and read the reply to learn which ones have an Instacart account. Do that over a long list and you end up with a list of all users' emails signed up at Instacart.
A few words before we start, because they come up constantly:
- Endpoint: a specific address on a website that does one job, like a particular counter in a large shop.
POST /accounts/registeris the counter where new accounts are handed in. - API: the part of a website that answers requests from software rather than drawing a page for a human. When a form is submitted, the browser talks to the API behind it.
- JSON: a simple text format for structured data, built from names and values in curly braces. It is how many APIs reply.
- Cookie: a small piece of text a website stores in your browser so it can recognise you on the next request, like a cloakroom ticket.
- Token: a value that proves a request is legitimate, usually generated by the site and required with each submission. A CSRF token is one that proves the request came from the site's own pages and not from somewhere else.
- Rate limit: a cap on how many requests you may make in a period of time, like a bouncer who lets you in a few times but stops you after that.
- Enumeration: going through a list item by item to find out which ones are real. Here, checking email addresses to see which are registered.
Context
The sign-up flow at www.instacart.com asks a new visitor for an email address, a first name, a last name, a zip code and a password. The registration endpoint is POST /accounts/register. When the submitted email is already tied to an account, the server answers with a JSON validation error saying the email has already been taken. That behaviour is normal and useful: it tells a person signing up that they should log in instead.
The problem the researcher found is not the error message itself but the absence of any limit on how often the endpoint can be called. Because the endpoint answers differently depending on whether an email exists, and because nothing throttles repeated calls, the registration form becomes an oracle for checking whether any given email address has an Instacart account. An oracle here means simply a thing you can ask a yes or no question, and whose answer you can trust.
Setup
The only precondition is the ability to send a registration request, which any visitor can do. The proof of concept uses a captured browser request, including a CSRF token and session cookies, and the researcher notes that the password field is deliberately left empty so that no account is created when the email turns out to be unused.
A proof of concept (PoC) is a small demonstration that shows a problem is real, rather than just theoretical. Capturing a request means recording exactly what your browser sent to the site, so you can send the same thing again yourself. The request carries the cookies and token that the site had handed to that browser.
Finding it
While signing up, the researcher observed that submitting an email that is already registered produces this response:
{"errors":{"email":["has already been taken"]}}
Read this line by line:
- The outer curly braces hold one object, a bundle of named values.
"errors"is the name of the only entry. Its value is another bundle, nested inside.- Inside that bundle,
"email"is the name of a problem, and its value is a list (the square brackets) containing one message:"has already been taken".
In plain words: the server is saying "there is a problem with the email field, and the problem is that this email is already in use".
On its own that is expected. What stood out was that the same request could be sent an unlimited number of times. With no rate limit in place, the difference between the response for a known email and the response for an unknown one can be queried at will, which allows an attacker to build a list of all email addresses signed up at Instacart.
Exploitation
Step 1: capture the registration request
The researcher sends the following POST request to https://www.instacart.com/accounts/register:
POST /accounts/register HTTP/1.1
Host: www.instacart.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
X-CSRF-Token: [redacted]
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: https://www.instacart.com/
Content-Length: 316
Cookie: build_sha=[redacted]; ahoy_visitor=[redacted]; ahoy_visit=[redacted]; _instacart_session=[redacted]; ajs_user_id=null; ajs_group_id=null; ajs_anonymous_id=[redacted]
DNT: 1
Connection: close
user%5Bsource%5D=web&user%5Bremember_me%5D=1&user%5Bzip_code%5D=22222&user%5Bfirst_name%5D=test&user%5Blast_name%5D=test&user%5Bemail%5D=__The_Email_Here__&user%5Bpassword%5D=&read_terms=true&authenticity_token=[redacted]
This is an HTTP request, the standard text a browser sends to a web server. Line by line:
POST /accounts/register HTTP/1.1is the first line: the method (POST, meaning "here is some data for you"), the path of the endpoint, and the version of the protocol.Host: www.instacart.comnames the site being talked to.User-Agent: ...identifies the browser that made the request, here Firefox 56 on Windows.Accept: ...says which kinds of reply the browser will accept, in this case JSON and similar formats.Accept-Language: en-US,en;q=0.5states the preferred language, English (US).X-CSRF-Token: [redacted]is the anti-forgery token, proving the request came from the site's own page. It is a secret value, so it is hidden here.Content-Type: application/x-www-form-urlencoded; charset=UTF-8says the body is a form, encoded in the usualname=value&name=valuestyle.X-Requested-With: XMLHttpRequestmarks the request as one made by the page's own scripts rather than by typing a URL.Referer: https://www.instacart.com/says which page the request came from.Content-Length: 316is the size of the body in bytes.Cookie: ...carries the small pieces of text the site had stored in the browser: a build identifier, two analytics identifiers (ahoy_visitor,ahoy_visit), the session cookie_instacart_session, and some analytics values. All of these are hidden here because they identify a real session.DNT: 1is the "do not track" preference.Connection: closeasks the server to close the connection after replying.- The blank line separates the headers from the body.
- The body is the form itself:
user%5Bsource%5D=web&user%5Bremember_me%5D=1&user%5Bzip_code%5D=22222&user%5Bfirst_name%5D=test&user%5Blast_name%5D=test&user%5Bemail%5D=__The_Email_Here__&user%5Bpassword%5D=&read_terms=true&authenticity_token=[redacted].
The body is form-encoded. The fields that matter for the check are user[email], which carries the address being tested, and user[password], which is left empty on purpose. The remaining fields (user[source], user[remember_me], user[zip_code], user[first_name], user[last_name], read_terms) are the ordinary registration parameters. The request also carries a CSRF token in both the X-CSRF-Token header and the authenticity_token body field, plus the session and analytics cookies set by the site.
A note on the odd-looking %5B and %5D: those are the encoded forms of the square brackets [ and ]. Browsers encode certain characters so they can travel safely inside a URL-style body. So user%5Bemail%5D is really user[email], a field named email inside a group named user. The & signs separate one field from the next, and user%5Bpassword%5D= has nothing after the equals sign, which is exactly the empty password the researcher wanted.
Step 2: send it with an existing email
When the email is already in use, the server responds with both validation errors:
{"errors":{"email":["has already been taken"],"password":["can't be blank"]}}
This is the same structure as before, now with two entries inside the errors bundle. "email" says the address is taken. "password" says the password cannot be blank. The email error is the signal that the address exists. The password error appears because the password field was intentionally left empty.
Step 3: send it with an unknown email
When the email is not in the database, the email error is absent and only the password complaint remains:
{"errors":{"password":["can't be blank"]}}
Now the errors bundle has a single entry. There is no email entry at all, because the server found nothing wrong with the address: nobody has registered it.
That difference is the whole oracle: presence of the email key means the address is registered, its absence means it is not. Because the password is blank, no account is created in the second case, so the check can be repeated without side effects. In other words, the researcher deliberately sends an incomplete sign-up so that the server stops at the validation stage and never actually creates anything.
Step 4: repeat at scale
The researcher's point is that the request can be sent unlimited times, which would allow building a list of all users' emails signed up at Instacart. "At scale" just means doing it many thousands of times automatically instead of by hand, which is only possible because nothing blocks the repetition.
Root cause
The registration endpoint performs a uniqueness check on the email and reflects the result in its JSON error response, but it applies no throttling to repeated submissions. The design mistake is the combination: a response that distinguishes existing from non-existing addresses, exposed on an endpoint that accepts an unbounded number of requests. The report notes that the password page returns 429 Too Many Requests, while the registration endpoint does not.
A root cause is the underlying reason a problem exists, as opposed to its visible symptom. Here the symptom is the error message; the root cause is the missing limit combined with a reply that gives away the answer.
Impact
An attacker can determine, for any email address, whether it belongs to an Instacart account, and can do so for as many addresses as they like. Applied to a list of addresses, this produces a list of all users' emails signed up at Instacart. The report frames the exposure in those terms: enumeration of the user base by email address. It does not describe any further access to accounts or data beyond that enumeration.
Fix
The researcher's recommendation is to implement a timeout after a number of requests within a period of time. As a model, the report points to the password page at https://www.instacart.com/accounts/password, which returns 429 Too Many Requests when multiple requests are made in a short period. Applying the same kind of rate limiting to /accounts/register would remove the ability to query the endpoint at scale.
429 Too Many Requests is a standard status code: the server is saying "you have asked too often, slow down". The password page already behaves this way, so the fix is to make the registration endpoint behave like it.
Variants to test
- Other registration and sign-up endpoints. Submit an existing and a non-existing email to any account creation form and compare the JSON or HTML error bodies. A positive result is a response that differs only in a field indicating the email is taken, with no throttling after many repetitions.
- Password reset and login forms. The report cites the password page as already rate limited, but the same enumeration logic applies wherever a form reveals whether an address exists. A positive result is a distinguishable response for known versus unknown addresses combined with no
429after repeated attempts. - Invitation and referral forms. Any feature that checks an email against the user table can leak the same signal. A positive result is a validation message that confirms the address is already registered.
- Timing as a side channel. Where the response body is identical, measure response times for existing and non-existing addresses. A positive result is a consistent, measurable difference that survives repetition. A side channel is information leaked indirectly, for example by how long a reply takes rather than by what it says.
Hunting notes
This class of bug tends to hide in account lifecycle endpoints: registration, password reset, invitation, and any form that validates an email against the user table. During recon, the signals are JSON validation errors that name the field (has already been taken, not found, already registered) and endpoints that answer quickly and identically on every call with no 429 or Retry-After appearing. Retry-After is a header a server can send to say how long to wait before trying again. Comparing a site's endpoints against each other helps: if one form throttles and another does not, the unthrottled one is worth a closer look, which is exactly how this report frames its fix. The impact case here rests on two things: the two distinct responses, and the researcher's statement that the request can be repeated without limit while leaving the password blank so no account is created. That combination, an enumeration oracle plus no rate limit, is what makes the finding worth reporting rather than a cosmetic error message.
Glossary
- API: the part of a website that answers requests from software, such as a form submission, rather than drawing a page for a person.
- Cookie: a small piece of text a site stores in your browser so it can recognise you on later requests.
- CSRF token: a value generated by a site and required with a submission, to prove the request came from the site's own pages.
- Endpoint: a specific address on a website that performs one job, such as handling new account sign-ups.
- Enumeration: going through a list item by item to learn which entries are real, here checking which email addresses are registered.
- Form-encoded: a way of packing form fields into a request body as
name=valuepairs joined by&. - HTTP request: the standard text a browser sends to a web server to ask for something or submit data.
- Impact: the practical harm a problem can cause.
- JSON: a text format for structured data made of names and values in curly braces, with lists in square brackets.
- Oracle: something you can ask a yes or no question and whose answer you can trust, used here to test whether an email exists.
- POST: an HTTP method meaning "here is some data for you", used when submitting a form.
- Proof of concept (PoC): a small demonstration that shows a problem is real rather than theoretical.
- Rate limit: a cap on how many requests may be made in a period of time.
- Recon: the exploratory phase of looking at a site to find things worth testing.
- Retry-After: a response header telling the client how long to wait before trying again.
- Root cause: the underlying reason a problem exists, as opposed to its visible symptom.
- Session: a period during which a site recognises you as the same visitor, usually via a session cookie.
- Side channel: information leaked indirectly, for example through response timing rather than response content.
- Throttling: deliberately slowing down or blocking repeated requests.
- Token: a value that proves a request is legitimate, usually generated by the site.
- 429 Too Many Requests: a standard HTTP status code meaning the client has asked too often and should slow down.
- Validation error: a message from a server saying a submitted field is not acceptable, such as an email already in use.