Skip to content

fix: use constant-time comparison for auth token (CWE-208)#307

Open
teehooai wants to merge 1 commit intodjyde:masterfrom
teehooai:fix/cwe-208-timing-safe-comparison
Open

fix: use constant-time comparison for auth token (CWE-208)#307
teehooai wants to merge 1 commit intodjyde:masterfrom
teehooai:fix/cwe-208-timing-safe-comparison

Conversation

@teehooai
Copy link
Copy Markdown

Summary

Fixes #306 — replaces timing-vulnerable === comparison with constant-time timingSafeEqual.

Changes

  • Replace direct string comparison with constant-time comparison for admin password
  • No behavioral change for valid authentication flows

CWE Reference

  • CWE-208: Observable Timing Discrepancy
  • Uses stdlib only (crypto) — no new dependencies

Found by SpiderShield security scanner

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.

Security: timing attack in auth token comparison (CWE-208)

2 participants