Skip to content

fix(security): use constant-time comparison for OAuth state and clean up renderer#26

Merged
appleboy merged 1 commit intomainfrom
worktree-cli
Mar 29, 2026
Merged

fix(security): use constant-time comparison for OAuth state and clean up renderer#26
appleboy merged 1 commit intomainfrom
worktree-cli

Conversation

@appleboy
Copy link
Copy Markdown
Member

Summary

  • Security fix: Replace != with crypto/subtle.ConstantTimeCompare for OAuth CSRF state validation in the callback handler, preventing timing attacks
  • Code cleanup: Remove dead lastContent field from FlowRenderer, extract scattered ANSI escape sequences into named constants, and eliminate unnecessary local variable copies

Test plan

  • make test — all tests pass (including TestCallbackServer_StateMismatch)
  • make lint — zero issues
  • make fmt — no formatting changes needed

🤖 Generated with Claude Code

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 29, 2026

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
tui/flow_renderer.go 0.00% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

… up renderer

- Use crypto/subtle.ConstantTimeCompare for CSRF state validation to prevent timing attacks
- Remove dead lastContent field from FlowRenderer (written but never read)
- Extract ANSI escape sequences into named constants
- Remove unnecessary local copies of headerLines field

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@appleboy appleboy merged commit 759ff39 into main Mar 29, 2026
16 checks passed
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.

2 participants