CVE-2024-21575

8.6 HIGH

📋 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

Products:
  • ComfyUI-Impact-Pack
Versions: Versions before commit a43dae373e648ae0f0cc0c9768c3cea6a72acff7
Operating Systems: All platforms running ComfyUI
Default Config Vulnerable: ⚠️ Yes
Notes: Requires ComfyUI with Impact-Pack extension installed and the extension's server endpoints enabled.

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

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. 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.

🌐 Internet-Facing: HIGH - The vulnerable endpoint is accessible via HTTP POST requests without authentication.
🏢 Internal Only: MEDIUM - Internal attackers could exploit this for lateral movement or privilege escalation.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

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

all

Temporarily disable the vulnerable upload endpoint

Modify ComfyUI configuration to disable Impact-Pack server functionality

Network access control

all

Restrict 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 "*..\\*")

🔗 References

📤 Share & Export