API & Business Logic Testing
Bug Bounty Methodology · Bug Bounty track
5 min read
In this module
Beyond Traditional Web Vulnerabilities
The highest-impact bugs in modern applications often aren't injection or XSS. They live in the application's business logic, API authorisation, and authentication mechanisms. Scanners can't find them, because finding them requires knowing what the application is supposed to do — and then catching it failing to enforce its own rules.
API Endpoint Discovery
Modern apps are built on APIs. What you see in the browser is usually a thin client wrapping a REST or GraphQL backend. Hunt down undocumented endpoints and you'll often find functionality protected by far fewer controls than the main app.
Sources for API endpoint discovery:
- JavaScript files: client-side code contains API paths, often including internal or admin endpoints
- Mobile application binaries: decompiling mobile apps reveals API calls the web interface does not use
- API documentation: Swagger/OpenAPI files at
/swagger.json,/openapi.json, or/api-docs - Traffic analysis: proxy all application traffic through Burp Suite and catalogue every API call
- Predictable patterns: if
/api/v2/usersexists, try/api/v2/admin/usersor/api/v1/users
# Search for OpenAPI/Swagger documentationffuf -u https://api.target.com/FUZZ -w api-wordlist.txt \ -mc 200 -fs 0The OWASP API Security Top 10 2023 even gave this its own slot — API9, Improper Inventory Management — because organisations routinely lose track of which endpoints are exposed and which versions are still wired up.
Authentication Testing
Authentication flaws (OWASP API Top 10: API2 — Broken Authentication) let attackers impersonate other users, or bypass login entirely.
JWT attacks target applications using JSON Web Tokens. Common flaws include:
Common JWT weaknesses: - Algorithm confusion: changing RS256 to HS256, using the public key as HMAC secret - Missing signature verification: the server accepts tokens with no signature, including tokens whose header says "alg": "none" - Header injection: kid, jku or jwk headers that make the server fetch or trust a key the attacker controls - Weak signing keys: brute-forceable HMAC secrets - Token not expiring: no exp claim, or exp not validated - Sensitive data in payload: JWTs are base64-encoded, not encryptedOAuth flaws arise in the implementation of OAuth 2.0 flows. Look for:
- Missing
stateparameter validation (CSRF against the OAuth flow) - Open redirect in the
redirect_uriparameter (token theft) - Insecure token storage (tokens in URL fragments, localStorage)
- Scope escalation (requesting broader permissions than intended)
Probe authentication by examining how sessions are created, validated, and torn down. Can password reset flows be manipulated? Can account lockout be sidestepped? Does the MFA implementation have gaps? These are the questions that find paydays.
Business Logic Testing
Business logic vulnerabilities show up when each individual request looks fine, but the application fails to enforce its intended rules across the whole sequence of operations.
Automated scanners test individual requests for technical vulnerabilities (injection, XSS, etc.). Business logic flaws require understanding the intended workflow and finding where it can be subverted. Only a human tester who understands the application's purpose can identify these issues. This is why business logic testing is one of the most valuable skills in bug bounty hunting.
Common business logic targets:
- Price manipulation: modifying price values in API requests during checkout
- Quantity abuse: ordering negative quantities to generate credits
- Coupon stacking: applying discount codes in unintended combinations
- Feature abuse: using trial or free-tier features to access paid functionality
- Workflow bypass: skipping steps in multi-step processes (e.g., jumping from cart to order confirmation without payment)
POST /api/checkout HTTP/1.1Content-Type: application/json
{ "items": [{"id": "prod_123", "quantity": 1, "price": 0.01}], "coupon": "WELCOME50"}Test by intercepting legitimate requests in Burp Suite and tampering with the values the application naively trusts the client to send correctly.
Race Conditions
Race conditions arise when the outcome depends on the timing of concurrent requests. If the application checks a condition and then acts on it without atomic locking, an attacker can fire multiple simultaneous requests through the gap before the check catches up.
Common race condition targets:
- Coupon redemption: redeeming the same single-use coupon multiple times simultaneously
- Balance withdrawal: withdrawing funds from an account multiple times before the balance updates
- Vote/like manipulation: submitting multiple votes before the deduplication check runs
# Send 20 concurrent requests using Turbo Intruder (Burp extension)# or use curl with parallel executionseq 1 20 | xargs -P 20 -I{} curl -s -X POST \ https://target.com/api/redeem-coupon \ -H "Authorization: Bearer $TOKEN" \ -d '{"code":"FREEITEM"}'In Burp Suite, the Turbo Intruder extension or Repeater's "Send group in parallel" feature are the go-to tools for race condition testing.
Here's why those parallel requests work. Each stepper runs two copies of the redeem handler against a coupon with used = 0. In the first, the handler reads the flag, then writes it in a separate step: run both reads before either write and the coupon pays out twice. The second does the check and the write as one conditional update, the database equivalent of compare-and-swap, so only one request can ever flip the flag.
Check, then mark used
Pick which thread runs next and watch shared memory and registers change.
- 0r1 = used;// SELECT used FROM coupons
- 1if (r1 != 0) goto 4;// already used: reject
- 2used = 1;// UPDATE coupons SET used = 1
- 3fetch_add(&redemptions, 1);// apply the free item
- r1 = 0
- 0r1 = used;// SELECT used FROM coupons
- 1if (r1 != 0) goto 4;// already used: reject
- 2used = 1;// UPDATE coupons SET used = 1
- 3fetch_add(&redemptions, 1);// apply the free item
- r1 = 0
- redemptions = 0
- used = 0
Every possible schedule
60 of 66 possible schedules end with an unexpected result.
| Final result | Schedules |
|---|---|
| redemptions = 2, used = 1 | 60 |
| redemptions = 1, used = 1 | 6 |
Conditional update in one step
Pick which thread runs next and watch shared memory and registers change.
- 0ok = cas(&used, 0, 1);// UPDATE ... SET used = 1 WHERE used = 0
- 1if (ok == 0) goto 3;// no row updated: reject
- 2fetch_add(&redemptions, 1);// apply the free item
- ok = 0
- 0ok = cas(&used, 0, 1);// UPDATE ... SET used = 1 WHERE used = 0
- 1if (ok == 0) goto 3;// no row updated: reject
- 2fetch_add(&redemptions, 1);// apply the free item
- ok = 0
- redemptions = 0
- used = 0
Every possible schedule
0 of 12 possible schedules end with an unexpected result.
| Final result | Schedules |
|---|---|
| redemptions = 1, used = 1 | 12 |
Price Manipulation
E-commerce platforms and anything else handling money are prime targets for price manipulation. The attack is mundane: intercept a request that carries a price, quantity, or discount value, and change it.
Test every request in a purchase flow. Does the server recalculate prices from its own data, or does it just trust whatever the client sent? Are totals, taxes, and shipping computed server-side? A single endpoint that swallows a client-supplied price unchallenged can land you a critical finding with direct financial impact.
Business logic findings tend to attract higher bounties because the impact is so easy to articulate. A price manipulation bug that lets anyone buy a 4K TV for one penny doesn't need a CVSS calculator to justify the severity rating.