Skip to content

fix(cloud): constant-time credential comparisons (#350)#399

Open
rudi193-cmd wants to merge 1 commit into
Gentleman-Programming:mainfrom
rudi193-cmd:fix/constant-time-token-compare
Open

fix(cloud): constant-time credential comparisons (#350)#399
rudi193-cmd wants to merge 1 commit into
Gentleman-Programming:mainfrom
rudi193-cmd:fix/constant-time-token-compare

Conversation

@rudi193-cmd
Copy link
Copy Markdown

Summary

  • Replace plain == bearer/admin token checks with hmac.Equal in internal/cloud/auth/auth.go and three sites in internal/cloud/cloudserver/cloudserver.go.
  • Matches the comparison primitive already used for dashboard session signatures in the same package.

Test plan

  • go test ./internal/cloud/auth/... ./internal/cloud/cloudserver/... (existing tests; no behavior change for valid/invalid tokens)

Fixes #350

Made with Cursor

…ng#350)

Replace plain string equality on bearer and dashboard admin tokens with
hmac.Equal so comparisons do not short-circuit on the first differing byte.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(cloud/auth): use constant-time compare for bearer token

1 participant