Skip to main content
Vulnerability Database/CVE-2026-108962

CVE-2026-108962: ComfyUI Segment Anything RCE Vulnerability

CVE-2026-108962 is a code injection flaw in ComfyUI Segment Anything affecting the GroundingDINO model loading component. Attackers can exploit this remotely to execute arbitrary code. This article covers technical details, impact analysis, and recommended mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-108962 Overview

CVE-2026-108962 is a code injection vulnerability [CWE-74] in the storyicon/comfyui_segment_anything project, a ComfyUI custom node for the Segment Anything Model. The flaw resides in the SLConfig._file2dict function within local_groundingdino/util/slconfig.py, part of the GroundingDINO model loading component. Attackers can manipulate the config argument to inject and execute arbitrary code. The project follows a rolling-release model, so no fixed version is available. The maintainer was notified through an issue report but has not responded.

Critical Impact

Attackers can inject executable code through the config argument during GroundingDINO model loading, affecting confidentiality, integrity, and availability of the host running ComfyUI.

Affected Products

  • storyicon comfyui_segment_anything (rolling release, up to commit ab6395596399d5048639cdab7e44ec9fae857a93)
  • GroundingDINO Model Loading component (local_groundingdino/util/slconfig.py)
  • ComfyUI deployments using this custom node for Segment Anything workflows

Discovery Timeline

  • 2026-10-13 - CVE-2026-108962 published to NVD
  • 2026-10-14 - Last updated in NVD database

Technical Details for CVE-2026-108962

Vulnerability Analysis

The vulnerability exists in the SLConfig._file2dict method used by the GroundingDINO model loader. This function parses a configuration file supplied through the config argument. Because the parser evaluates Python code from the configuration file without adequate sandboxing or validation, an attacker who controls the config path or its contents can execute arbitrary Python on the host.

The weakness maps to CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component). In this case the downstream component is the Python interpreter itself. Exploitation requires user interaction, such as loading a workflow or model configuration provided by an attacker.

Because ComfyUI is often deployed on GPU-equipped servers used for shared inference workloads, successful code injection can lead to credential theft, model tampering, lateral movement, and persistence inside AI pipelines.

Root Cause

The _file2dict routine in slconfig.py resolves configuration files by importing or evaluating them as Python modules rather than parsing them with a safe loader. Any attacker-controlled configuration content is therefore executed with the privileges of the ComfyUI process.

Attack Vector

The attack vector is network-based with user interaction required. A victim who loads a malicious GroundingDINO configuration, a crafted ComfyUI workflow, or a shared model bundle that references an attacker-supplied config path will trigger code execution during model loading.

No verified public exploit code is available. The vulnerability mechanism is described in prose only; see the GitHub Issue #114 and VulDB CVE-2026-108962 for additional technical context.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-108962

Indicators of Compromise

  • Unexpected Python child processes spawned by the ComfyUI server during model or workflow loading.
  • Access to local_groundingdino/util/slconfig.py followed by outbound network connections to unfamiliar hosts.
  • Newly written files in the ComfyUI custom_nodes or models directories that were not placed by an administrator.
  • Shell commands, reverse shells, or interpreter launches initiated by the ComfyUI process account.

Detection Strategies

  • Monitor process genealogy for the ComfyUI Python process and alert on spawned shells (sh, bash, cmd.exe, powershell.exe).
  • Inspect loaded GroundingDINO configuration files for import, exec, eval, os.system, or subprocess references not present in upstream defaults.
  • Correlate workflow import events with subsequent file writes to Python site-packages or custom_nodes directories.

Monitoring Recommendations

  • Enable file integrity monitoring on the comfyui_segment_anything directory and the local_groundingdino subtree.
  • Log and review all configuration files passed to GroundingDINO model loaders, including hashes and source paths.
  • Capture outbound network telemetry from AI inference hosts to detect command-and-control activity after model loads.

How to Mitigate CVE-2026-108962

Immediate Actions Required

  • Restrict the ability to upload or import ComfyUI workflows and GroundingDINO configurations to trusted administrators only.
  • Run ComfyUI under a dedicated low-privilege service account with no access to secrets or shared storage.
  • Review all existing GroundingDINO config files for unexpected Python statements and remove untrusted entries.
  • Isolate ComfyUI inference hosts behind network segmentation and deny unexpected outbound traffic.

Patch Information

No patch is available. The maintainer has not responded to GitHub Issue #114. Because storyicon/comfyui_segment_anything uses rolling releases, affected and fixed version identifiers are not published. Track the GitHub Project Repository for maintainer updates.

Workarounds

  • Replace the vulnerable node with a maintained alternative or fork that validates configuration input.
  • Load only configuration files that ship with the component and block user-supplied config paths at the application layer.
  • Execute ComfyUI inside a container or sandbox with read-only mounts for the local_groundingdino directory.
  • Apply allowlisting on the ComfyUI process to prevent spawning of shells and interpreters at runtime.
bash
# Configuration example: run ComfyUI in a restricted container
docker run --rm \
  --user 1001:1001 \
  --read-only \
  --tmpfs /tmp \
  --cap-drop ALL \
  --security-opt no-new-privileges \
  --network comfyui-isolated \
  -v /opt/comfyui/models:/models:ro \
  comfyui:restricted

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.