security: close wire-protocol write-authorization gap (#131)
push/unpack-mpack, push/mpack-presign, releases, tags, and version-tags all depended only on require_valid_token -- proof of *some* valid signed identity -- with no check that the signer had write access to the specific repo being written to. Any registered identity could push to any repo, public or private, regardless of collaborator status.
Add _assert_writable (musehub/api/routes/wire.py), mirroring the existing owner-or-write/admin-collaborator check already used correctly by repair-object/snapshot/commit and by issues.py/proposals.py's _guard_repo_owner. Unlike _assert_readable, visibility never widens write access -- a public repo still requires owner or write/admin collaborator status to push directly.
Regression suite (tests/test_authz_wire_push.py) proves the gap first (AUTHZ_01/02 from the issue) then confirms the fix: owner and accepted write/admin collaborators can still push; non-collaborators, read-only collaborators, and pending (not yet accepted) collaborators are rejected with 403 on every affected endpoint.
Semantic Changes
67 symbols
0 comments
muse hub commit comment sha256:fcce6888011c181054887be7e797ccf323705c409aeb4030c1a376d557146cc7 --body "your comment"
No comments yet. Be the first to start the discussion.