CVE-2023-46238

8.7 HIGH

📋 TL;DR

This vulnerability in ZITADEL allows attackers to inject malicious JavaScript into SVG avatar images, potentially enabling account takeover when victims view the image with an active single session. It affects ZITADEL users who upload custom avatar images. The attack requires specific conditions: victim must have exactly one active session and directly open the malicious image.

💻 Affected Systems

Products:
  • ZITADEL
Versions: All versions before 2.38.2 and 2.39.2
Operating Systems: All platforms running ZITADEL
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in default configuration when SVG avatar uploads are enabled.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete account takeover allowing attacker to impersonate victim, access sensitive identity data, and perform privileged actions within the identity management system.

🟠

Likely Case

Limited account compromise in targeted attacks where attackers can trick specific users into viewing malicious SVG avatars under precise session conditions.

🟢

If Mitigated

No impact if patched versions are used or if security headers prevent SVG script execution.

🌐 Internet-Facing: HIGH - ZITADEL is typically internet-facing identity infrastructure, and SVG uploads are common user functionality.
🏢 Internal Only: MEDIUM - Internal deployments still vulnerable but attack surface reduced compared to internet-facing instances.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploit requires attacker to upload malicious SVG and victim to view it with exactly one active session. No authentication bypass needed for upload if user upload functionality exists.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.38.2 or 2.39.2

Vendor Advisory: https://github.com/zitadel/zitadel/security/advisories/GHSA-954h-jrpm-72pm

Restart Required: Yes

Instructions:

1. Backup your ZITADEL instance and data. 2. Stop ZITADEL service. 3. Update to version 2.38.2 (for 2.38.x branch) or 2.39.2 (for 2.39.x branch). 4. Restart ZITADEL service. 5. Verify the update was successful.

🔧 Temporary Workarounds

Disable SVG avatar uploads

all

Configure ZITADEL to reject SVG files for avatar uploads

Configure ZITADEL settings to restrict allowed avatar file types to exclude SVG

Implement Content Security Policy

all

Add security headers to prevent SVG script execution

Add Content-Security-Policy header with script-src 'self' or similar restrictions

🧯 If You Can't Patch

  • Disable user avatar upload functionality entirely
  • Implement WAF rules to block SVG files with script tags or javascript content

🔍 How to Verify

Check if Vulnerable:

Check ZITADEL version: if below 2.38.2 or 2.39.2, you are vulnerable. Also check if SVG avatar uploads are enabled.

Check Version:

Check ZITADEL admin interface or run: docker inspect zitadel | grep version (if containerized) or check application logs for version info.

Verify Fix Applied:

Verify ZITADEL version is 2.38.2 or higher (for 2.38.x) or 2.39.2 or higher (for 2.39.x). Test SVG upload with script content to ensure it's blocked or sanitized.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SVG file uploads
  • Multiple failed login attempts from same user
  • User session anomalies

Network Indicators:

  • SVG files with script tags being uploaded
  • Unexpected JavaScript execution from avatar endpoints

SIEM Query:

source="zitadel" AND (event="file_upload" AND file_type="svg") OR (event="auth" AND result="failure")

🔗 References

📤 Share & Export