mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-06-23 00:09:25 +08:00
Add two boolean config.ini [default] flags — allow_git_url_install and allow_pip_install (both default false) — that fully REPLACE the security_level term on the legacy install surfaces: - POST /v2/customnode/install/git_url (S-A) and POST /v2/customnode/install/pip (S-B) are now gated solely by their dedicated flag AND the retained network-position invariant (loopback listener OR network_mode=personal_cloud). security_level no longer affects these two surfaces in either direction. - The batch unknown-URL branch (S-C) routes through the same predicate; the unknown-pip branch stays unconditionally blocked; the general middle+ batch entry gate is unchanged. - New pure predicate is_dedicated_install_allowed() in common/manager_security.py (config-import-free; callers pass values from their own reader). Both config readers (glob + legacy) register the keys in read/write/fallback paths. - Denial logs and frontend copy name the responsible flag instead of the misleading security_level guidance. Public listeners remain denied regardless of the flags (no exposure widening). - README security policy updated: config keys documented, git-url/pip removed from the security_level risky table, and a dedicated-flags subsection (REPLACE semantics, network rule, batch behavior, restart-only activation, weak/normal- opt-in migration note). - Migration: existing weak/normal- users must opt in via the new flags (CHANGELOG note; deliberate no auto-seed). Includes the unit/config/guard test suites (88 tests): predicate truth table, dual-reader config contract (missing/malformed keys read false, round-trip, cache staleness), security_level-matrix freeze guards, and suite-order-independent test stubs.
8.2 KiB
8.2 KiB
Changelog
All notable changes to ComfyUI-Manager are documented in this file.
The format is based on Keep a Changelog 1.1.0, and this project adheres to Semantic Versioning 2.0.0.
[Unreleased]
Security
- Dedicated install flags decouple git-URL / pip installs from
security_level:POST /v2/customnode/install/git_urlandPOST /v2/customnode/install/pip(and the batch install path for git URLs not in the custom-node DB) are now gated by two newconfig.ini[default]flags —allow_git_url_installandallow_pip_install— instead ofsecurity_level. Both default tofalse(secure by default), and a non-loopback listener stays denied unlessnetwork_mode = personal_cloud(the existing network-position invariant is retained — the flags never widen exposure beyond what was possible before).security_levelno longer has any effect on these two endpoints, in either direction. The unknown-pip-package block in batch installs remains unconditional. Activation requires a restart (no hot reload).
Migration notes
- Users running
security_level = weakornormal-: these environments could previously use the git-URL / pip install endpoints; after upgrading they are denied (HTTP 403) until you explicitly opt in by settingallow_git_url_install = trueand/orallow_pip_install = truein the[default]section ofconfig.ini. The flags are NOT auto-seeded from yoursecurity_level— explicit opt-in is intentional.
4.2.1 - 2026-04-22
Security-hardening release. Contains breaking-ish API changes for state-mutating endpoints. See Migration notes below before upgrading programmatic clients.
Security
- CSRF Content-Type gate: 18 state-mutation POST handlers (9 in
glob, 9 inlegacy) now reject the three CORS "simple request" Content-Types (application/x-www-form-urlencoded,multipart/form-data,text/plain). This closes the residual<form method="POST">bypass route that remained after the GET→POST transition. Legitimate clients usingapplication/json(or no body) are unaffected. do_fixsecurity level raised fromhightohigh+: aligns the enforcement gate (is_allowed_security_level) with the log text emitted bySECURITY_MESSAGE_HIGH_P. Bothglob/manager_server.pyandlegacy/manager_server.pyupdated in lockstep. Environments running atsecurity_level = highcan no longer fix a nodepack — usesecurity_level = normalor lower.- Config setters now gated at
middlesecurity level:POST /v2/manager/db_mode,POST /v2/manager/policy/update, andPOST /v2/manager/channel_url_listnow checkis_allowed_security_level('middle')before mutating configuration (bothglobandlegacy). Closes a pre-existing gap where the write path was reachable at any security level. Reads (GET) remain unrestricted.
Changed
- State-changing endpoints converted from
GETtoPOST(CSRF hardening):/v2/manager/queue/{update_all, reset, start, update_comfyui},/v2/snapshot/{remove, restore, save},/v2/comfyui_manager/comfyui_switch_version,/v2/manager/reboot. Query-string parameters are preserved where they existed; only the HTTP method changes. POST /v2/comfyui_manager/comfyui_switch_versionparameters moved from query string to JSON body (REST idiom + body-reading CSRF posture): The handler now consumesapplication/jsonwith the body shape{"ver": "...", "client_id": "...", "ui_id": "..."}instead of reading?ver=...&client_id=...&ui_id=...from the URL. Because body-reading handlers are already covered by the CORS-preflight mechanism for cross-origin protection, the Content-Type rejection gate introduced for the other state-mutation endpoints is intentionally NOT applied here (seecomfyui_manager/common/manager_security.pymodule docstring). The first-party JS client incomfyui_manager/js/comfyui-manager.jswas updated in the same change; third-party callers must migrate.- Config endpoints split into
GET(read) +POST(write):/v2/manager/{db_mode, policy/update, channel_url_list}.GETreturns the current value;POSTaccepts a JSON body{"value": "..."}. The prior single-method form that accepted a?value=...query parameter on either verb is retired. openapi.yamlfully resynchronized with the server: HTTP methods, the dual-method splits above, request-body schemas for the new POST setters, and theTaskHistoryItem.paramsfield now matchmanager_server.py.- Legacy
restart(self)→restart(request): parameter name corrected. No behavioral change.
Added
- Server-push feature flag
extension.manager.supports_csrf_postregistered at startup, allowing ComfyUI-frontend (and other clients) to detect CSRF-POST backend support as a semantic capability contract, without relying on version string parsing. Manager versions prior to 4.2.1 do not set the flag — clients should treat its absence as 'incompatible with POST-only state-mutation endpoints'. - E2E test harness variants for security-level and legacy-mode scenarios:
tests/e2e/scripts/start_comfyui_legacy.sh,tests/e2e/scripts/start_comfyui_permissive.sh,tests/e2e/scripts/start_comfyui_strict.sh. Seedocs/guide/GUIDE_E2E_TEST.mdfor usage. COMFYUI_MANAGER_SKIP_MANAGER_REQUIREMENTSenvironment variable: when set, skips themanager_requirements.txtreinstall path. Intended for E2E environments where those dependencies are provisioned separately.TaskHistoryItem.paramsfield (Pydantic +openapi.yaml): mirrorsQueueTaskItem.paramsso that task history retains the original request payload (nullable when unavailable).- Automated endpoint coverage — pytest E2E + Playwright specs covering all
39 unique
(method, path)endpoints acrossglobandlegacy. Coverage is tracked inreports/api-coverage-matrix.mdandreports/e2e_test_coverage.md.
Removed
- Legacy per-operation POST routes consolidated into
POST /v2/manager/queue/batch:/v2/manager/queue/{install, uninstall, update, fix, disable, reinstall, abort_current}. The first-party JS client already usesqueue/batch; only third-party scripts that call the per-operation routes directly are affected. GET /manager/notice(v1, pip-install redirect banner).GET /v2/manager/noticeremains available.
Migration notes
- Third-party clients calling
POST /v2/manager/queue/install(and the other per-operation queue routes) must switch toPOST /v2/manager/queue/batchwith a body such as{"install": [{id, ver, ...}], "batch_id": "..."}. Seereports/endpoint_scenarios.mdfor the full payload shape. - Programmatic clients that posted to the CSRF-hardened endpoints with
application/x-www-form-urlencoded,multipart/form-data, ortext/plainmust switch toapplication/json(or omit the body entirely when the endpoint takes its parameters from the query string). - Clients that called any of the methods listed under Changed → State-changing
endpoints with
GETmust switch toPOST. Query parameters remain valid. - Clients that wrote configuration via
GET /v2/manager/{db_mode, policy/update, channel_url_list}?value=...must switch toPOSTwith JSON body{"value": "..."}. - Third-party scripts calling
POST /v2/comfyui_manager/comfyui_switch_version?ver=...&client_id=...&ui_id=...must switch toPOSTwithContent-Type: application/jsonand body{"ver": "...", "client_id": "...", "ui_id": "..."}. The query-string form no longer works. - Environments running at
security_level = highcan no longer rundo_fix. Either lower the security level (normal,normal-, orweakas appropriate) or skip the fix operation. - Environments running at
security_level = highcan no longer mutatedb_mode,policy/update, orchannel_url_listvia POST (returns403). Lower the security level tonormalor below to change configuration, or perform the change from a trusted entry point. Read access viaGETis unaffected.