If I drive ComfyUI from another machine or container (--listen, a tunnel, a reverse proxy), what does the server itself authenticate or restrict, and what must the agent's deployment add?
At the pin, the HTTP and WebSocket surface has no authentication in server.py and the project's threat model treats anyone who can reach the URL as trusted. The only built-in request filters are the origin-only middleware (blocks cross-site browser requests and, for loopback Hosts, Host/Origin mismatches) and path guards on /view and uploads. Passing --enable-cors-header replaces the origin-only middleware with a permissive CORS one, and --listen without a value opens all interfaces. An agent that exposes the port must add network controls, TLS and authentication outside ComfyUI.
At the pin, the HTTP and WebSocket surface has no authentication in server.py and the project's threat model treats anyone who can reach the URL as trusted. The only built-in request filters are the origin-only middleware (blocks cross-site browser requests and, for loopback Hosts, Host/Origin mismatches) and path guards on /view and uploads. Passing --enable-cors-header replaces the origin-only middleware with a permissive CORS one, and --listen without a value opens all interfaces. An agent that exposes the port must add network controls, TLS and authentication outside ComfyUI.
Curator qualifications: Verified the default bind, the loopback-only mismatch check, the CORS replacement and SECURITY.md scope. The openapi.yaml global security block (ApiKeyAuth/BearerAuth) versus no authentication in server.py is a genuine same-repo, same-commit inconsistency (the spec describes hosted behaviour). Say 'no authentication in server.py handlers' rather than 'no authentication', until the routes registered from other modules are read.
Evidence status: statements located in the cited sources by a correlated desk review (Claude); not executed; not independently reviewed.
Structured fields
{
"citations": [
{
"url": "https://github.com/Comfy-Org/ComfyUI/blob/1a82e6d01f395b43275c77acd289af1eb7090bb9/SECURITY.md",
"note": "L63; create_origin_only_middleware L203-L235; L281-L284; L9, L26"
},
{
"url": "https://github.com/Comfy-Org/ComfyUI/blob/1a82e6d01f395b43275c77acd289af1eb7090bb9/comfy/cli_args.py",
"note": "L63; create_origin_only_middleware L203-L235; L281-L284; L9, L26"
},
{
"url": "https://github.com/Comfy-Org/ComfyUI/blob/1a82e6d01f395b43275c77acd289af1eb7090bb9/server.py",
"note": "L63; create_origin_only_middleware L203-L235; L281-L284; L9, L26"
},
{
"url": "https://github.com/Comfy-Org/docs/blob/506a4a94db30524adb8706667aec050d71dbdf60/development/comfyui-server/comms_overview.mdx",
"note": "L63; create_origin_only_middleware L203-L235; L281-L284; L9, L26"
},
{
"url": "https://github.com/Comfy-Org/docs/blob/506a4a94db30524adb8706667aec050d71dbdf60/development/comfyui-server/api-proxy.mdx",
"note": "L63; create_origin_only_middleware L203-L235; L281-L284; L9, L26"
},
{
"url": "https://github.com/Comfy-Org/ComfyUI/blob/1a82e6d01f395b43275c77acd289af1eb7090bb9/openapi.yaml",
"note": "L63; create_origin_only_middleware L203-L235; L281-L284; L9, L26"
},
{
"url": "https://github.com/Comfy-Org/docs/blob/506a4a94db30524adb8706667aec050d71dbdf60/development/comfyui-server/api-key-integration.mdx",
"note": "L63; create_origin_only_middleware L203-L235; L281-L284; L9, L26"
}
]
}Evidence claims
- [sourced_fact] At the pin, the HTTP and WebSocket surface has no authentication in server.py and the project's threat model treats anyone who can reach the URL as trusted. The only built-in request filters are the origin-only middleware (blocks cross-site browser requests and, for loopback Hosts, Host/Origin mismatches) and path guards on /view and uploads. Passing --enable-cors-header replaces the origin-only middleware with a permissive CORS one, and --listen without a value opens all interfaces. An agent that exposes the port must add network controls, TLS and authentication outside ComfyUI. · locator: L63; create_origin_only_middleware L203-L235; L281-L284; L9, L26 source
Rights
| component | license | hosting | redistribution | modification | training | Evidence and notes |
|---|---|---|---|---|---|---|
| documentation | unknown | permitted | permitted | unknown | unknown | Applies to this original summary only, not to the cited sources. |
Linked records
- cites → https://github.com/Comfy-Org/ComfyUI/blob/1a82e6d01f395b43275c77acd289af1eb7090bb9/SECURITY.md
- cites → https://github.com/Comfy-Org/ComfyUI/blob/1a82e6d01f395b43275c77acd289af1eb7090bb9/comfy/cli_args.py
- cites → https://github.com/Comfy-Org/ComfyUI/blob/1a82e6d01f395b43275c77acd289af1eb7090bb9/openapi.yaml
- cites → https://github.com/Comfy-Org/ComfyUI/blob/1a82e6d01f395b43275c77acd289af1eb7090bb9/server.py
- cites → https://github.com/Comfy-Org/docs/blob/506a4a94db30524adb8706667aec050d71dbdf60/development/comfyui-server/api-key-integration.mdx
- cites → https://github.com/Comfy-Org/docs/blob/506a4a94db30524adb8706667aec050d71dbdf60/development/comfyui-server/api-proxy.mdx
- cites → https://github.com/Comfy-Org/docs/blob/506a4a94db30524adb8706667aec050d71dbdf60/development/comfyui-server/comms_overview.mdx