CVE-2024-21574

10.0 CRITICAL

📋 TL;DR

CVE-2024-21574 is a critical remote code execution vulnerability in ComfyUI-Manager extension that allows attackers to execute arbitrary code on the server by exploiting a missing validation in the pip field of POST requests to the /customnode/install endpoint. This affects any system running ComfyUI with the vulnerable ComfyUI-Manager extension installed. Attackers can achieve full server compromise through crafted pip install commands.

💻 Affected Systems

Products:
  • ComfyUI-Manager extension for ComfyUI
Versions: Versions before commit ffc095a3e5acc1c404773a0510e6d055a6a72b0e
Operating Systems: All operating systems running Python
Default Config Vulnerable: ⚠️ Yes
Notes: Requires ComfyUI-Manager extension to be installed and the custom node installation endpoint to be accessible.

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

Full server compromise with attacker gaining complete control over the system, allowing data theft, lateral movement, persistence installation, and use as a foothold for further attacks.

🟠

Likely Case

Remote code execution leading to installation of malware, cryptocurrency miners, backdoors, or data exfiltration from the compromised server.

🟢

If Mitigated

Limited impact with proper network segmentation, minimal privileges, and monitoring detecting the unusual pip install activity.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires sending a crafted POST request to the vulnerable endpoint with malicious pip package or URL.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Commit ffc095a3e5acc1c404773a0510e6d055a6a72b0e and later

Vendor Advisory: https://github.com/ltdrdata/ComfyUI-Manager/commit/ffc095a3e5acc1c404773a0510e6d055a6a72b0e

Restart Required: Yes

Instructions:

1. Update ComfyUI-Manager extension to latest version. 2. Restart ComfyUI server. 3. Verify the fix by checking the commit hash matches or exceeds ffc095a3e5acc1c404773a0510e6d055a6a72b0e.

🔧 Temporary Workarounds

Disable custom node installation endpoint

all

Remove or block access to the /customnode/install endpoint

# Configure web server or firewall to block /customnode/install
# Or modify ComfyUI configuration to disable this feature

Network segmentation and access control

linux

Restrict network access to ComfyUI server to trusted IPs only

# Example iptables rule: iptables -A INPUT -p tcp --dport [ComfyUI_PORT] -s [TRUSTED_IP] -j ACCEPT
# iptables -A INPUT -p tcp --dport [ComfyUI_PORT] -j DROP

🧯 If You Can't Patch

  • Implement strict network access controls to limit who can reach the ComfyUI server
  • Monitor for unusual pip install activity and network connections from the server

🔍 How to Verify

Check if Vulnerable:

Check if ComfyUI-Manager extension is installed and if the code at glob/manager_server.py line 798 lacks proper validation of the pip field in the install_custom_node function.

Check Version:

cd /path/to/ComfyUI/custom_nodes/ComfyUI-Manager && git log --oneline -1

Verify Fix Applied:

Verify the commit hash of ComfyUI-Manager is ffc095a3e5acc1c404773a0510e6d055a6a72b0e or later, and check that pip field validation has been implemented.

📡 Detection & Monitoring

Log Indicators:

  • Unusual pip install commands in server logs
  • POST requests to /customnode/install with suspicious pip parameters
  • Installation of unexpected Python packages

Network Indicators:

  • Outbound connections from ComfyUI server to unusual domains or IPs following pip install
  • Large data exfiltration from server

SIEM Query:

source="comfyui.log" AND "pip install" AND NOT package IN ["expected-package1","expected-package2"]

🔗 References

📤 Share & Export