The six STRIDE threat categories applied to Paystack: (S) Spoofing — attacker sends a fake webhook pretending to be Paystack; defend with HMAC signature validation. (T) Tampering — attacker modifies the transaction amount in transit; defend by setting amounts server-side. (R) Repudiation — a fraudulent refund with no audit trail; defend with immutable payment logs. (I) Information Disclosure — secret key in logs or frontend; defend with log sanitization and environment variables. (D) Denial of Service — card testing attack floods your checkout; defend with rate limiting. (E) Elevation of Privilege — a finance staff member triggers a transfer by exploiting a missing role check; defend with RBAC on transfer endpoints.
| Threat | Attack Scenario | Surface | Defence |
|---|---|---|---|
| Spoofing | Attacker sends a fake charge.success webhook to your endpoint | Webhook handler | Validate x-paystack-signature HMAC SHA512 on every incoming request |
| Tampering | Customer intercepts checkout request and changes amount from NGN 10,000 to NGN 1 | Checkout initiation | Backend reads amount from database (order record), ignores client-supplied value |
| Repudiation | Staff member initiates an unauthorized refund and denies it | Admin panel / refund endpoint | Immutable audit log: record user ID, action, amount, timestamp before processing |
| Information Disclosure | Secret key appears in server logs or a public GitHub repo | Environment / logging | Log sanitization, secrets manager, pre-commit hooks scanning for "sk_live_" |
| Denial of Service | Card testing attack: 500 rapid checkout attempts flood your endpoint and accumulate failed transaction fees | Checkout endpoint | Rate limiting (5 req/min/IP), CAPTCHA after 2 failures, IP blocking on repeated failures |
| Elevation of Privilege | Finance user calls /api/transfers/initiate endpoint due to missing role check | Transfer endpoint | RBAC middleware: requirePaymentRole('admin') on all transfer endpoints |
1. Webhook handler (Spoofing + Repudiation)
Your webhook endpoint is the highest-risk surface. It receives unauthenticated HTTP requests from the internet and directly triggers business logic (order fulfillment, account top-up, subscription activation). A missing signature check means any attacker can trigger fulfillment without paying.
2. Secret key storage (Information Disclosure)
The Paystack live secret key gives full API access: read all transactions, initiate transfers, create subaccounts. If it leaks via logs, a .env file in git, or a compromised developer machine, the attacker has silent full access until you rotate the key.
3. Amount handling in checkout (Tampering)
The transaction amount must be set server-side. If your backend accepts the amount from the client request body, any user with browser dev tools can pay NGN 1 for any product.
4. Transfer endpoint authorization (Elevation of Privilege)
An unprotected transfer endpoint can be called by any authenticated user. This allows any staff member or even a customer (if they have any authenticated session) to initiate payouts to arbitrary bank accounts.
Get weekly developer tips
Join 25,000+ developers. Practical guides, job tips, and new content — straight to your inbox.
No spam. Unsubscribe anytime.
This guide is part of the Paystack security guide.
KES 2,999
The definitive guide to building payment systems with Paystack — from your first transaction to production-grade payment infrastructure across Africa. 9 modules, 47 lessons. Free preview available.
Start Paystack Course