Back to skills
SKILL.md
2149 Signature Verification Ea328765
ASecurity```typescript function verifyVercelSignature( payload: Buffer, signature: string, timestamp: string ): boolean { const secret = process.env.VERCEL_WEBHOOK_SECRET!;
- 9 stars
- 0 votes
- 0 copies
- 0 views
- Added October 11, 2026
Security analysis
100/100npx -y skills add tools-only/X-Skills --skill 2149-signature-verification_ea328765 --agent claude-codeAre you the author of 2149 Signature Verification Ea328765?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tools-only-2149-signature-verification-ea328765)# Signature Verification
## Signature Verification
```typescript
function verifyVercelSignature(
payload: Buffer,
signature: string,
timestamp: string
): boolean {
const secret = process.env.VERCEL_WEBHOOK_SECRET!;
// Reject old timestamps (replay attack protection)
const timestampAge = Date.now() - parseInt(timestamp) * 1000;
if (timestampAge > 300000) { // 5 minutes
console.error('Webhook timestamp too old');
return false;
}
// Compute expected signature
const signedPayload = `${timestamp}.${payload.toString()}`;
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(signedPayload)
.digest('hex');
// Timing-safe comparison
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expectedSignature)
);
}
```Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.