mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-11-04 23:37:31 +00:00
[PR #2820] [CLOSED] fix(security): register extension.manager.supports_csrf_post feature flag (4.2.1) #2804
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/ComfyUI-Manager#2804
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/ComfyUI-Manager/pull/2820
Author: @ltdrdata
Created: 4/22/2026
Status: ❌ Closed
Base:
manager-v4← Head:fix/csrf-post-feature-flag📝 Commits (1)
8eb773efix(security): register extension.manager.supports_csrf_post feature flag (4.2.1)📊 Changes
3 files changed (+31 additions, -1 deletions)
View changed files
📝
CHANGELOG.md(+11 -0)📝
comfyui_manager/__init__.py(+19 -0)📝
pyproject.toml(+1 -1)📄 Description
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.