Skip to content

feat(cloudflare): add HMAC-signed state for CSRF protection in OAuth flow#625

Merged
dcramer merged 1 commit into
mainfrom
encode-state
Nov 4, 2025
Merged

feat(cloudflare): add HMAC-signed state for CSRF protection in OAuth flow#625
dcramer merged 1 commit into
mainfrom
encode-state

Conversation

@dcramer

@dcramer dcramer commented Nov 4, 2025

Copy link
Copy Markdown
Member

Replace base64-encoded state parameters with HMAC-signed compact format to prevent tampering and replay attacks during OAuth approval flow.

Key changes:

  • State parameters now include signature, issued-at, and expiry timestamps
  • 10-minute expiry window prevents replay attacks
  • Signature verification ensures state integrity
  • Comprehensive tests for tampering, expiry, and secret validation

Security improvements:

  • CSRF protection via cryptographic signatures
  • Time-bound state prevents stale approval attempts
  • Tamper detection for clientId and other OAuth parameters

🤖 Generated with Claude Code

…flow

Replace base64-encoded state parameters with HMAC-signed compact format
to prevent tampering and replay attacks during OAuth approval flow.

Key changes:
- State parameters now include signature, issued-at, and expiry timestamps
- 10-minute expiry window prevents replay attacks
- Signature verification ensures state integrity
- Comprehensive tests for tampering, expiry, and secret validation

Security improvements:
- CSRF protection via cryptographic signatures
- Time-bound state prevents stale approval attempts
- Tamper detection for clientId and other OAuth parameters

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Code <noreply@anthropic.com>
@dcramer dcramer merged commit 4af98e7 into main Nov 4, 2025
14 checks passed
@dcramer dcramer deleted the encode-state branch November 4, 2025 03:47
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.

1 participant