Stored XSS via AngularJS Injection
A referral contact address field rendered user input through an old AngularJS template engine, so a crafted expression was evaluated as code. An attacker with permission to create a contact could store a script that ran in the browser of anyone viewing the contact overview, including an admin.
- Triaged in 4 days
- Fixed in 17 days
- Paid in 5 days
- Disclosed after 17 days
Hi All, I've found a stored XSS vulnerability via an Angular Template Injection in the messages referral address field.
##Description After visiting ``https://1337test.drchrono.com/messages/referrals/contacts/```, you can enter new contact information. In the field for the address, if enter [[5*5]], when the referrals contact overview will show the address as 25. This indicates an injection.
Opening the browser console and using the command angular.version, we can see you are using 1.1.5. So, entering the address for a contact as [[constructor.constructor('alert(document.cookie)')()]], saving and reloading the page, an stored XSS is executed

##Steps to reproduce
- Create a doctors account
- Visit
https://1337test.drchrono.com/messages/referrals/contacts/ - Add a new contact
- In the address field, enter
[[constructor.constructor('alert(1)')()]]
Confirm the alert pop up with 1 in it.
##Vulnerability The stored xss could be used for a complete account take over if an admin visited this contact page. An attacker only needs permission to create a referral contact to store the payload. In the example image, I've printed all cookies to the screen but this could easily be sent to a remote endpoint.
Please let me know if you have any questions. Pete
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 address value was inserted into an AngularJS template context and evaluated by the old AngularJS 1.1.5 engine instead of being displayed as plain text.
Impact
The stored script could be used for a complete account takeover if an admin viewed the contact page, and the text says cookies could easily be sent to a remote endpoint.
What the attacker needed
A doctors account; permission to create a referral contact; victim views the contact overview
How it was found
- Create a doctors account.
- Open the referrals contacts page.
- Add a new contact.
- Put an AngularJS expression in the address field and save.
- Reload the contact overview and the script runs.
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.
Some web pages use a framework called AngularJS to fill in parts of the page from templates. If a user's text is treated as part of that template, the framework will calculate and run it instead of just showing it. Here the address field did exactly that, so a visitor's browser ran the attacker's code.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.