The vulnerability, CWE-420: Unprotected Alternate Channel, stems from ComfyUI-Manager storing its configuration and data files in a publicly accessible directory (user/default/ComfyUI-Manager/) within the ComfyUI framework. This allowed unauthenticated remote attackers to read and write sensitive files via ComfyUI's web API, especially when the server was exposed to the network (e.g., using --listen 0.0.0.0).
The analysis of the patch commit e44c5cef58fb4973670b86433b9d24d077b44a26 reveals that the vulnerability is not in a single flawed function but in the overall file management strategy. The identified functions are those that directly interact with the compromised file storage location, making them the key indicators that would appear in a runtime profile during exploitation.
manager_core.update_user_directory: This function sets the stage for the vulnerability by defining the unprotected directory as the location for all manager-related files.
manager_core.get_config: This function consumes the configuration from the unprotected path. An attacker could modify config.ini to lower the security level, and this function would trust and apply that malicious setting, disabling security controls across the application.
prestartup_script.execute_startup_script: This represents the most critical impact, allowing remote code execution. An attacker could write a malicious script to the startup-scripts directory, which this function would then execute on the next startup.
The patch remediates this by migrating the files to a new, protected directory (user/__manager/) that is inaccessible via the web API, thanks to a new feature in the underlying ComfyUI framework. The patch also includes several fallback protections, such as forcing a 'strong' security level and blocking startup scripts if an older, insecure version of ComfyUI is detected.