Skip to content

fix: Use timing-safe comparison for API key validation#752

Merged
Haroldwonder merged 1 commit into
Haroldwonder:mainfrom
obacollins-lab:fix/689-timing-safe-api-key
Jun 1, 2026
Merged

fix: Use timing-safe comparison for API key validation#752
Haroldwonder merged 1 commit into
Haroldwonder:mainfrom
obacollins-lab:fix/689-timing-safe-api-key

Conversation

@obacollins-lab
Copy link
Copy Markdown

  • Import timingSafeEqual from Node.js crypto module
  • Replace string equality (===) with timing-safe buffer comparison
  • Prevent timing attacks that could reveal key length and content
  • Handle buffer length mismatches gracefully
  • Maintain same authorization behavior with improved security

closes #689

- Import timingSafeEqual from Node.js crypto module
- Replace string equality (===) with timing-safe buffer comparison
- Prevent timing attacks that could reveal key length and content
- Handle buffer length mismatches gracefully
- Maintain same authorization behavior with improved security
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

Someone is attempting to deploy a commit to the Harold's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@obacollins-lab Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Haroldwonder Haroldwonder merged commit b1e3135 into Haroldwonder:main Jun 1, 2026
1 check failed
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.

api/src/routes/anchors.ts requireAdminApiKey compares keys with == instead of timing-safe comparison

2 participants