CVE-2024-21575
📋 TL;DR
ComfyUI-Impact-Pack extension for ComfyUI has a path traversal vulnerability in the /upload/temp endpoint that allows attackers to write arbitrary files to the filesystem by manipulating the image.filename field in POST requests. This can lead to remote code execution under certain conditions. Users running vulnerable versions of ComfyUI with the Impact-Pack extension installed are affected.
💻 Affected Systems
- ComfyUI-Impact-Pack
⚠️ 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
Remote code execution leading to complete system compromise, data theft, or ransomware deployment.
Likely Case
Arbitrary file write allowing file system manipulation, potential privilege escalation, or denial of service.
If Mitigated
Limited impact with proper file system permissions and network segmentation preventing exploitation.
🎯 Exploit Status
Exploitation requires sending a crafted POST request to the vulnerable endpoint with a malicious filename parameter.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Commit a43dae373e648ae0f0cc0c9768c3cea6a72acff7 and later
Vendor Advisory: https://github.com/ltdrdata/ComfyUI-Impact-Pack/commit/a43dae373e648ae0f0cc0c9768c3cea6a72acff7
Restart Required: Yes
Instructions:
1. Update ComfyUI-Impact-Pack to latest version. 2. Restart ComfyUI server. 3. Verify the fix by checking the impact_server.py file contains proper filename validation.
🔧 Temporary Workarounds
Disable Impact-Pack server endpoints
allTemporarily disable the vulnerable upload endpoint
Modify ComfyUI configuration to disable Impact-Pack server functionality
Network access control
allRestrict access to ComfyUI server endpoints
Configure firewall rules to limit access to ComfyUI server (default port 8188)
🧯 If You Can't Patch
- Implement web application firewall (WAF) rules to block path traversal patterns in filename parameters
- Run ComfyUI with minimal privileges and in isolated containers/VM environments
🔍 How to Verify
Check if Vulnerable:
Check if impact_server.py line 28 lacks proper filename validation for the /upload/temp endpoint
Check Version:
Check ComfyUI-Impact-Pack git commit hash or version in extension directory
Verify Fix Applied:
Verify impact_server.py contains filename sanitization (e.g., using os.path.basename or similar validation)
📡 Detection & Monitoring
Log Indicators:
- POST requests to /upload/temp with suspicious filenames containing path traversal sequences (../, ..\)
- File write operations to unexpected locations
Network Indicators:
- HTTP POST requests to ComfyUI server port 8188 with crafted filename parameters
SIEM Query:
source="comfyui.log" AND (url_path="/upload/temp" AND filename MATCHES "*../*" OR filename MATCHES "*..\\*")