Zitadel one click silent account takeover
A stored XSS vulnerability in Zitadel allowed an attacker to upload a malicious SVG as a user avatar, which executed JavaScript in the context of the application's domain. This enabled the attacker to silently obtain OAuth tokens and generate a passwordless login link for the victim's account, leading to account takeover.
Published on zxsecurity.co.nz
During an engagement, Ethan McKee-Harris, with the aide of Michael Tsai and Jack Moran discovered stored Cross-Site Scripting (XSS) within Zitadel. When exploited, the vulnerability would give a malicious user the ability to conduct a silent account takeover with a single click payload.
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 application allowed SVG files to be uploaded as avatars and served them from a route without a Content Security Policy or Content-Disposition header, so embedded JavaScript executed in the application's origin.
Impact
An attacker could achieve complete account takeover of a victim's account.
What the attacker needed
Attacker can upload an SVG avatar; victim views the malicious avatar; victim is logged in
The fix
The vulnerability was fixed in Zitadel versions 2.28.2 and 2.39.2.
How it was found
- Upload an SVG file containing JavaScript as a user avatar.
- The victim views the avatar, causing the JavaScript to execute in the application's domain.
- The JavaScript requests an OAuth authorization code and exchanges it for an access token.
- Using the token, the script calls the API to generate a passwordless login link for the victim.
- The script exfiltrates the generated link to an attacker-controlled URL.
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 report describes a stored cross-site scripting (XSS) flaw. XSS lets an attacker inject malicious code into a website, which then runs in other users' browsers. Here, an attacker uploaded a specially crafted image file (an SVG) as their avatar. When a victim viewed that avatar, the code inside it ran and secretly created a login link for the victim's account, which the attacker could then use to take over the account.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.