Finding and Exploiting XSS in a CRM (and getting paid for it)
A stored XSS vulnerability in a CRM's email template editor allowed an attacker to inject an image with an onerror handler that executed when the template was previewed. This let the attacker steal an admin's session cookie and take over their account.
medium.com
Published on medium.com
While exploring a CRM application, I stumbled upon an XSS vulnerability. At first, I thought I was testing a local application, but after reporting it, it turned out the app was one of the “headless browser” types of apps and it was happening server side.
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
Impact
An attacker could steal an admin's session cookie and take over their account; the company fixed the issue within ten days.
What the attacker needed
A low-privileged account; admin views the template
The fix
The company fixed it by preventing script execution on stored content.
How it was found
- Log in as a low-privileged user and go to Settings > Email Templates.
- Create a new email template and switch to code view.
- Insert an image tag with an onerror handler and a broken image source.
- Save the template and return to the Templates list.
- Select the template so the preview tries to load the broken image, triggering the handler.
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.
This is a stored cross-site scripting (XSS) bug. The app let a user save an email template containing an image tag with an error handler; when an admin previewed the template, the handler ran as if it were the admin's own code. That let the attacker read the admin's session cookie and log in as them.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.