You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(security): add dedicated install flags decoupled from security_level
Gate 'install via git URL' and 'install via pip' with dedicated opt-in
boolean flags (allow_git_url_install / allow_pip_install) in config.ini
[default], fully replacing the security_level term on those surfaces
(REPLACE, not AND — a strict level no longer denies when the flag is on;
a weak level no longer allows when the flag is off).
- glob/manager_server.py: pure predicate is_dedicated_install_allowed
(flag AND loopback, request-time args.listen); REPLACE gates at
/customnode/install/git_url and /customnode/install/pip; batch
unknown-URL arm routes through the same full predicate at the risky
position (loopback term is load-bearing — the middle entry gate has
no network-position term; the entry gate itself stays in force);
unknown-pip in batch stays unconditionally blocked; new
SECURITY_MESSAGE_FLAG_* denial constants name the responsible flag;
security_403_response gains flag_token (comfyui_outdated keeps precedence)
- glob/manager_core.py: register both keys (read via get_bool default-false,
write list, exception fallback); "true"-only truthy; restart-only activation
- js/common.js: 403 dialog copy names the responsible flag at the two
install call sites
- README.md: security-policy docs for both flags (per-surface scope incl.
the batch entry-gate qualifier, REPLACE decoupling, loopback bound,
opt-in config snippet, default-deny + migration note); stale tier lists
corrected against the actual gates
- CHANGELOG.md: opt-in migration note + accepted residual risk (flags
bypass the forced-strong outdated-ComfyUI hardening on loopback,
opt-in only), decoupling claim qualified for the batch entry gate
Tests: unit suite (predicate truth table, REPLACE litmus both directions,
AST binding-proofs against live handlers, subprocess-isolated config
contract) plus a real-server E2E suite that mounts the Manager-under-test
via git worktree (exact-SHA pin, detached) against a real ComfyUI and
exercises both flag surfaces and both arms — deny arms (403 + flag-naming
body/log + no install artifact), git-URL allow arm (real clone), pip allow
arm as a two-phase reservation oracle — with zero-residual self-clean.
Module skips without E2E_COMFYUI_ROOT; unit suite unaffected.
The manager-v4 branch ships the identical policy (shared invariants +
config contract); this tree uses the degraded predicate 'flag AND
loopback' (no personal_cloud-equivalent mode here).
Two new boolean keys in `config.ini` (`[default]` section), both defaulting to
8
+
`false`, now govern the arbitrary-install surfaces:
9
+
10
+
| Flag | Governs |
11
+
|------|---------|
12
+
|`allow_git_url_install`|`POST /customnode/install/git_url` and the unknown-git-URL arm of `POST /manager/queue/install` (incl. reinstall delegation) — the entire install transaction, transitive dependency pip installs included. On the batch queue path the flag applies **in addition to** the queue's `security_level` entry gate (see below) |
13
+
|`allow_pip_install`|`POST /customnode/install/pip` only |
14
+
15
+
These surfaces additionally require a **loopback listener** (`--listen` on a
16
+
local IP); the flags never open a non-loopback deployment. On the two
17
+
**direct** endpoints (`POST /customnode/install/git_url` and
18
+
`POST /customnode/install/pip`), the flags fully **decouple** the surface
19
+
from `security_level`: it no longer has any effect in either direction — a
20
+
strict level cannot deny them when the flag is `true`, and a weak level
21
+
cannot allow them when the flag is `false`. On the **batch queue path**
22
+
(`POST /manager/queue/install`), the flag is **necessary but not
23
+
sufficient**: it gates the unknown-git-URL arm at the risky position, while
24
+
the queue's normal `security_level` entry gate (`middle`) remains in force —
25
+
at `security_level = strong`, batch unknown-URL installs stay denied even
26
+
with the flag set to `true`. `security_level` continues to govern every
27
+
other gated endpoint unchanged. Only the case-insensitive string `true`
28
+
enables a flag; a missing or malformed key reads as `false`.
29
+
30
+
#### Migration note (no auto-seed)
31
+
32
+
There is **no automatic migration** from `security_level`. Users who
33
+
previously relied on `security_level = weak` (or `normal-`) to use
34
+
install-via-git-URL / install-pip must now **opt in explicitly** by adding to
35
+
`config.ini`:
36
+
37
+
```ini
38
+
[default]
39
+
allow_git_url_install = true
40
+
allow_pip_install = true
41
+
```
42
+
43
+
Changes take effect after a **restart** (no hot reload).
Copy file name to clipboardExpand all lines: glob/manager_server.py
+42-9Lines changed: 42 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,8 @@
35
35
SECURITY_MESSAGE_NORMAL_MINUS="ERROR: To use this feature, you must either set '--listen' to a local IP and set the security level to 'normal-' or lower, or set the security level to 'middle' or 'weak'. Please contact the administrator.\nReference: https://github.com/ltdrdata/ComfyUI-Manager#security-policy"
36
36
SECURITY_MESSAGE_GENERAL="ERROR: This installation is not allowed in this security_level. Please contact the administrator.\nReference: https://github.com/ltdrdata/ComfyUI-Manager#security-policy"
37
37
SECURITY_MESSAGE_NORMAL_MINUS_MODEL="ERROR: Downloading models that are not in '.safetensors' format is only allowed for models registered in the 'default' channel at this security level. If you want to download this model, set the security level to 'normal-' or lower."
38
+
SECURITY_MESSAGE_FLAG_GIT_URL="ERROR: This action requires 'allow_git_url_install = true' in config.ini ([default] section). This setting is independent of security_level. Reference: https://github.com/ltdrdata/ComfyUI-Manager#security-policy"
39
+
SECURITY_MESSAGE_FLAG_PIP="ERROR: This action requires 'allow_pip_install = true' in config.ini ([default] section). This setting is independent of security_level. Reference: https://github.com/ltdrdata/ComfyUI-Manager#security-policy"
Copy file name to clipboardExpand all lines: js/common.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -232,7 +232,7 @@ export async function install_pip(packages) {
232
232
});
233
233
234
234
if(res.status==403){
235
-
awaithandle403Response(res);
235
+
awaithandle403Response(res,"To use this feature, set 'allow_pip_install = true' in config.ini ([default] section). This setting is independent of security_level.");
236
236
return;
237
237
}
238
238
@@ -267,7 +267,7 @@ export async function install_via_git_url(url, manager_dialog) {
267
267
});
268
268
269
269
if(res.status==403){
270
-
awaithandle403Response(res);
270
+
awaithandle403Response(res,"To use this feature, set 'allow_git_url_install = true' in config.ini ([default] section). This setting is independent of security_level.");
0 commit comments