gabriel / musehub public
BREAKING task/security-depth-sweep #1 / 1
gabriel · 170 days ago · Apr 10, 2026 · Diff

security: defense-in-depth auth checks for all MCP write tools and REST endpoints

- MCP issues: add _require_public_or_write_access to create_issue, create_issue_comment; add _require_write_access + actor param to update_issue - MCP proposals: add _require_public_or_write_access to create_proposal, create_proposal_comment - MCP repos: guard create_repo against empty owner_user_id (unauthenticated callers) - REST webhooks: add _guard_repo_owner to redeliver_delivery (was auth-only, not authz) - REST labels: add _guard_repo_owner to assign_labels_to_proposal and remove_label_from_proposal (were scope-only, no repo-level ownership check) - Dispatcher: pass actor=user_id to execute_update_issue (was missing) - Tests: 20+ new auth tests covering forbidden paths for all affected executors

sha256:b52c6cbdd7835160038c284ec5ab828b8c999530f1913d4e17110acbbc153eab sha
+13 ~23 symbols
sha256:14500c2377a9d71e8040d1ef6493ab0a02945944d3dffc33abe458eda8da04b3 snapshot
+13
symbols added
~23
symbols modified
0
dead code introduced
Semantic Changes 36 symbols
~ musehub/mcp/dispatcher.py .py 1 symbol modified
~ musehub/mcp/write_tools/issues.py .py 1 symbol added, 4 symbols modified
+ _require_public_or_write_access function async_function _require_public_or_write_access L333–381
~ musehub/mcp/write_tools/proposals.py .py 1 symbol added, 3 symbols modified
~ tests/test_mcp_write_tools.py .py 11 symbols added, 11 symbols modified
+ test_any_user_can_create_issue_on_public_repo method async_method test_any_user_can_create_issue_on_public_repo L303–309
+ test_forbidden_on_private_repo_for_non_owner method async_method test_forbidden_on_private_repo_for_non_owner L312–319
+ test_forbidden_without_auth method async_method test_forbidden_without_auth L322–329
+ test_forbidden_on_private_repo_for_non_owner method async_method test_forbidden_on_private_repo_for_non_owner L446–455
+ test_forbidden_without_auth method async_method test_forbidden_without_auth L436–443
+ test_any_user_can_create_proposal_on_public_repo method async_method test_any_user_can_create_proposal_on_public_repo L489–497
+ test_forbidden_on_private_repo_for_non_owner method async_method test_forbidden_on_private_repo_for_non_owner L500–509
+ test_forbidden_without_auth method async_method test_forbidden_without_auth L512–521
+ test_forbidden_when_unauthenticated method async_method test_forbidden_when_unauthenticated L720–728
+ test_forbidden_non_collaborator method async_method test_forbidden_non_collaborator L403–414
+ test_forbidden_without_auth method async_method test_forbidden_without_auth L393–400
← Older Oldest on task/security-depth-sweep
All commits
Newer → Latest on task/security-depth-sweep

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:b52c6cbdd7835160038c284ec5ab828b8c999530f1913d4e17110acbbc153eab --body "your comment"