CVE-2024-11824
📋 TL;DR
A stored XSS vulnerability in langgenius/dify's chat log functionality allows attackers to inject malicious HTML tags like <input> and <form> via prompts. When administrators view logs containing this malicious HTML, attackers can steal credentials or sensitive information. This affects all users of dify versions before 0.12.1.
💻 Affected Systems
- langgenius/dify
📦 What is this software?
Dify by Langgenius
⚠️ Risk & Real-World Impact
Worst Case
Administrator credentials are stolen, leading to complete system compromise and data exfiltration.
Likely Case
Session hijacking or sensitive information leakage from admin accounts.
If Mitigated
Limited impact with proper input validation and output encoding in place.
🎯 Exploit Status
Requires ability to submit prompts to the system and admin viewing of logs; no authentication bypass needed for injection.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 0.12.1
Vendor Advisory: https://github.com/langgenius/dify/commit/55edd5047e6fcbc9bb56a4ea055fcce090f3eb5d
Restart Required: No
Instructions:
1. Update dify to version 0.12.1 or later. 2. Follow standard update procedures for your deployment (e.g., docker pull, package update). 3. Verify the fix by checking version.
🔧 Temporary Workarounds
Input Sanitization
allImplement server-side input validation to strip or escape HTML tags in chat prompts.
Output Encoding
allApply proper HTML encoding when displaying chat logs in admin interfaces.
🧯 If You Can't Patch
- Restrict admin access to chat logs to trusted users only.
- Implement a web application firewall (WAF) with XSS protection rules.
🔍 How to Verify
Check if Vulnerable:
Check if dify version is below 0.12.1; test by attempting to inject HTML tags like <input> into chat prompts and viewing logs.
Check Version:
Check dify version in application settings or via API endpoint if available.
Verify Fix Applied:
After updating to 0.12.1 or later, verify that HTML tags in chat logs are properly sanitized and do not execute.
📡 Detection & Monitoring
Log Indicators:
- Unusual HTML tags like <input> or <form> in chat logs
- Suspicious prompt submissions
Network Indicators:
- HTTP requests with malicious payloads to chat endpoints
SIEM Query:
Search for patterns like '*<input*' or '*<form*' in application logs related to chat functionality.