Commit Graph

1 Commits

Author SHA1 Message Date
rcourtman
f8b11b8c9f Require an instance admin to replace instance credentials
POST /api/security/regenerate-token and a forced POST
/api/security/quick-setup replace the instance's own credentials: the
whole API token inventory and, for quick setup, the administrator login.
Their session check was ensureAdminSession, which on an org-scoped
request admits anyone who can manage that organization. An organization
owner who named their organization in the request could therefore mint
a full-access default-organization token or set a new administrator
password, and take the instance over.

Session callers of both routes now also need instance administrator
privileges: a session that is not org-scoped and belongs to the
configured administrator or an RBAC admin grant, the rule
RequirePlatformAdmin and the security status capabilities already use.
Token callers keep the instance-wide token check added earlier, and
first-run setup, the bootstrap token and the recovery token are
unchanged.

Contract-Neutral: Narrows two instance-credential routes to the instance-administrator rule the status capabilities already advertise; no new API surface.
2026-10-17 00:16:58 +01:00