Files
multica/server/internal/handler
da278c7d42 fix(auth): block machine credentials from minting long-lived tokens (MUL-8154) (#9421)
An agent task token (mat_) authenticates as the runtime owner, and neither
POST /api/cli-token nor the /api/tokens group checked the actor source. A
prompt-injected agent could trade its 24h task token for a 30-day session
JWT or a non-expiring PAT, and could list or revoke the owner's PATs.

- Mount RequireHumanActor on /api/cli-token and the whole /api/tokens group
  (also rejects mcn_ cloud-node PATs).
- Add a handler-level backstop in IssueCliToken and
  CreatePersonalAccessToken so a future route refactor cannot drop the guard.
- Add router-level integration tests (real Auth -> router -> handler, with a
  forged X-Actor-Source) and handler backstop tests.

Co-authored-by: multica-eve <[email protected]>
Co-authored-by: multica-agent <[email protected]>
2026-10-22 13:49:25 +08:00
..