mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-08-15 07:17:30 +00:00
Reject malformed CoinPay webhook signatures
This commit is contained in:
parent
8f4691584c
commit
d60ceab6c2
2 changed files with 2 additions and 1 deletions
|
|
@ -117,7 +117,7 @@ export function verifyCoinPayWebhook(
|
|||
const parts = signatureHeader.split(",").map((part) => part.trim());
|
||||
const timestamp = parts.find((part) => part.startsWith("t="))?.slice(2);
|
||||
const signature = parts.find((part) => part.startsWith("v1="))?.slice(3);
|
||||
if (!timestamp || !signature) {
|
||||
if (!timestamp || !/^[0-9a-fA-F]{64}$/.test(signature)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue