mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-11-05 07:47:25 +00:00
[PR #2818] [MERGED] fix(security): harden CSRF with Content-Type gate and expand E2E coverage #2800
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#2800
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/2818
Author: @ltdrdata
Created: 4/21/2026
Status: ✅ Merged
Merged: 4/21/2026
Merged by: @ltdrdata
Base:
manager-v4← Head:fix/csrf-post-conversion📝 Commits (1)
4eb5727fix(security): harden CSRF with Content-Type gate and expand E2E coverage📊 Changes
70 files changed (+13632 additions, -428 deletions)
View changed files
📝
.github/workflows/e2e.yml(+1 -1)📝
.gitignore(+2 -0)➕
CHANGELOG.md(+123 -0)📝
README.md(+2 -2)📝
comfyui_manager/__init__.py(+9 -1)📝
comfyui_manager/common/manager_security.py(+64 -0)📝
comfyui_manager/data_models/__init__.py(+2 -2)📝
comfyui_manager/data_models/generated_models.py(+19 -3)📝
comfyui_manager/glob/constants.py(+1 -0)📝
comfyui_manager/glob/manager_core.py(+11 -2)📝
comfyui_manager/glob/manager_server.py(+151 -53)📝
comfyui_manager/glob/utils/environment_utils.py(+12 -0)📝
comfyui_manager/glob/utils/security_utils.py(+9 -1)📝
comfyui_manager/js/cm-api.js(+1 -1)📝
comfyui_manager/js/comfyui-manager.js(+16 -7)📝
comfyui_manager/js/common.js(+1 -1)📝
comfyui_manager/js/custom-nodes-manager.js(+1 -1)📝
comfyui_manager/js/model-manager.js(+1 -1)📝
comfyui_manager/js/snapshot.js(+3 -3)📝
comfyui_manager/legacy/manager_core.py(+7 -2)...and 50 more files
📄 Description
Summary
<form method=POST>that bypasses method-only gating. The three CORS-safelisted simple-form Content-Types (x-www-form-urlencoded,multipart/form-data,text/plain) are rejected with 400; any other Content-Type forces a CORS preflight the server does not answer.comfyui_switch_versionmigrated to JSON body ({ver, client_id, ui_id}).db_mode/policy/update/channel_url_listsplit into GET(read) + POST(write, JSON body).do_fix'high'→'high+'(align withSECURITY_MESSAGE_HIGH_P);comfyui_switch_versionnewly gated at'high+'; three previously-ungated config setters (db_mode,policy/update,channel_url_list) now gated at'middle'.openapi.yamlfully resynchronized (27 paths, 30 operations, 3 dual-method splits).ComfyUISwitchVersionParamsconsolidated as a shared$refcomponent.start_comfyui_{legacy,permissive,strict}.sh), Playwright config + 6 legacy-UI spec files, pytest CSRF/secgate suites, 39-endpoint coverage matrix.CHANGELOG.md(Keep a Changelog 1.1.0) added.Breaking changes (migration notes in
CHANGELOG.md)POST /v2/manager/queue/batch:queue/install,queue/uninstall,queue/fix,queue/disable,queue/update,queue/reinstall,queue/abort_current.GET /manager/notice(v1) removed;/v2/manager/noticeretained.Related
mainbranch (v1/manager/*routes) handling the same CVE: #2819fix(security): harden CSRF with Content-Type gate and ...) and identicalReported-by/CVSStrailer for audit cross-reference (git log --grep='XlabAI' --all).Test plan
ruff check comfyui_manager/→ All checks passedpython -m py_compileon all touched files → OKpytest tests/ --ignore=tests/e2e --ignore=tests/playwright→ 206 passed, 12 skipped (baseline preserved)pytest --collect-only tests/e2e/test_e2e_csrf.py tests/e2e/test_e2e_csrf_legacy.py→ 110 testspython scripts/verify_audit_counts.py→ PASS (122,0,0,1,123)Review summary
References
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.