Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

comfyanonymous/ComfyUI
master @ 51bf508
39
Fixes
3
CVEs
HIGH
Peak severity
51.4%
Coverage
Highlights
Denial of Service: 12 prior fixes. Scrutinize any change in this area.
server.py: most-fixed (17 issues). Treat as high-risk during review.
17 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Path Traversal: Insecure handling of local file reads and model downloads consistently allows path traversal. Exploitations across model preview lookups, static file rendering, and the `/view` endpoint bypassed initial mitigations by utilizing symbolic links or empty query strings to escape base directories. Proper canonicalization using realpath and strict prefix checks are critical.
Cross-Site Request Forgery (CSRF): Localhost installations of ComfyUI are highly targeted by CSRF attacks (CVE-2024-10481). Initial implementations of origin validation introduced bypasses, such as ignoring port mismatches in the Origin and Host headers, requiring iterative fixes to restrict origin checks specifically to loopback hosts and enforce rigid validation of the Sec-Fetch-Site and Origin headers.
Information Disclosure: Sensitive credentials, including API keys, auth tokens, and local file structures, are historically leaked through global state outputs. The queue execution history and outgoing client APIs routinely serialized sensitive keys before dedicated redaction mechanisms were introduced.