Skip to content

Commit 8eb773e

Browse files
committed
fix(security): register extension.manager.supports_csrf_post feature 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)
1 parent 4410ebc commit 8eb773e

3 files changed

Lines changed: 31 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to **ComfyUI-Manager** are documented in this file.
55
The format is based on [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html).
77

8+
## [4.2.1] - 2026-04-22
9+
10+
### Added
11+
12+
- Server-push feature flag `extension.manager.supports_csrf_post` registered at
13+
startup, allowing ComfyUI-frontend (and other clients) to detect
14+
CSRF-POST backend support as a semantic capability contract, without
15+
relying on version string parsing. Pre-4.2.1 Manager does not set the
16+
flag — clients should treat its absence as 'incompatible with NEW_UI'.
17+
818
## [Unreleased]
919

1020
Security-hardening release on branch `fix/csrf-post-conversion`. Contains
@@ -120,4 +130,5 @@ below before upgrading programmatic clients.
120130
perform the change from a trusted entry point. Read access via `GET` is
121131
unaffected.
122132

133+
[4.2.1]: https://github.com/Comfy-Org/ComfyUI-Manager/compare/v4.2...v4.2.1
123134
[Unreleased]: https://github.com/Comfy-Org/ComfyUI-Manager/compare/v4.1b6...HEAD

comfyui_manager/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,25 @@
66
from comfy.cli_args import args
77

88

9+
# Register server-push feature flag so frontends (ComfyUI_frontend) can
10+
# detect CSRF-POST backend capability as a semantic contract (vs version
11+
# string parsing). See PR #2818 for context; cmfront uses this flag to
12+
# decide whether to invoke POST state-mutation endpoints. Pre-4.2.1 Manager
13+
# does not set this flag — cmfront treats its absence as 'incompatible'.
14+
try:
15+
from comfy_api import feature_flags as _core_feature_flags
16+
_mgr_flags = (
17+
_core_feature_flags.SERVER_FEATURE_FLAGS
18+
.setdefault('extension', {})
19+
.setdefault('manager', {})
20+
)
21+
_mgr_flags['supports_csrf_post'] = True
22+
except ImportError:
23+
# Older ComfyUI core without comfy_api.feature_flags module.
24+
# Manager functions but cmfront will not observe the flag.
25+
pass
26+
27+
928
def prestartup():
1029
from . import prestartup_script # noqa: F401
1130
logging.info('[PRE] ComfyUI-Manager')

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "comfyui-manager"
77
license = { text = "GPL-3.0-only" }
8-
version = "4.2"
8+
version = "4.2.1"
99
requires-python = ">= 3.9"
1010
description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI."
1111
readme = "README.md"

0 commit comments

Comments
 (0)