An Unusual Bug ๐ on Braintree [PayPal]
A JavaScript snippet on braintreepayments.com read a 'locale' query parameter and stored its first five characters in the browser's local storage. On later visits, if the stored value differed from the current locale, the site redirected the user to a path built from that stored value, so an attacker could craft a link that left the victim stuck on an unwanted page.
Published on blog.usejournal.com
https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3d01NemOfuEKiMzbLU%2Ftwitter%2Fiframe&url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3d01NemOfuEKiMzbLU%2Fgiphy.mp4&image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3d01NemOfuEKiMzbLU%2Fgiphy.gif&key=a19fcc184b9711e1b4764040d3dc5c07&type=text%2Fhtmlโฆ
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the site trusted a user-controlled query parameter, stored it in local storage, and later used it to build a redirect target without validating that the value was a legitimate locale.
Impact
An attacker could mass-exploit the issue by running a public ad campaign with the crafted link, leaving users unable to use braintreepayments.com until they clear the browser's JavaScript cache.
What the attacker needed
Victim visits a crafted link; victim's browser stores the value; victim does not clear browser storage
The fix
The issue was resolved according to the timeline.
How it was found
- Visit braintreepayments.com with a 'locale' query parameter whose value is not 'en-us'.
- The script saves the first five characters of that value in the browser's local storage.
- On later visits, if the stored value differs from the current locale, the site redirects the user to a path built from the stored value.
- The user remains redirected to that path even when clicking links such as 'Log in' or trying to sign up for a Sandbox Account.
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 write-up has not been written yet. The Original tab links to the source.
The website had a small script that remembered a language setting from the web address in the browser's local storage. If that remembered value did not match the site's normal language, the site sent the visitor to a page named after it. Because anyone can put anything in a link, an attacker could make the site send visitors to a page of their choosing, and the visitor would keep being sent there until they cleared the browser's storage.
What is Open redirect?
A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.