Skip to content
XSS Disclosed report Beginner

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.

s_p_q_r Follow

Originally disclosed on HackerOne

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

  1. Log into your account
  2. Open the template builder https://%your_domain%.drchrono.com/clinical/advanced_form_builder
  3. Create a new template with a field called <svg onload=alert(document.domain)>
  4. 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

The original report as published on HackerOne, by s_p_q_r. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Log into the account.
  2. Open the template builder.
  3. Create a new template with a field name containing an SVG onload handler.
  4. 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.

More by s_p_q_r

View all

14 more disclosed reports, best first.

More from drchrono

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.