CVE-2026-22777
Python vulnerability analysis and mitigation

Overview

CVE-2026-22777 is a CRLF Injection vulnerability (CWE-93) in ComfyUI-Manager, an extension for the ComfyUI AI image generation platform. It allows unauthenticated remote attackers to inject special characters into HTTP query parameters, enabling arbitrary configuration values to be written to the config.ini file. Affected versions include all ComfyUI-Manager releases prior to 3.39.2 (v3.x branch) and versions 4.0.0 through 4.0.4 (v4.x branch). The vulnerability was published on January 10, 2026, with patches released the same day. It carries a CVSS v3.1 base score of 7.5 (High) (GitHub Advisory, Security Advisory).

Technical details

The root cause is improper neutralization of CRLF sequences (CWE-93) in the write_config() function within glob/manager_core.py. When HTTP query parameters are passed to this function without sanitization, an attacker can embed carriage return (\r) and line feed (\n) characters to inject new key-value pairs into the INI-format config.ini file, as Python's ConfigParser treats these as record delimiters. Exploitation requires no authentication or user interaction, but is primarily relevant when ComfyUI is launched with the --listen option, exposing the manager's HTTP API to remote clients. The patch added explicit stripping of \r, \n, and null (\x00) characters from all string values before writing to the config file (Patch Commit, GitHub Advisory).

Impact

Successful exploitation allows an unauthenticated attacker to tamper with security settings or modify application behavior by injecting arbitrary key-value pairs into config.ini. This primarily affects integrity — confidentiality and availability are not directly impacted per the CVSS assessment. Depending on which configuration values are overwritten or injected, an attacker could potentially disable security controls, alter trust levels, or manipulate ComfyUI-Manager's operational behavior in ways that could facilitate further compromise of the host system (Security Advisory, GitHub Advisory).

Exploitability

No public proof-of-concept exploit code was known at the time of disclosure, and there is no evidence of in-the-wild exploitation as of the reporting date. The EPSS score is approximately 0.009% (1st percentile), indicating a low near-term exploitation probability. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. However, the attack requires no authentication, no user interaction, and low complexity, making it straightforward to exploit against internet-exposed instances. A PoC repository (github.com/wcnmwcis/CVE-2026-22777) appeared in late January 2026, and Vulhub added a related environment in early 2026 (GitHub Advisory, Feedly).

Exploitation steps

  1. Reconnaissance: Identify internet-facing ComfyUI instances running with the --listen flag using tools like Shodan or Censys, targeting the ComfyUI-Manager HTTP API (typically on port 8188). Confirm the ComfyUI-Manager version is below 3.39.2 or between 4.0.0 and 4.0.4.
  2. Identify target endpoint: Locate an HTTP API endpoint in ComfyUI-Manager that accepts query parameters and passes them to the write_config() function (e.g., configuration-setting endpoints).
  3. Craft malicious request: Construct an HTTP GET or POST request with a query parameter value containing CRLF sequences (e.g., %0D%0A) followed by a new INI key-value pair, such as: ?param=value%0D%0Amalicious_key=malicious_value.
  4. Inject configuration: Send the crafted request to the target. The unpatched write_config() function writes the parameter value — including the injected CRLF and new key — directly into config.ini via Python's ConfigParser.
  5. Achieve objective: Verify the injected configuration value is present in config.ini. Depending on the injected key, this could disable security restrictions, alter trust levels, or modify application behavior to enable further actions (Security Advisory, Patch Commit).

Indicators of compromise

  • Network: Unexpected HTTP requests to ComfyUI-Manager API endpoints containing URL-encoded CRLF sequences (%0D%0A, %0A, %0D) in query parameters; inbound connections to port 8188 from untrusted external IP addresses.
  • File System: Unexpected or unauthorized key-value pairs in the config.ini file of the ComfyUI-Manager installation directory; modification timestamps on config.ini that do not correspond to legitimate user activity.
  • Logs: Web server or application logs showing requests with encoded newline characters in query strings; log entries from manager_server.py referencing invalid snapshot targets (post-patch indicator of attempted path traversal).
  • Process: Unusual changes to ComfyUI-Manager security level settings or trust configurations that were not made by an administrator (Security Advisory, Patch Commit).

Mitigation and workarounds

Update ComfyUI-Manager to version 3.39.2 (v3.x branch) or 4.0.5 (v4.x branch), which add sanitization logic to the write_config() function to strip CRLF and null characters from all string values. If immediate upgrading is not possible, apply the following workarounds: run ComfyUI without the --listen option (localhost only), restrict external access via firewall rules, or run only on trusted internal networks. Administrators should also review config.ini for any unauthorized configuration changes that may have occurred prior to patching (Security Advisory, GitHub Advisory).

Community reactions

The vulnerability was reported by four independent researchers: 李存义, D0n9 Li, Swings, and Osword from SGLAB of Legendsec at Qi'anxin Group, indicating coordinated responsible disclosure. The CISA vulnerability bulletin for the week of January 5, 2026 referenced this CVE. Social media coverage appeared on Bluesky and Mastodon (TheHackerWire), and security aggregators including Vulners, VulDB, and CVEFeed.io picked up the advisory shortly after publication. A technical write-up was published by CertCube Labs (GitHub Advisory, CISA Bulletin).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-84366HIGH7.4
  • Python logoPython
  • python3.7
NoYesSep 01, 2026
GHSA-8423-8fgw-73vqMEDIUM6.9
  • Python logoPython
  • tornado
NoYesSep 01, 2026
CVE-2026-84311MEDIUM4.8
  • Python logoPython
  • pypdf2
NoYesSep 01, 2026
CVE-2026-84310MEDIUM4.8
  • Python logoPython
  • pypdf
NoYesSep 01, 2026
GHSA-wwv5-g3v4-889xLOW2.3
  • Python logoPython
  • tornado
NoYesSep 01, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management