Template stored XSS
Template field names were not escaped, allowing an attacker to inject HTML with JavaScript into a template. When the template was saved and shared, the script executed, and it could also run on the search page via a mouseover event.
- Triaged in 9 hours
- Fixed in 12 days
- Paid in 12 days
- Disclosed after 56 days
The template filed names are not escaped properly, which gives an opportunity to inject HTML tags with javascript there.
- Log into your account
- Open the template builder https://%your_domain%.drchrono.com/clinical/advanced_form_builder
- Create a new template with a field called <svg onload=alert(document.domain)>
- Save the template and share it to the library
I created one such template as a proof of concept:
https://www.drchrono.com/medical-forms/1460752/aaabbbcccdddeee
The script can also be executed at the search page by onmouseover event:
https://www.drchrono.com/medical-forms/?query=aaa%22bbb%27ccc%3Cddd%3Eeee
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 application inserted template field names into HTML without escaping or sanitising them.
Impact
An attacker could execute JavaScript in the browser of someone viewing the shared template or the search results page.
What the attacker needed
A user account; ability to create and share templates; victim views the shared template or search page
How it was found
- Log into the account.
- Open the template builder.
- Create a new template with a field name containing an SVG onload handler.
- Save the template and share it to the library.
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.
When a website shows user-supplied text, it must convert special characters like < and > into harmless codes so the browser does not treat them as HTML. Here, the template builder failed to do that, so a field name containing an SVG tag with an onload handler was stored and later executed as code. This is called stored cross-site scripting because the malicious script is saved on the server.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.