fix(security): register extension.manager.supports_csrf_post feature flag (4.2.1)#2820
Closed
ltdrdata wants to merge 1 commit intomanager-v4from
Closed
fix(security): register extension.manager.supports_csrf_post feature flag (4.2.1)#2820ltdrdata wants to merge 1 commit intomanager-v4from
ltdrdata wants to merge 1 commit intomanager-v4from
Conversation
…flag (4.2.1) Expose CSRF-POST backend capability as a semantic contract via ComfyUI core's feature_flags mechanism, so frontends (ComfyUI_frontend, extensions) can detect it without parsing version strings. Pre-4.2.1 Manager does not set the flag — clients observe its absence and should treat the backend as "incompatible with POST-only state-mutation endpoints" and prompt the user to upgrade. Follow-up patch to 4.2 (PR #2818); no endpoint or security behavior change. Reported-by: XlabAI Team of Tencent Xuanwu Lab CVSS: 8.1 (AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H)
ltdrdata
added a commit
to Comfy-Org/ComfyUI_frontend
that referenced
this pull request
Apr 22, 2026
…gate Align with Comfy-Org/ComfyUI-Manager#2818 (shipped in 4.2.0) and Comfy-Org/ComfyUI-Manager#2820 (shipped in 4.2.1). Service layer: - Convert START_QUEUE, UPDATE_ALL, UPDATE_COMFYUI, REBOOT to POST with body=null and preserved query params. Request shape compatible with the reject_simple_form_post gate (body=null + axios default application/json header is allowed). UI/state layer (useManagerState): - Add ManagerUIState.INCOMPATIBLE triggered when the Manager backend does not advertise extension.manager.supports_csrf_post. Treated as "not installed" — Manager buttons hide via shouldShowManagerButtons. - One-shot upgrade toast via watch(immediate:true) with a module-level guard; openManager() re-emits the toast on explicit user action. - i18n (en/ko) for the upgrade-required notification. Refs: Comfy-Org/ComfyUI-Manager#2818, Comfy-Org/ComfyUI-Manager#2820
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
extension.manager.supports_csrf_post = Trueon ComfyUI core'sSERVER_FEATURE_FLAGSat Manager startup, so frontends (ComfyUI_frontend, 3rd-party extensions) can detect CSRF-POST backend capability as a semantic contract via the existingapi.getServerFeature(...)mechanism.4.2→4.2.1.[4.2.1].Why a new flag (not version parsing)
Version-string parsing (
V4.2vsV4.1) is an implementation-detail check, not a semantic capability contract. Clients that parse the version string couple themselves to Manager's version-format convention (pre-release tags, future version-string format changes, etc.). A server-pushed feature flag is the right abstraction: it declares intent (“this backend supports POST-only state mutation”) independently of the version string.Coordinated with the ComfyUI_frontend team (cmfront) so they can adopt this flag as the probe for their "NEW_UI vs INCOMPATIBLE" decision. Pre-4.2.1 Manager does not set the flag → frontends treat its absence as
incompatibleand surface an "upgrade Manager" action to the user.Mechanism
.setdefaultchain coexists with the pre-existingextension.manager.supports_v4(hardcoded in core).Delivery: ComfyUI core pushes
SERVER_FEATURE_FLAGSvia the WebSocket handshake (seeserver.py:296) and viaGET /api/feature_flags(seeserver.py:689). Clients use their existing feature-flag infrastructure; no new endpoint on the Manager side.Test plan
python -m py_compile comfyui_manager/__init__.py→ OKcomfy_api.feature_flagswith a pre-seededsupports_v4=True): setdefault chain preservessupports_v4and writessupports_csrf_post=True→ final dict exactly{'extension': {'manager': {'supports_v4': True, 'supports_csrf_post': True}}}ruff check comfyui_manager/ --config ruff.toml→ All checks passedpytest tests/ --ignore=tests/e2e --ignore=tests/playwright --ignore=tests/common/test_git_helper.py -q→ 206 passed, 12 skipped (no regression)grep ^version pyproject.toml→version = "4.2.1"Related
extension.manager.supports_csrf_post.References