ID: SUM-SEC-10
Wave: P1
Severity: Medium
Labels: security, api-key, P1, medium
Branch: fix/SUM-SEC-10-apikey-lifecycle-flash
Languages: Go
CWE: CWE-262 / CWE-522
Summary
Leaked sk_… is full user power until manual deactivate (no expires_at, scopes, or last_used_at). Creation flash embeds plaintext key in HTML (apikey_flash) — any XSS in the next ~120s steals it. Bearer auth correctly skips CSRF; hashing (SHA-256 of strong random) is fine.
Acceptance criteria
Files to check / change
sumeru/core/server/web/apikey.go
sumeru/core/server/web/apikey_create.go
sumeru/core/server/web/apikey_flash.go
sumeru/core/server/web/page_flash.go
sumeru/addons/base/models/ (apikey model if present)
ID: SUM-SEC-10
Wave: P1
Severity: Medium
Labels: security, api-key, P1, medium
Branch:
fix/SUM-SEC-10-apikey-lifecycle-flashLanguages: Go
CWE: CWE-262 / CWE-522
Summary
Leaked
sk_…is full user power until manual deactivate (noexpires_at, scopes, orlast_used_at). Creation flash embeds plaintext key in HTML (apikey_flash) — any XSS in the next ~120s steals it. Bearer auth correctly skips CSRF; hashing (SHA-256 of strong random) is fine.Acceptance criteria
expires_at; reject expired keys inapikey.golast_used_at; rate-limit failed key authFiles to check / change
sumeru/core/server/web/apikey.gosumeru/core/server/web/apikey_create.gosumeru/core/server/web/apikey_flash.gosumeru/core/server/web/page_flash.gosumeru/addons/base/models/(apikey model if present)