Reject malformed CoinPay webhook signatures

This commit is contained in:
Codex Microtask Operator 2026-06-13 01:38:25 +02:00
parent 8f4691584c
commit d60ceab6c2
2 changed files with 2 additions and 1 deletions

View file

@ -410,6 +410,7 @@ describe("POST /api/webhooks/coinpay", () => {
expect(verifyCoinPayWebhook(payload, `t=${timestamp},v1=${signature}`, secret)).toBe(true);
expect(verifyCoinPayWebhook(payload, `t=${timestamp}, v1=${signature}`, secret)).toBe(true);
expect(verifyCoinPayWebhook(payload, `t=${timestamp},v1=${signature}0`, secret)).toBe(false);
const response = await coinpayWebhook(
new NextRequest("http://localhost/api/webhooks/coinpay", {