Skip to content

fix(config): use constant-time comparison for JWT signature verification#2086

Merged
bpamiri merged 1 commit intodevelopfrom
peter/fix-jwt-timing-attack
Apr 10, 2026
Merged

fix(config): use constant-time comparison for JWT signature verification#2086
bpamiri merged 1 commit intodevelopfrom
peter/fix-jwt-timing-attack

Conversation

@bpamiri
Copy link
Copy Markdown
Collaborator

@bpamiri bpamiri commented Apr 10, 2026

Summary

  • Replace string != operator with MessageDigest.isEqual() for JWT signature comparison to prevent timing attacks
  • Adds test for single-character signature difference rejection
  • Matches the constant-time pattern already used for reload password (onapplicationstart.cfc:159) and console eval (consoleeval.cfm:116)

Test plan

  • Existing JWT tests pass (encode/decode/expiry/signature rejection)
  • New test verifies single-char signature diff is rejected
  • Run bash tools/test-local.sh for full suite

🤖 Generated with Claude Code

Replace string != operator with MessageDigest.isEqual() for JWT signature
comparison to prevent timing attacks. This matches the pattern already used
for reload password and console eval password verification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bpamiri bpamiri merged commit 8e661b7 into develop Apr 10, 2026
3 checks passed
@bpamiri bpamiri deleted the peter/fix-jwt-timing-attack branch April 10, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant