Client-side Template Injection in Search, user email/token leak and maybe sandbox escape
An AngularJS template injection in the search field allowed access to the page's AngularJS scope, enabling retrieval of email, userid, and tokens. By manipulating the victim's avatar URL to point to an attacker-controlled server, an attacker could exfiltrate another user's session details via simple GET requests.
- Triaged in 3 days
- Fixed in 50 days
- Paid in 7 days
- Disclosed after 7 months
Summary by the program
In this report, the researcher was able to perform AngularJS Template Injection on our Support site in order to retrieve data, including email address, userid and tokens. Typically, a user is always able to retrieve this information about themselves and on its own, this is known behavior. However, by utilizing a manipulated Avatar URI value, the researcher was able to demonstrate how an attacker could exfiltrate another user's email, userid, and tokens to an external server owned by the attacker. The researcher was further able to demonstrate other types of attacks possible via AngularJS Template Injection, but the most interesting one to us was the data exfiltration POC.
We resolved this issue by updating our version of AngularJS, and by applying the ng-non-bindable directive to the vulnerable fields. This directive prevents AngularJS from compiling or binding the contents of the current DOM element, making it effective at preventing XSS and Code Injection attacks.
Summary by the researcher
Sometimes you don't need a fully-fledged XSS to leak useful data!
An AngularJS template injection was possible in the search field giving me access to the whole AngularJS scope for the page.
By traversing the DOM via childHead / nextSibling objects it was possible to grab informations from the active scope (ie: email, userid, and tokens); subsequently manipulating the victim's avatar URL to a resource on an adversary-controlled server allowed the attacker to exfiltrate session details without strictly relying on Javascript injection, delivering the goodies through simple GET requests.
A sandbox escape was found later on rendering the unorthodox approach unnecessary, but extremely fun nonetheless—also given the fact that Rockstar Games decided scoped this flaw as a Reflected XSS before that happened.
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
Impact
An attacker could exfiltrate another user's email, userid and tokens to an external server.
What the attacker needed
Victim visits a crafted link; attacker controls an external server
The fix
The issue was fixed by updating AngularJS and applying the ng-non-bindable directive to the vulnerable fields.
How it was found
- Inject an AngularJS template expression into the search field.
- Traverse the DOM using childHead and nextSibling to access the active scope.
- Extract email, userid, and tokens from the scope.
- Manipulate the victim's avatar URL to point to an attacker-controlled server.
- Exfiltrate the stolen data via GET requests to that server.
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.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.