Skip to content

security: add timing-safe HMAC-SHA256 webhook signature verification for GitHub App#852

Merged
temma02 merged 1 commit into
StellerCraft:mainfrom
Darkdruce:feat/github-webhook-signature-verification
Jun 27, 2026
Merged

security: add timing-safe HMAC-SHA256 webhook signature verification for GitHub App#852
temma02 merged 1 commit into
StellerCraft:mainfrom
Darkdruce:feat/github-webhook-signature-verification

Conversation

@Darkdruce

Copy link
Copy Markdown
Contributor

Closes #765

Implements HMAC-SHA256 timing-safe signature verification for all /api/admin/webhooks/ routes.

  • Adds verifyGitHubSignature and withGitHubWebhookAuth in src/lib/github/github-webhook.ts
  • Missing X-Hub-Signature-256 header returns 401 with WWW-Authenticate: HMAC
  • Invalid signatures return 401 and log source IP via structured logger
  • Secret read exclusively from GITHUB_WEBHOOK_SECRET env var (never hardcoded)
  • Applied to all /api/admin/webhooks/dlq and /api/admin/webhooks/replay routes
  • Tests cover valid sig, invalid sig, missing header, and timing-safe comparison

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Darkdruce 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

@temma02 temma02 merged commit a96e4d6 into StellerCraft:main Jun 27, 2026
0 of 7 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.

Implement GitHub App Webhook Signature Verification with Timing-Safe Comparison

2 participants