CVE-2024-0640

4.8 MEDIUM

📋 TL;DR

A stored cross-site scripting (XSS) vulnerability in Chatwoot allows admin users to inject malicious JavaScript code via dashboard app settings. This code executes when other admin users access the affected dashboard, potentially compromising admin sessions. Only Chatwoot instances running versions 3.0.0 through 3.5.1 with admin users are affected.

💻 Affected Systems

Products:
  • chatwoot/chatwoot
Versions: 3.0.0 to 3.5.1
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Requires at least one admin user account to exploit. Non-admin users cannot trigger or be affected by this vulnerability.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

An attacker with admin access could steal other admin users' session tokens, perform unauthorized actions as those users, or deploy additional malware within the Chatwoot environment.

🟠

Likely Case

Malicious admin could perform session hijacking against other admins, leading to unauthorized configuration changes or data access within the Chatwoot platform.

🟢

If Mitigated

With proper admin user vetting and monitoring, impact is limited to potential configuration changes by a rogue admin, but no privilege escalation beyond existing admin rights.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires admin credentials. The vulnerability is in the dashboard app settings interface where JavaScript injection is possible.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.5.2

Vendor Advisory: https://github.com/chatwoot/chatwoot/commit/e39c14460b860d5e3d23d989dd6af48404ad1bb4

Restart Required: Yes

Instructions:

1. Backup your Chatwoot database and configuration. 2. Update to version 3.5.2 or later using your deployment method (Docker, manual, etc.). 3. Restart the Chatwoot service. 4. Verify the update completed successfully.

🔧 Temporary Workarounds

Restrict Admin Access

all

Temporarily limit admin user accounts to only essential personnel and implement strict monitoring of admin activities.

Content Security Policy

all

Implement strict Content Security Policy headers to mitigate XSS impact by restricting script execution sources.

🧯 If You Can't Patch

  • Implement strict input validation and output encoding for dashboard app settings fields
  • Enable audit logging for all admin actions and regularly review for suspicious activity

🔍 How to Verify

Check if Vulnerable:

Check your Chatwoot version. If it's between 3.0.0 and 3.5.1 inclusive, you are vulnerable.

Check Version:

For Docker: docker exec chatwoot bundle exec rails -v | grep chatwoot; For manual: cat /opt/chatwoot/.version

Verify Fix Applied:

After updating, verify the version is 3.5.2 or higher and test that JavaScript injection in dashboard app settings is properly sanitized.

📡 Detection & Monitoring

Log Indicators:

  • Unusual admin user activity patterns
  • JavaScript code in dashboard app settings modifications
  • Multiple admin session creations from single user

Network Indicators:

  • Unexpected external script loads from Chatwoot dashboard pages
  • Suspicious outbound connections following admin dashboard access

SIEM Query:

source="chatwoot" AND (event="settings_update" AND data CONTAINS "<script") OR (event="admin_login" FROM same_ip WITHIN 5m)

🔗 References

📤 Share & Export