CVE-2024-11824

7.6 HIGH

📋 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

Products:
  • langgenius/dify
Versions: All versions before 0.12.1
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in default chat log functionality; no special configuration required.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: HIGH if the dify instance is publicly accessible, as attackers can exploit it remotely.
🏢 Internal Only: MEDIUM if restricted to internal networks, but still poses credential theft risk.

🎯 Exploit Status

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

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

all

Implement server-side input validation to strip or escape HTML tags in chat prompts.

Output Encoding

all

Apply 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.

🔗 References

📤 Share & Export