mrhid6 965419b2b8 fix: Confine created API token scopes to the calling token's own
CreateAPIToken capped a new token's role at the creator's role but never
capped its scopes against the calling credential's scopes, and POST
/api/tokens required only settings:write. A token holding settings:write
alone could therefore mint a token holding keys:write or secrets:write,
reaching every SSH private key and vault secret in the instance.

createToken now refuses (403 scope_confinement) when the calling
credential is itself a token and any requested scope is not satisfied by
that token's own scopes, via services.ScopeSatisfied so servers:write
still permits granting servers:read. Cookie sessions are unaffected,
since their authority is the user's role. Also correct the createToken
doc comment, which claimed the scope cap already existed.

Also document why Hint stores 5 hex characters of the token secret.
2026-08-13 08:31:07 +00:00
2026-08-07 10:21:00 +01:00
2026-07-24 09:51:30 +01:00
2026-07-28 15:07:19 +01:00
2026-08-12 14:58:57 +00:00
2026-07-29 10:35:07 +01:00
2026-08-11 15:03:03 +00:00
2026-07-26 14:46:38 +01:00
2026-07-28 10:30:29 +01:00
S
Description
No description provided
14 MiB
agent/v1.3.4
Latest
2026-09-07 15:50:25 +00:00
Languages
JavaScript 71.9%
TypeScript 15.1%
Go 12.8%