Skip to content

XSS with User Avatar image

High
livio-a published GHSA-954h-jrpm-72pm Oct 26, 2023

Package

ZITADEL (ZITADEL)

Affected versions

<2.38.2
>=2.39.0, <2.39.2

Patched versions

2.38.2
2.39.2

Description

Impact

ZITADEL users can upload their own avatar image. Various image types are allowed including SVG.
SVG can include scripts, such as javascript, which can be executed during rendering.

Due to a missing security header, an attacker could inject code to an SVG to gain access to the victim’s account in certain scenarios.
A possible victim would need to directly open the malicious image in the browser, where a single session in ZITADEL needs to be active for this exploit to work.

If the possible victim had multiple or no active sessions in ZITADEL, the attack would not succeed. Furthermore, the display of the user's avatar in Console and the login UI was never affected by this issue, as SVG images are converted and the code is not executed.

Patches

2.x versions are fixed on >= 2.39.2
2.38.x versions are fixed on >= 2.38.2

ZITADEL recommends upgrading to the latest versions available in due course.

Workarounds

For self-hosted environments unable to upgrade to a patched version, add a the following response header (e.g. within your WAF or reverse proxy) to the assets path ($ZITADEL_DOMAIN/assets/v1/*):
Content-Security-Policy: default-src 'none';img-src 'self';object-src 'none';style-src 'self';media-src 'none';frame-src 'none';frame-ancestors 'none';font-src 'self';script-src 'self';manifest-src 'self';connect-src 'self'

References

None

Questions

If you have any questions or comments about this advisory, please email us at security@zitadel.com

Severity

High
8.7
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
None
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N

CVE ID

CVE-2023-46238

Weaknesses

No CWEs

Credits