CVE-2024-21576

10.0 CRITICAL

📋 TL;DR

ComfyUI-Bmad-Nodes contains a critical code injection vulnerability in three custom nodes (BuildColorRangeHSVAdvanced, FilterContour, FindContour) that allows remote code execution via crafted workflows. Attackers can execute arbitrary code on servers running vulnerable versions. This affects all users of ComfyUI-Bmad-Nodes who process untrusted workflows.

💻 Affected Systems

Products:
  • ComfyUI-Bmad-Nodes
Versions: All versions prior to patched version (specific version unknown from provided data)
Operating Systems: All platforms running Python
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in default configuration when using the affected custom nodes. Requires ComfyUI framework to be installed.

⚠️ 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 allowing attackers to execute arbitrary commands, steal data, install malware, pivot to other systems, and maintain persistent access.

🟠

Likely Case

Remote code execution leading to data theft, cryptocurrency mining, or ransomware deployment on vulnerable servers.

🟢

If Mitigated

Limited impact if proper network segmentation, least privilege, and input validation are implemented, though risk remains significant.

🌐 Internet-Facing: HIGH - Directly exploitable via workflow submission without authentication, allowing complete system takeover.
🏢 Internal Only: HIGH - Even internal systems are vulnerable to malicious workflows from compromised internal users or supply chain attacks.

🎯 Exploit Status

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

Exploitation requires crafting a malicious workflow file but doesn't require authentication. The eval() vulnerability pattern is well-known and easily weaponized.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown from provided references - check GitHub repository for latest version

Vendor Advisory: https://github.com/bmad4ever/comfyui_bmad_nodes

Restart Required: Yes

Instructions:

1. Check GitHub repository for security updates. 2. Update to latest patched version. 3. Restart ComfyUI service. 4. Verify eval() calls have been removed or properly sanitized in cv_nodes.py.

🔧 Temporary Workarounds

Disable vulnerable nodes

all

Remove or disable BuildColorRangeHSVAdvanced, FilterContour, and FindContour nodes from ComfyUI installation

mv /path/to/comfyui_bmad_nodes/cv_nodes.py /path/to/comfyui_bmad_nodes/cv_nodes.py.backup
Restart ComfyUI service

Network isolation

linux

Restrict ComfyUI instance to internal network only with firewall rules

iptables -A INPUT -p tcp --dport [comfyui_port] -s [trusted_network] -j ACCEPT
iptables -A INPUT -p tcp --dport [comfyui_port] -j DROP

🧯 If You Can't Patch

  • Isolate ComfyUI instance in separate network segment with no internet access
  • Implement strict input validation and workflow sanitization before processing

🔍 How to Verify

Check if Vulnerable:

Check cv_nodes.py for eval() calls in BuildColorRangeHSVAdvanced, FilterContour, and FindContour functions around line 1814

Check Version:

Check package version or git commit hash of comfyui_bmad_nodes installation

Verify Fix Applied:

Verify eval() calls have been removed or replaced with safe alternatives in patched version

📡 Detection & Monitoring

Log Indicators:

  • Unusual Python process execution from ComfyUI
  • Workflow processing errors containing eval syntax
  • Suspicious command execution in system logs

Network Indicators:

  • Unexpected outbound connections from ComfyUI server
  • Workflow submissions containing Python code patterns

SIEM Query:

source="comfyui.log" AND ("eval" OR "exec" OR "subprocess")

🔗 References

📤 Share & Export