How I Discovered CVE-2025–3568: From XSS to Admin Account Takeover
The Krayin CRM v2.1.0 email editor rendered SVG attachments inline without sanitisation, allowing stored XSS in the admin's session. The attacker used the XSS to steal the CSRF token and forge a password change request, because the password change endpoint did not require the current password, resulting in admin account takeover.
Published on medium.com
Security issues often don’t begin with something flashy — they usually start with something subtle. During a recent audit of Krayin CRM v2.1.0, I stumbled upon what looked like a minor SVG handling issue.
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
Root cause
Likely the email editor rendered SVG attachments inline without sanitising them, and the password change endpoint lacked a current-password check.
Impact
An attacker could take over the admin account by changing its password, leading to full system compromise.
What the attacker needed
Attacker can send email with attachment; admin opens the SVG attachment; victim has an admin account
How it was found
- Upload an SVG file containing JavaScript as an email attachment.
- Send the email to the admin and have the admin open the SVG in a new tab, triggering XSS.
- Use the XSS to read the XSRF-TOKEN cookie.
- Forge a POST request to the admin user edit endpoint with the stolen token, changing the admin username and password.
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.
The CRM let users attach SVG image files to emails. When an admin opened such an SVG, any JavaScript inside it ran in the admin's browser. The attacker used that JavaScript to send a request that changed the admin's password, because the password change form did not ask for the old password.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.