CVE-2024-8027
📋 TL;DR
A stored Cross-Site Scripting vulnerability in netease-youdao/QAnything allows attackers to upload malicious knowledge files that execute arbitrary JavaScript when users interact with the chat interface. This affects all users of QAnything versions prior to the fix, potentially compromising their sessions and data.
💻 Affected Systems
- netease-youdao/QAnything
📦 What is this software?
Qanything by Youdao
⚠️ Manual Verification Required
This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.
Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).
🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.
- Review the CVE details at NVD
- Check vendor security advisories for your specific version
- Test if the vulnerability is exploitable in your environment
- Consider updating to the latest version as a precaution
⚠️ Risk & Real-World Impact
Worst Case
Attackers could steal session cookies, redirect users to malicious sites, perform actions on behalf of authenticated users, or install malware through the chat interface.
Likely Case
Session hijacking, credential theft, and unauthorized actions within the QAnything application by authenticated users who interact with poisoned knowledge files.
If Mitigated
Limited impact with proper input validation and output encoding, though stored XSS could still affect users who access malicious content.
🎯 Exploit Status
Exploitation requires file upload access to the knowledge base, but the XSS payload execution is straightforward once uploaded.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Check the huntr.com reference for specific fixed version
Vendor Advisory: https://huntr.com/bounties/cf75f024-3d64-416d-adfe-c4255d7c3f34
Restart Required: Yes
Instructions:
1. Update QAnything to the latest patched version. 2. Restart the QAnything service. 3. Verify that file uploads are properly sanitized.
🔧 Temporary Workarounds
Disable knowledge base uploads
allTemporarily disable file upload functionality to the knowledge base until patching is complete.
Modify QAnything configuration to restrict file upload permissions
Implement WAF rules
allAdd web application firewall rules to detect and block XSS payloads in file uploads.
Configure WAF to inspect Content-Type and file content for script tags and JavaScript patterns
🧯 If You Can't Patch
- Implement strict Content Security Policy (CSP) headers to restrict script execution
- Enable file upload validation that rejects files containing HTML/JavaScript content
🔍 How to Verify
Check if Vulnerable:
Test by uploading a knowledge file containing <script>alert('XSS')</script> and checking if it executes during chat interactions.
Check Version:
Check QAnything version in application settings or via package manager (e.g., pip show qanything)
Verify Fix Applied:
Attempt the same XSS test after patching - the script should be properly sanitized and not execute.
📡 Detection & Monitoring
Log Indicators:
- Unusual file uploads to knowledge base
- Chat interactions triggering JavaScript errors
- Multiple failed upload attempts with script-like content
Network Indicators:
- HTTP requests containing script tags in file uploads
- Unusual outbound connections from chat interface
SIEM Query:
source="qanything" AND (file_upload="*.txt" OR file_upload="*.pdf") AND content CONTAINS "<script>"