Skip to content
SQL injection Disclosed report Beginner

SQL injection in partner id field on https://www.teavana.com (Sign-up form)

The partner ID field on the sign-up form was vulnerable to SQL injection, allowing an attacker to bypass validation by injecting a tautology. This let the attacker create a shopping account without a valid partner ID.

bigbug Follow

Originally disclosed on HackerOne

Medium 5.3 View original
  • Triaged in 7 days
  • Fixed in 4 months
  • Paid in 57 days
  • Disclosed after 4 months

While signing up for "teavana" shopping account on it came to notice that the partner id validation fails and exists SQL injection.

So this is what I did:

  1. Visit https://www.teavana.com/us/en/account
  2. Click on signin > create shopping account
  3. In the partnerno, gave an input of "1234" (1.PNG) Result :No issue as expected . Signup fails message: "We are unable to verify starbucks partner id" (2 .PNG)
  4. Changed input to "1234' OR 1=1" (without double qoutes) (3.PNG) Result: This time signup succeeds!!! (4.PNG)

The original report as published on HackerOne, by bigbug. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

The target is the sign-up flow for a shopping account on www.teavana.com, reached through the Starbucks bug bounty program. The researcher, bigbug, found that the partner id field on the account creation form did not validate its input properly and was vulnerable to SQL injection. The report was rated medium severity with a CVSS score of 5.3 and disclosed on 23 January 2018.

The steps were short and direct:

  1. Visit https://www.teavana.com/us/en/account.
  2. Click sign in, then create a shopping account.
  3. Enter 1234 in the partnerno field.
Text
1234

As expected, the sign-up failed with the message "We are unable to verify starbucks partner id".

  1. Change the input to the following payload, without the double quotes:
Text
1234' OR 1=1

This time the sign-up succeeded.

The report stops there. It does not describe the request itself, the server response, any database error, the backend query, or what data the injection could reach. It also gives no fix details and no bounty amount.

Root cause

The report points to a validation failure in the partner id check. The value typed into the form is likely placed into a SQL query that decides whether the partner id exists, and the query is likely built by string concatenation rather than with parameter binding. The single quote in the payload closes the string literal, and OR 1=1 turns the lookup condition into one that is always true, so the check passes for any input. The report does not show the query, so the exact construction is inferred from behaviour, not observed.

Impact

In the report's own terms, the consequence is that the partner id verification can be bypassed: an account is created even though the supplied partner id is not valid. That is a business-logic bypass on top of the injection. Because the same input reaches a SQL query, an attacker could likely go further than a boolean bypass, for example by extracting data or altering query logic, but the report does not demonstrate any of that. The demonstrated impact is limited to defeating the partner id check during sign-up.

How this kind of bug works

SQL injection happens when untrusted input is interpreted as part of a SQL statement instead of as data. If an application assembles a query by joining fixed text with user input, any quote, comment marker or boolean operator in the input changes the structure of the query. In a lookup such as checking whether an identifier exists, an always-true condition makes the lookup succeed regardless of the value supplied.

The classic defences are parameterised queries (prepared statements), where the input is bound as a value and never parsed as SQL, and stored procedures written the same way. Input validation and allow-lists help as a second layer, for example accepting only digits for a numeric partner id, but they are not a substitute for parameterisation. Least-privilege database accounts limit what a successful injection can reach, and generic error handling avoids leaking query details that make exploitation easier.

How to test for it

Look for fields whose value is clearly used in a backend lookup: partner ids, referral codes, coupon codes, employee numbers, invitation tokens, and any "verify" step in a sign-up or checkout flow. These are attractive because the application must query a database to decide whether the value is valid.

A practical method:

  1. Establish a baseline with a known-invalid value and record the exact failure response, status code and message.
  2. Send a value with a single quote appended and compare. A different error, a server error, or a changed message is a signal.
  3. Try boolean pairs that should behave differently if the input is interpreted as SQL, for example a true condition and a false condition built on the same prefix, and compare the two responses.
  4. If the response differs consistently between the true and false variants, you have evidence of injection. Confirm with a benign, non-destructive payload that changes behaviour without touching data.

A positive result looks like a response that changes with the logical structure of the payload rather than with the literal string, such as a verification step that succeeds for an invalid identifier. Common false positives are client-side validation differences, caching, rate limiting, or a generic error page that appears for many malformed inputs. Repeat each test and vary only the payload to rule these out. Keep payloads minimal and avoid anything that could modify or delete data.

How it is fixed

Rebuild the partner id lookup with parameterised queries so the input is bound as a value. Add server-side validation that accepts only the expected format, such as digits of a fixed length, and reject everything else before it reaches the database. Run the application's database account with the minimum privileges needed for the lookup, and return a single generic failure message rather than database errors. After the fix, retest the original payload and the boolean variants to confirm the verification step no longer succeeds for invalid input.

Hunting notes

This bug class tends to hide in secondary flows that developers treat as simple checks: partner and affiliate ids, promo codes, referral links, gift card numbers, and any "verify your membership" step. These fields often sit outside the main authentication code and receive less review.

Recon signals worth following are parameters whose names suggest an identifier (partner, member, ref, code, id) and endpoints that return distinct messages for valid and invalid values, since a distinct message means the server is making a decision based on the input. Sign-up and checkout flows are good places to start because they combine user input with database lookups.

To get a report accepted, show the before-and-after behaviour clearly: the invalid value failing and the payload succeeding. Keep the demonstration to a boolean bypass or a harmless proof, and explain the business impact, such as bypassing a partner-only restriction. Avoid extracting real data; a minimal proof that the query logic can be influenced is usually enough, and it keeps the test safe for the target.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 6 min read.

