The vulnerability, identified as GHSA-562r-8445-54r2, is a CRLF injection flaw in ComfyUI-Manager's configuration handler. The analysis of the provided patches confirms this. The two commits, ef8703a3d7ab4e6ecda8f96e0c5816c23d1cb262 for the v4.x branch and f4fa394e0f03b013f1068c96cff168ad10bd0410 for the v3.x branch, both introduce the same fix in the write_config function across different parts of the codebase.
The core of the vulnerability is that the write_config function, which is responsible for saving settings to the config.ini file, did not sanitize string values. An attacker could send specially crafted HTTP requests with CRLF characters in the parameters, which would then be written directly into the configuration file. This could allow the attacker to add or modify configuration settings, potentially disabling security features or altering the application's behavior.
The patch adds a sanitization step within the write_config function. It iterates through the configuration items and uses value.replace('\r', '').replace('\n', '').replace('\x00', '') on all string values to strip out CRLF and null characters before writing to the file. The presence of this fix in comfyui_manager/glob/manager_core.py, comfyui_manager/legacy/manager_core.py, and the older glob/manager_core.py clearly identifies write_config as the vulnerable function that would be invoked during exploitation.