fix(core): reject signatures with empty secret - #593
Conversation
|
@ShinyHero666 is attempting to deploy a commit to the corsair Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThe shared HMAC-SHA256 verifier now rejects missing secrets. Tests cover empty-secret rejection, valid-secret acceptance, and fail-closed behavior through the Slack signature alias. ChangesWebhook signature verification
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Greptile SummaryThis PR makes Slack-style HMAC verification fail closed when passed an empty secret while preserving caller-level skip behavior.
Confidence Score: 5/5The PR appears safe to merge, with current callers preserving their existing caller-level handling for absent secrets. The changed helper now fails closed as intended, valid HMAC verification remains covered, and current repository callers guard missing secrets before invoking the helper. Important Files Changed
Reviews (1): Last reviewed commit: "fix(core): reject signatures with empty ..." | Re-trigger Greptile |
|
@ambikeesshh This is ready for review. The full CI suite and both automated reviews are green, with no inline findings. Thanks! |
Description
verifyHmacSha256Signaturereturnedtruebefore checking the signature whenever the shared secret was empty. That made the shared helper, and its Slack alias, fail open for direct callers.This change:
falsewhen the HMAC secret is emptyCloses #587
Checklist
Before submitting your PR, please verify the following:
pnpm lintand all checks passpnpm typecheckand there are no TypeScript errorspnpm buildand all packages build successfullypnpm testand all tests passScreenshots / Demos (if applicable)
Not applicable.
Additional Notes
Regression validation:
Received: truepnpm --filter corsair test -- --runTestsByPath tests/webhook-utils.test.ts --runInBand(3 passed)pnpm --filter corsair test -- --runInBand --testPathIgnorePatterns=postgres-js-database.test.ts(280 passed, 2 skipped)Summary by CodeRabbit
Bug Fixes
Tests