MergeShieldDemo
Like what you see? Sign up with GitHub to start governing your own repos — free forever.
Back to Pull Requests
Add Stripe webhook signature verification
35/100 Medium
35/100 Medium
Approved — ready to merge.
GitHub
Summary
Adds Stripe webhook signature verification — good security improvement with clean implementation.
Model: claude-sonnet-4-20250514Duration: 8900msTokens: 3100
Was this analysis helpful?
Risk Scores
Overall35/100
Complexity25/100
Security45/100
Blast Radius20/100
Test Coverage30/100
Breaking Change15/100
File-Level Risk
| File | Risk | Category | Details |
|---|---|---|---|
src/routes/stripe-webhooks.ts | 45 | security | Webhook handler with signature verification logic |
src/lib/stripe-verify.ts | 30 | security | HMAC-SHA256 signature verification utility |
src/config/stripe.ts | 15 | complexity | Stripe configuration with webhook secret |
security
45/100Findings
- • Stripe webhook signatures now verified using HMAC-SHA256
- • Webhook secret loaded from environment variable (good practice)
- • Replay protection via timestamp validation (5-minute window)
Suggestions
- → Add IP allowlist for Stripe webhook IPs as defense in depth
- → Log failed signature verification attempts for audit trail
test Coverage
30/100Findings
- • Unit tests verify signature computation
- • Missing test for expired timestamp rejection
- • No integration test with actual Stripe test events
Suggestions
- → Add test with Stripe CLI for end-to-end webhook verification
- → Test edge cases: empty body, missing signature header, malformed timestamp