What happened, in plain words

The shopping site www.teavana.com sat under the Starbucks bug bounty program. A bug bounty program is a scheme where a company invites outside researchers to look for security problems in its systems and pays for good findings. The researcher here, bigbug, was looking at the sign-up page where a new customer creates a shopping account.

That sign-up form had a field called partnerno, short for partner number. The site checks the number typed into the field before letting the customer register. To do that check, the site has to ask its database, the store of records behind the website, whether that number exists.

The researcher found that this check could be fooled. By typing a specially crafted value instead of a plain number, the sign-up went through even though the partner number was not valid. The report was rated medium severity with a CVSS score of 5.3. CVSS is a standard scoring system for how serious a security flaw is, where a higher number means more risk. The report was disclosed on 23 January 2018.

What the report shows

The target is the account creation flow on www.teavana.com. The researcher's steps were short:

  1. Visit https://www.teavana.com/us/en/account.
  2. Click sign in, then create a shopping account.
  3. Enter 1234 in the partnerno field.
Text
1234

This is the normal, honest case: a made-up number that should not exist. As expected, the sign-up failed with the message "We are unable to verify starbucks partner id". Recording this baseline matters, because you cannot show that something is broken until you know what correct behaviour looks like.

  1. Change the input to the following payload, without the double quotes:
Text
1234' OR 1=1

This time the sign-up succeeded.

Why does that string change anything? The single quote ' is a special character in SQL, the language used to talk to most databases. In SQL, text values are wrapped in single quotes, so a query might look for a partner whose number equals '1234'. When the site pastes what you typed straight into that query, your quote closes the text early. The rest, OR 1=1, is then read as part of the query's logic rather than as part of the number. 1=1 is always true, so the overall condition becomes "the number matches, or something that is always true", which is always true. The database answers yes, and the site lets the sign-up through.

That is SQL injection: user input being treated as instructions to the database instead of as plain data. A useful everyday comparison is a form where you write your name on a line, and someone writes "and also let me into the building" on the same line. If the person reading the form treats the whole line as an instruction, your extra words become a command. The fix is to make clear which part is the name and which part is the instruction.

The report stops there. It does not show the request or response, any database error, the query behind the form, what data the injection could reach, how it was fixed, or any bounty amount.

In general, how this kind of bug works

SQL injection happens when a program builds a database query by gluing fixed text together with whatever the user typed. If the user's text contains a quote, a comment marker or a logical operator, it can change the shape of the query. In a lookup that asks "does this identifier exist?", an always-true condition makes the answer yes no matter what was supplied.

The standard defence is a parameterised query, also called a prepared statement. Here the query is written with a placeholder, and the user's value is handed over separately as data, so it can never be read as SQL. Input validation helps as a second layer, for example accepting only digits for a numeric partner id, but it is not a replacement for parameterisation. Limiting what the database account is allowed to do reduces the damage if an injection does occur, and showing a single generic error message instead of database errors makes the flaw harder to exploit.

In general, how to test for it

Look for fields whose value is clearly checked against a database: partner ids, referral codes, coupon codes, employee numbers, invitation tokens, and any "verify" step in a sign-up or checkout flow. These are interesting because the site must query its database to decide whether the value is valid.

A practical method:

  1. Establish a baseline with a known-invalid value and note the exact failure message.
  2. Send a value with a single quote appended and compare. A different error, a server error or a changed message is a signal.
  3. Try a true condition and a false condition built on the same prefix, and compare the two responses.
  4. If the true and false variants differ consistently, you have evidence of injection. Confirm with a harmless payload that changes behaviour without touching data.

A positive result looks like a response that changes with the logic of the payload rather than with the literal text, such as a verification step that succeeds for an invalid identifier. Common false positives are client-side validation differences, caching, rate limiting, or a generic error page that appears for many malformed inputs. Repeat each test and vary only the payload to rule these out. Keep payloads minimal and avoid anything that could modify or delete data.

In general, how it is fixed

Rebuild the lookup with parameterised queries so the input is bound as a value. Add server-side validation that accepts only the expected format, such as digits of a fixed length, and reject everything else before it reaches the database. Run the database account with the minimum privileges needed for the lookup, and return one generic failure message rather than database errors. After the fix, retest the original payload and the true and false variants to confirm the check no longer succeeds for invalid input.

Glossary

  • Bug bounty program: a scheme where a company invites outside researchers to report security problems in exchange for a reward.
  • SQL: the language used to ask questions of and give instructions to most databases.
  • Database: the organised store of records a website keeps behind the scenes.
  • SQL injection: a flaw where user input is treated as part of a database query instead of as plain data.
  • Payload: the specially crafted value a researcher types in to test for a flaw.
  • Baseline: the normal, expected result recorded before testing, used for comparison.
  • Boolean: a true or false value; 1=1 is a boolean condition that is always true.
  • Parameterised query (prepared statement): a way of writing a query where user values are handed over separately as data and never read as SQL.
  • Input validation: checking that what a user typed matches the expected format before using it.
  • Least privilege: giving a program or account only the minimum access it needs.
  • False positive: a test result that looks like a flaw but is caused by something else, such as caching or a generic error page.
  • CVSS: a standard scoring system for the severity of a security flaw, where a higher number means more risk.
  • Severity: a rating of how serious a flaw is, here medium.
  • Disclosure: the public release of a security report, here on 23 January 2018.

More by bigbug

View all

7 more disclosed reports, best first.

More from Starbucks

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.