Skip to content
XSS Write-up Intermediate

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.

ZX Security Follow

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.

ZX Security, on zxsecurity.co.nz

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

  1. Upload an SVG file containing JavaScript as a user avatar.
  2. The victim views the avatar, causing the JavaScript to execute in the application's domain.
  3. The JavaScript requests an OAuth authorization code and exchanges it for an access token.
  4. Using the token, the script calls the API to generate a passwordless login link for the victim.
  5. 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.

More by ZX Security

View all

6 more disclosed reports, best first.

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.