01 //Introduction
Business logic flaws are vulnerabilities that arise from faulty assumptions in application design rather than from technical coding mistakes. Unlike SQL injection or XSS, these flaws cannot be detected by automated scanners because they involve the legitimate features of an application being used in unintended ways.
A business logic vulnerability exists when an attacker can manipulate the normal workflow of an application to achieve an outcome the developers never intended—purchasing items at zero cost, bypassing approval steps, accumulating unlimited rewards, or escalating privileges through indirect state manipulation. These flaws are often the highest-impact findings in security assessments precisely because they slip through automated tooling.
Exploits a coding mistake. Automated scanners can detect it. Well-documented fix patterns. Example: SQL injection, XSS.
Exploits a design assumption. Scanners almost never find it. Requires understanding business context. Example: Price manipulation, workflow bypass.
02 //Real-World Scenario
Consider an e-commerce checkout flow. The application calculates the order total on the client side and sends it to the server for payment processing. The developer assumed users would only interact through the UI:
1// Client-side (React)
2async function handleCheckout(cart) {
3 const total = cart.items.reduce(
4 (sum, item) => sum + item.price * item.quantity, 0
5 );
6
7 const response = await fetch('/api/checkout', {
8 method: 'POST',
9 body: JSON.stringify({
10 items: cart.items,
11 total: total, // Client-calculated total sent to server
12 }),
13 });
14}
15
16// Server-side (Express)
17app.post('/api/checkout', async (req, res) => {
18 const { items, total } = req.body;
19
20 // BUG: Server trusts the client-provided total!
21 const charge = await stripe.charges.create({
22 amount: Math.round(total * 100),
23 currency: 'usd',
24 source: req.body.paymentToken,
25 });
26
27 await createOrder(req.user.id, items, total);
28 res.json({ success: true, orderId: charge.id });
29});An attacker intercepts the request with a proxy and changes total from 299.99 to 0.01. The server charges one cent and creates a legitimate order for the full set of items. The code has no technical bug—no injection, no overflow—just a flawed assumption that the client can be trusted.
What is the root cause of this vulnerability?
03 //Understanding Logic Flaws
Business logic flaws stem from implicit assumptions developers make about how users will interact with the application. These assumptions are rarely documented, making them invisible to anyone who wasn't part of the original design conversation.
Common Dangerous Assumptions
| Assumption | Reality | Exploit |
|---|---|---|
| Users follow the intended step order | Steps can be skipped via direct API calls | Skip payment step, go straight to order confirmation |
| Prices and totals come from the UI | Request bodies can be freely modified | Change price to 0.01 in the checkout request |
| Quantities are always positive integers | Negative values bypass validation | Add -1 items to get a credit/refund |
| A coupon can only be applied once | Race conditions allow parallel applies | Send 50 concurrent coupon-apply requests |
| Users can only act on their own resources | IDs in requests can be changed | Change user_id parameter to access other accounts |
| Rate limits prevent brute force | Limits may reset or apply only to one endpoint | Rotate between equivalent endpoints to bypass limits |
Why are business logic flaws considered harder to find than injection vulnerabilities?
04 //Common Flaw Categories
While each business logic flaw is unique to the application, they tend to fall into recognizable categories. Knowing these categories helps you systematically audit code during review.
Business Logic Flaw Taxonomy
| Category | Description | Example |
|---|---|---|
| Price/Value Manipulation | Modifying monetary values the server trusts | Changing item price in checkout request |
| Workflow Bypass | Skipping mandatory steps in a process | Accessing order confirmation without paying |
| Abuse of Functionality | Using a legitimate feature in unintended ways | Using "gift card" feature to transfer money between accounts |
| Insufficient Process Validation | Missing server-side checks for state transitions | Changing order status from "pending" to "shipped" directly |
| Accumulation Abuse | Exploiting reward/loyalty systems beyond limits | Earning referral bonuses by referring yourself |
| Numeric Boundary Errors | Exploiting edge cases in numeric handling | Negative quantities causing refunds or integer overflow in totals |
| Time-of-Check to Time-of-Use | Exploiting gaps between validation and action | Modifying cart contents after coupon validation |
1# Vulnerable order processing
2@app.route('/api/add-to-cart', methods=['POST'])
3def add_to_cart():
4 item_id = request.json['item_id']
5 quantity = request.json['quantity']
6
7 # No check for negative quantities!
8 item = Product.query.get(item_id)
9 cart = get_user_cart(current_user.id)
10
11 # With quantity = -5 and price = 100:
12 # line_total = -500 (credit instead of charge!)
13 line_total = item.price * quantity
14 cart.add_item(item_id, quantity, line_total)
15 cart.update_total()
16
17 return jsonify({'cart_total': cart.total})1// Vulnerable multi-step form (no server-side state tracking)
2// Step 1: Enter details
3app.post('/api/application/details', (req, res) => {
4 saveDetails(req.user.id, req.body);
5 res.json({ nextStep: '/verify' });
6});
7
8// Step 2: Identity verification (meant to be mandatory)
9app.post('/api/application/verify', (req, res) => {
10 verifyIdentity(req.user.id, req.body);
11 res.json({ nextStep: '/submit' });
12});
13
14// Step 3: Final submission
15app.post('/api/application/submit', (req, res) => {
16 // BUG: Does NOT check if step 2 (verification) was completed!
17 const app = finalizeApplication(req.user.id);
18 res.json({ applicationId: app.id, status: 'approved' });
19});
20
21// Attacker skips step 2 entirely by calling /submit directlyAn application allows users to transfer loyalty points to other users. What business logic risk should you check for?
05 //Code Review Patterns
During code review, look for these specific code patterns that indicate potential business logic vulnerabilities. These are the "sinks" of business logic flaws—places where assumptions about data or flow can be violated.
1// RED FLAG: Any time a monetary value, role, or status comes from
2// the request body rather than being computed server-side
3
4// VULNERABLE
5app.post('/api/order', (req, res) => {
6 const { price, discount, total } = req.body; // All from client!
7 chargeUser(req.user, total);
8});
9
10// SECURE
11app.post('/api/order', (req, res) => {
12 const { itemIds, couponCode } = req.body; // Only IDs from client
13 const items = Product.findAll(itemIds); // Prices from DB
14 const discount = validateCoupon(couponCode); // Discount computed server-side
15 const total = computeTotal(items, discount); // Total computed server-side
16 chargeUser(req.user, total);
17});1# RED FLAG: Status transitions without validating current state
2
3# VULNERABLE: Any status can be set regardless of current state
4@app.route('/api/order/<order_id>/status', methods=['PUT'])
5def update_status(order_id):
6 new_status = request.json['status']
7 order = Order.query.get(order_id)
8 order.status = new_status # No transition validation!
9 db.session.commit()
10 return jsonify({'status': new_status})
11
12# SECURE: Enforce valid state transitions
13VALID_TRANSITIONS = {
14 'pending': ['confirmed', 'cancelled'],
15 'confirmed': ['processing', 'cancelled'],
16 'processing': ['shipped', 'cancelled'],
17 'shipped': ['delivered', 'returned'],
18 'delivered': ['returned'],
19 'cancelled': [],
20 'returned': [],
21}
22
23@app.route('/api/order/<order_id>/status', methods=['PUT'])
24def update_status(order_id):
25 new_status = request.json['status']
26 order = Order.query.get(order_id)
27
28 if new_status not in VALID_TRANSITIONS.get(order.status, []):
29 return jsonify({'error': 'Invalid status transition'}), 400
30
31 order.status = new_status
32 db.session.commit()
33 return jsonify({'status': new_status})1// RED FLAG: Sensitive actions that can be repeated without limits
2
3// VULNERABLE: Referral bonus applied every time the endpoint is called
4app.post('/api/referral/claim', async (req, res) => {
5 const { referralCode } = req.body;
6 const referrer = await User.findOne({ referralCode });
7 if (referrer) {
8 await referrer.addBonus(10); // No check if already claimed!
9 await req.user.addBonus(5);
10 res.json({ success: true });
11 }
12});
13
14// SECURE: Track and prevent duplicate claims
15app.post('/api/referral/claim', async (req, res) => {
16 const { referralCode } = req.body;
17
18 // Check if this user already claimed a referral
19 const existing = await ReferralClaim.findOne({
20 claimedBy: req.user.id,
21 });
22 if (existing) {
23 return res.status(409).json({ error: 'Referral already claimed' });
24 }
25
26 const referrer = await User.findOne({ referralCode });
27 if (!referrer || referrer.id === req.user.id) {
28 return res.status(400).json({ error: 'Invalid referral' });
29 }
30
31 // Atomic: record claim and add bonuses in one transaction
32 await db.transaction(async (tx) => {
33 await ReferralClaim.create({ referrer: referrer.id, claimedBy: req.user.id }, { transaction: tx });
34 await referrer.addBonus(10, { transaction: tx });
35 await req.user.addBonus(5, { transaction: tx });
36 });
37
38 res.json({ success: true });
39});req.body.price, req.body.total, req.body.amount — client-supplied monetary valuesreq.body.role, req.body.status, req.body.isAdmin — client-supplied privilege datareq.body.discount, req.body.quantity — values that should be validated against boundsMissing checks for
quantity > 0, amount > 0, or enum membership on status fields06 //Assumption-Based Input Flaws
Many business logic flaws hide in the gap between what the UI allows and what the API accepts. The UI might enforce rules (positive quantities, valid date ranges, minimum order amounts), but the API may not re-validate those constraints.
1// Discount percentage from request — what if it's over 100?
2app.post('/api/apply-discount', (req, res) => {
3 const { discountPercent } = req.body;
4
5 // VULNERABLE: No upper bound check
6 const discount = cartTotal * (discountPercent / 100);
7 const finalTotal = cartTotal - discount;
8 // discountPercent = 150 → finalTotal is NEGATIVE → refund!
9});
10
11// Integer overflow in quantity × price
12app.post('/api/cart/add', (req, res) => {
13 const { quantity, itemId } = req.body;
14 const item = getItem(itemId);
15
16 // VULNERABLE: Very large quantity could cause overflow
17 // In some languages/systems, MAX_INT + 1 wraps to negative
18 const lineTotal = item.price * quantity;
19});
20
21// SECURE: Validate all numeric boundaries
22app.post('/api/apply-discount', (req, res) => {
23 const { discountPercent } = req.body;
24
25 if (typeof discountPercent !== 'number' ||
26 discountPercent < 0 ||
27 discountPercent > 100) {
28 return res.status(400).json({ error: 'Invalid discount' });
29 }
30
31 const discount = cartTotal * (discountPercent / 100);
32 const finalTotal = Math.max(0, cartTotal - discount);
33});1# VULNERABLE: Loose comparison allows bypass
2def check_access_code(user_input, stored_code):
3 # In PHP (==): "0e123" == "0e456" is True (both parsed as 0)
4 # In JavaScript (==): 0 == "" is True
5 # In Python, explicit type coercion can cause issues:
6 if int(user_input) == stored_code:
7 return True # "00123" and 123 both pass
8
9# SECURE: Strict comparison with type checking
10def check_access_code(user_input, stored_code):
11 if not isinstance(user_input, str) or not isinstance(stored_code, str):
12 return False
13 # Constant-time comparison to prevent timing attacks
14 return hmac.compare_digest(user_input, stored_code)Common Input Assumption Failures
| Input Field | Assumption | Exploit |
|---|---|---|
| Quantity | Always ≥ 1 | Send 0, -1, or 999999999 |
| Price/Amount | Comes from product DB | Override in request body |
| Discount % | Between 0–100 | Send 200 for a net credit |
| Date range | Start < End | Swap dates to bypass duration checks |
| One account per email | Use aliases: user+tag@domain.com | |
| Currency | Matches store region | Switch to weaker currency after pricing |
A checkout API accepts a 'currency' field from the client. What business logic risk does this create?
07 //Prevention Techniques
Preventing business logic flaws requires a different mindset than preventing technical vulnerabilities. The focus shifts from "sanitize input" to "enforce business rules server-side at every step."
Prevention Strategies
| Strategy | Purpose | Implementation |
|---|---|---|
| Server-side recalculation | Never trust client-supplied values | Recompute prices, totals, and discounts from DB data |
| State machine enforcement | Prevent step-skipping and invalid transitions | Track workflow state; validate transitions explicitly |
| Idempotency tokens | Prevent duplicate action abuse | Require unique token per sensitive operation |
| Boundary validation | Reject unexpected numeric ranges | Enforce min/max on quantities, amounts, percentages |
| Threat modeling | Identify flaws before code is written | Map data flows and trust boundaries in design phase |
| Invariant assertions | Catch impossible states at runtime | Assert total > 0, quantity > 0, balance >= 0 before writes |
1app.post('/api/checkout', async (req, res) => {
2 const { itemIds, quantities, couponCode, idempotencyKey } = req.body;
3
4 // 1. Idempotency: prevent duplicate submissions
5 const existing = await Order.findOne({ idempotencyKey, userId: req.user.id });
6 if (existing) {
7 return res.json({ orderId: existing.id, message: 'Already processed' });
8 }
9
10 // 2. Fetch authoritative prices from DB (never from client)
11 const items = await Product.findAll({ where: { id: itemIds } });
12 if (items.length !== itemIds.length) {
13 return res.status(400).json({ error: 'Invalid items' });
14 }
15
16 // 3. Validate quantities (positive integers within stock limits)
17 for (let i = 0; i < items.length; i++) {
18 const qty = quantities[i];
19 if (!Number.isInteger(qty) || qty < 1 || qty > items[i].stock) {
20 return res.status(400).json({ error: 'Invalid quantity' });
21 }
22 }
23
24 // 4. Server-side total calculation
25 let subtotal = items.reduce(
26 (sum, item, i) => sum + item.price * quantities[i], 0
27 );
28
29 // 5. Validate and apply coupon server-side
30 let discount = 0;
31 if (couponCode) {
32 const coupon = await Coupon.findOne({
33 where: { code: couponCode, active: true },
34 });
35 if (!coupon || coupon.usedCount >= coupon.maxUses) {
36 return res.status(400).json({ error: 'Invalid coupon' });
37 }
38 discount = Math.min(
39 subtotal * (coupon.percent / 100),
40 coupon.maxDiscount
41 );
42 }
43
44 const total = Math.max(0, subtotal - discount);
45
46 // 6. Invariant assertion
47 if (total <= 0 && subtotal > 0) {
48 throw new Error('Business rule violation: total cannot be zero for non-empty order');
49 }
50
51 // 7. Atomic order creation
52 const order = await db.transaction(async (tx) => {
53 const ord = await Order.create({
54 userId: req.user.id,
55 total,
56 idempotencyKey,
57 status: 'pending',
58 }, { transaction: tx });
59
60 if (couponCode) {
61 await Coupon.increment('usedCount', {
62 where: { code: couponCode },
63 transaction: tx,
64 });
65 }
66
67 for (let i = 0; i < items.length; i++) {
68 await Product.decrement('stock', {
69 by: quantities[i],
70 where: { id: items[i].id, stock: { [Op.gte]: quantities[i] } },
71 transaction: tx,
72 });
73 }
74
75 return ord;
76 });
77
78 res.json({ orderId: order.id, total });
79});1. Does the server recalculate all monetary values from authoritative data?
2. Are workflow steps enforced server-side with state tracking?
3. Are quantities and amounts validated for type, range, and sign?
4. Can this action be replayed for unintended benefit?
5. Are there race conditions between validation and execution?
6. Can a user act on resources that don't belong to them?
08 //Payment & E-Commerce Flaws
E-commerce and payment systems are the most common targets for business logic attacks because they directly convert logic flaws into financial gain. Understanding these patterns is critical for reviewing any application that handles money.
1# VULNERABLE: Multiple coupons can be stacked
2@app.route('/api/apply-coupon', methods=['POST'])
3def apply_coupon():
4 coupon_code = request.json['code']
5 coupon = Coupon.query.filter_by(code=coupon_code, active=True).first()
6
7 if not coupon:
8 return jsonify({'error': 'Invalid coupon'}), 400
9
10 cart = get_user_cart(current_user.id)
11 # BUG: Adds discount on top of existing discounts without limit
12 cart.discount += coupon.discount_amount
13 cart.save()
14
15 return jsonify({'new_total': cart.total - cart.discount})
16
17# Attack: Apply coupon A (20% off), then coupon B (20% off)
18# Result: 40% total discount — or keep applying until items are free
19
20# SECURE: Allow only one coupon and validate total stays positive
21@app.route('/api/apply-coupon', methods=['POST'])
22def apply_coupon():
23 coupon_code = request.json['code']
24 cart = get_user_cart(current_user.id)
25
26 if cart.applied_coupon:
27 return jsonify({'error': 'A coupon is already applied'}), 400
28
29 coupon = Coupon.query.filter_by(code=coupon_code, active=True).first()
30 if not coupon:
31 return jsonify({'error': 'Invalid coupon'}), 400
32
33 discount = min(coupon.discount_amount, cart.subtotal)
34 cart.discount = discount
35 cart.applied_coupon = coupon.id
36 cart.save()
37
38 return jsonify({'new_total': max(0, cart.subtotal - discount)})1// VULNERABLE: Gift card purchase + immediate use = money laundering
2app.post('/api/purchase-gift-card', async (req, res) => {
3 const { amount, paymentMethod } = req.body;
4 // Charge credit card
5 await charge(paymentMethod, amount);
6 // Create gift card
7 const card = await GiftCard.create({ balance: amount });
8 res.json({ giftCardCode: card.code });
9});
10
11app.post('/api/redeem-gift-card', async (req, res) => {
12 const { code } = req.body;
13 const card = await GiftCard.findOne({ code });
14 // BUG: Gift card can be redeemed by the same user who bought it!
15 // BUG: Gift card balance can be transferred to bank account
16 await req.user.addCredit(card.balance);
17 card.balance = 0;
18 await card.save();
19 res.json({ newBalance: req.user.credit });
20});
21
22// Attack flow:
23// 1. Buy gift card with stolen credit card
24// 2. Redeem gift card to own account
25// 3. Withdraw balance to bank
26// Result: Stolen CC → clean funds1// VULNERABLE: Different services use different price sources
2// Product service
3app.get('/api/products/:id', (req, res) => {
4 const product = products.find(p => p.id === req.params.id);
5 // Returns current price from product catalog
6 res.json(product);
7});
8
9// Cart service (separate microservice)
10app.post('/api/cart/add', (req, res) => {
11 const { productId, price } = req.body;
12 // BUG: Trusts price from the request, not from product service!
13 // If prices change, cart might have stale prices
14 // Attacker can send any price they want
15 cart.items.push({ productId, price });
16 cart.save();
17});
18
19// SECURE: Cart service fetches price from product service
20app.post('/api/cart/add', async (req, res) => {
21 const { productId } = req.body;
22 const product = await productService.getProduct(productId);
23 cart.items.push({ productId, price: product.price });
24 cart.save();
25});Common E-Commerce Logic Flaws
| Flaw | Impact | Prevention |
|---|---|---|
| Client-trusted pricing | Free or discounted purchases | Always compute prices server-side |
| Coupon stacking | Excessive discounts | Limit to one coupon; validate total > 0 |
| Negative quantity refund | Credit generation | Enforce quantity ≥ 1 |
| Currency mismatch | Pay in weaker currency | Server determines currency |
| Gift card laundering | Money laundering | Delay redemption; verify purchaser ≠ redeemer |
| Inventory race condition | Overselling limited stock | Atomic stock decrement with DB constraints |
A user adds an item to their cart at $50, then the store raises the price to $75. The user checks out and is charged $50. Is this a vulnerability?
09 //Workflow & State Bypass
Many applications implement multi-step workflows—onboarding, KYC verification, approval chains, subscription management. Business logic flaws in these workflows allow attackers to skip steps, reverse completed actions, or manipulate state in ways the designers never anticipated.
1// VULNERABLE: Subscription change doesn't check feature usage
2app.post('/api/subscription/change', async (req, res) => {
3 const { newPlan } = req.body;
4 const user = await User.findById(req.user.id);
5
6 // Changes plan immediately
7 user.plan = newPlan;
8 await user.save();
9
10 // BUG: Doesn't revoke access to premium features already in use
11 // User on "Enterprise" plan creates 100 projects (limit: unlimited)
12 // Downgrades to "Free" plan (limit: 3 projects)
13 // Still has access to all 100 projects!
14
15 res.json({ plan: newPlan });
16});
17
18// SECURE: Enforce limits on downgrade
19app.post('/api/subscription/change', async (req, res) => {
20 const { newPlan } = req.body;
21 const user = await User.findById(req.user.id);
22 const planLimits = getPlanLimits(newPlan);
23
24 // Check if current usage exceeds new plan limits
25 const projectCount = await Project.count({ userId: user.id });
26 if (projectCount > planLimits.maxProjects) {
27 return res.status(400).json({
28 error: 'Please reduce projects to ' + planLimits.maxProjects +
29 ' before downgrading',
30 currentCount: projectCount,
31 newLimit: planLimits.maxProjects,
32 });
33 }
34
35 user.plan = newPlan;
36 await user.save();
37 res.json({ plan: newPlan });
38});1# VULNERABLE: Approval workflow with no chain enforcement
2@app.route('/api/expense/<expense_id>/approve', methods=['POST'])
3def approve_expense(expense_id):
4 expense = Expense.query.get(expense_id)
5
6 # BUG 1: No check that the approver has authority for this amount
7 # BUG 2: No check that lower-level approval happened first
8 # BUG 3: Approver can approve their own expense
9
10 expense.status = 'approved'
11 expense.approved_by = current_user.id
12 db.session.commit()
13
14 return jsonify({'status': 'approved'})
15
16# SECURE: Full approval chain enforcement
17APPROVAL_THRESHOLDS = [
18 (1000, 'manager'), # Up to $1000: manager approval
19 (10000, 'director'), # Up to $10000: + director approval
20 (float('inf'), 'vp'), # Above $10000: + VP approval
21]
22
23@app.route('/api/expense/<expense_id>/approve', methods=['POST'])
24def approve_expense(expense_id):
25 expense = Expense.query.get(expense_id)
26
27 # Cannot approve own expense
28 if expense.submitted_by == current_user.id:
29 return jsonify({'error': 'Cannot approve own expense'}), 403
30
31 # Validate prior-level approvals exist and that approver has authority
32 required_levels = [
33 level for threshold, level in APPROVAL_THRESHOLDS
34 if expense.amount <= threshold
35 ]
36 existing_approvals = {a.level for a in expense.approvals}
37 current_user_level = get_approval_level(current_user)
38
39 # Record this approval
40 Approval.create(
41 expense_id=expense.id,
42 user_id=current_user.id,
43 level=current_user_level,
44 )
45
46 if all(l in existing_approvals | {current_user_level} for l in required_levels):
47 expense.status = 'approved'
48
49 db.session.commit()
50 return jsonify({'status': expense.status})A KYC (Know Your Customer) flow requires uploading ID, then a selfie, then address proof. What's the most important server-side check?
10 //Real-World Case Studies
Business logic flaws have caused some of the largest financial losses and most embarrassing security incidents in the industry. These case studies illustrate how real-world applications were exploited.
1Vulnerable flow:
21. User has $50 wallet balance
32. User buys Game A ($50) — request 1
43. User simultaneously buys Game B ($50) — request 2
5
6Thread 1: Thread 2:
7 Check balance: $50 ✓ Check balance: $50 ✓
8 Purchase Game A Purchase Game B
9 Deduct $50 Deduct $50
10 Balance: $0 Balance: -$50 (or $0 if unsigned)
11
12Result: User spent $50 but got $100 worth of games
13
14Fix: Use database-level atomic operations
15 UPDATE wallets
16 SET balance = balance - 50
17 WHERE user_id = ? AND balance >= 50
18 -- Returns 0 rows affected if insufficient balanceNotable Business Logic Bounties
| Company | Flaw | Impact | Bounty |
|---|---|---|---|
| Uber | Free ride via promo code stacking | Unlimited free rides | $5,000 |
| Shopify | Negative cart total via discounts | Free merchandise | $15,000 |
| Starbucks | Gift card balance duplication | Infinite store credit | $4,000 |
| HackerOne | Invite manipulation for extra bounties | Bonus payments | $7,500 |
| PayPal | Currency conversion arbitrage | Profit from rounding | $10,000 |
| Airbnb | Bypassing booking requirements | Book without payment | $3,000 |
What technique would prevent the Starbucks gift card duplication flaw?
11 //Tools & Resources
Because automated scanners struggle with business logic flaws, the tools in this category focus on manual testing, proxy interception, and systematic methodology rather than automatic detection.
Tools for Business Logic Testing
| Category | Tool | Use Case |
|---|---|---|
| Proxy | Burp Suite | Intercept and modify request values (prices, quantities, statuses) |
| Proxy | OWASP ZAP | Replay and tamper with multi-step workflows |
| Race Testing | Turbo Intruder (Burp) | Send concurrent requests to test race conditions |
| Race Testing | racepwn | Specialized race condition testing tool |
| API Testing | Postman | Manually test APIs with modified parameters |
| API Testing | Insomnia | Explore and test API workflows step by step |
| Methodology | OWASP Testing Guide | Business logic testing procedures (OTG-BUSLOGIC) |
| Threat Modeling | STRIDE / LINDDUN | Systematic identification of design-level risks |
1Business Logic Test Plan:
2
31. PRICE INTEGRITY
4 [ ] Modify price/total in checkout request
5 [ ] Try negative quantities
6 [ ] Try quantities of 0
7 [ ] Try very large quantities (integer overflow)
8 [ ] Apply multiple coupons
9 [ ] Apply expired coupons
10 [ ] Use coupon from different region/product
11
122. WORKFLOW INTEGRITY
13 [ ] Skip steps (call step 3 API without step 2)
14 [ ] Repeat steps (resubmit step 1 after step 2)
15 [ ] Go backwards (return to step 1 after step 3)
16 [ ] Complete workflow with missing data
17
183. LIMITS AND BOUNDARIES
19 [ ] Exceed account limits (storage, projects, users)
20 [ ] Use features above subscription tier
21 [ ] Exceed rate limits via multiple endpoints
22 [ ] Test trial period boundaries (extend, restart)
23
244. RACE CONDITIONS
25 [ ] Concurrent coupon applications
26 [ ] Concurrent balance transfers
27 [ ] Concurrent stock purchases (limited items)
28 [ ] Concurrent account updates
29
305. ROLE AND ACCESS
31 [ ] Access resources by changing IDs in URLs/params
32 [ ] Perform actions reserved for higher roles
33 [ ] Approve own requests
34 [ ] Act on resources during state transitionsUseful resources for studying business logic vulnerabilities:
- OWASP Business Logic Testing Guide
- PortSwigger Business Logic Labs
- OWASP Abuse Case Cheat Sheet
- CWE-840: Business Logic Errors
- HackerOne Disclosed Business Logic Reports
12 //Conclusion
Business logic flaws are among the highest-impact and most difficult-to-detect vulnerability classes. They cannot be found by automated scanners, they don't follow predictable patterns like injection attacks, and they require deep understanding of the application's intended behavior. This makes skilled code reviewers—people who ask "what if the user doesn't follow the happy path?"—the best defense against them.
Enforce workflow state: Track multi-step processes server-side and validate that each step was legitimately completed before allowing the next.
Validate boundaries: Check that quantities, amounts, and percentages are within valid ranges—including being positive.
Prevent replay and races: Use idempotency tokens and atomic database operations for any action that creates value (payments, transfers, rewards).
Think like an attacker: For every feature, ask: "How could this be abused to gain money, access, or data that wasn't intended?"
The best time to catch business logic flaws is during design and code review—before they reach production. Incorporate abuse case thinking into your development process, add business invariant assertions to critical code paths, and always verify that your server enforces the same rules your UI presents. These practices will dramatically reduce the risk of logic-level exploitation.