Skip to content
Back to skills

Business Logic Testing

ASecurity

Professional skills and methodology for business logic vulnerability testing

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
developmentjavascriptpythonjavaawstestingapidatabase

Works with

  • api
  • mcp

Security analysis

A100/100

Scanned November 29, 2026

npx -y skills add blackfoxxx/kestrel --skill business-logic-testing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Business Logic Testing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Business Logic Testing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/blackfoxxx-business-logic-testing/badge)](https://www.skillsdirectory.com/skills/blackfoxxx-business-logic-testing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: business-logic-testing
description: Professional skills and methodology for business logic vulnerability testing
version: 1.0.0
mcps: autopen, pentest mcp, browser
---

# Business Logic Vulnerability Testing

## Overview

Business logic vulnerabilities are design flaws in an application's business processing flows that can lead to unauthorized operations, data tampering, financial loss, and more. This skill provides methods for detecting, exploiting, and defending against business logic vulnerabilities.

## Vulnerability Types

### 1. Workflow Bypass

**Skipping validation steps:**
- Accessing the final step directly
- Altering the order of steps
- Repeatedly executing a step

### 2. Price Manipulation

**Negative prices:**
- Entering a negative amount
- Causing an increase in account balance

**Price tampering:**
- Modifying the front-end price
- Modifying the price in an API request

### 3. Quantity Limit Bypass

**Negative quantities:**
- Entering a negative number
- Potentially causing an increase in inventory

**Exceeding limits:**
- Modifying the quantity limit
- Bypassing with bulk operations

### 4. Race Conditions

**Concurrent requests:**
- Sending multiple requests simultaneously
- Bypassing single-use limits

### 5. State Manipulation

**State rollback:**
- Changing a completed order back to pending payment
- Modifying order state

## Testing Methods

### 1. Workflow Analysis

**Identifying business processes:**
- Registration flow
- Purchase flow
- Withdrawal flow
- Review/approval flow

**Testing step skipping:**
```
Normal flow: Step 1 → Step 2 → Step 3
Test: Access Step 3 directly
Test: Step 1 → Step 3 (skipping Step 2)
```

### 2. Parameter Tampering

**Modifying key parameters:**
```http
POST /api/purchase
{
  "product_id": 123,
  "quantity": 1,
  "price": 100.00  # Change to 0.01
}
```

**Negative value testing:**
```json
{
  "quantity": -1,
  "price": -100.00
}
```

### 3. Concurrency Testing

**Sending requests simultaneously:**
```python
import threading
import requests

def purchase():
    requests.post('https://target.com/api/purchase', 
                  json={'product_id': 123, 'quantity': 1})

# Send 10 requests simultaneously
for i in range(10):
    threading.Thread(target=purchase).start()
```

### 4. State Modification

**Modifying order state:**
```http
PATCH /api/order/123
{
  "status": "completed"  # Change to completed
}
```

**Rolling back state:**
```http
PATCH /api/order/123
{
  "status": "pending"  # Roll back from completed to pending payment
}
```

## Exploitation Techniques

### Price Manipulation

**Negative price:**
```json
{
  "product_id": 123,
  "price": -100.00,
  "quantity": 1
}
```

**Modifying the front-end price:**
```javascript
// Front-end code
const price = 100.00;

// Change to
const price = 0.01;
```

**API price modification:**
```http
POST /api/checkout
{
  "items": [
    {
      "product_id": 123,
      "price": 0.01,  # Original price 100.00
      "quantity": 1
    }
  ]
}
```

### Quantity Limit Bypass

**Negative quantity:**
```json
{
  "product_id": 123,
  "quantity": -10  # May cause an increase in inventory
}
```

**Exceeding the limit:**
```json
{
  "product_id": 123,
  "quantity": 999999  # Exceeds the per-purchase limit
}
```

### Coupon Abuse

**Repeated use:**
```http
POST /api/checkout
{
  "coupon": "DISCOUNT50",
  "items": [...]
}

# Reusing the same coupon
```

**Inactive coupon:**
```http
POST /api/checkout
{
  "coupon": "EXPIRED_COUPON",  # Using an expired coupon
  "items": [...]
}
```

### Withdrawal Vulnerabilities

**Negative withdrawal:**
```json
{
  "amount": -1000.00  # May cause an increase in account balance
}
```

**Exceeding the balance:**
```json
{
  "amount": 999999.00  # Exceeds the account balance
}
```

### Race Conditions

**Concurrent purchases:**
```python
import threading
import requests

def buy():
    requests.post('https://target.com/api/purchase',
                  json={'product_id': 123, 'quantity': 1})

# Flash sale, concurrent requests
for i in range(100):
    threading.Thread(target=buy).start()
```

## Bypass Techniques

### Front-end Validation Bypass

**Calling the API directly:**
- Bypass front-end JavaScript validation
- Send API requests directly

**Modifying requests:**
- Intercept with Burp Suite
- Modify the parameters and send

### Status Code Analysis

**Observing responses:**
- 200 OK - possibly successful
- 400 Bad Request - parameter error
- 403 Forbidden - insufficient permissions
- 500 Internal Server Error - server error

### Leveraging Error Messages

**Obtaining information from error messages:**
```
Error: "Insufficient balance, current balance: 100.00"
→ You can obtain account balance information
```

## Tool Usage

### Burp Suite

**Using Repeater:**
1. Intercept the business request
2. Modify key parameters
3. Observe the response

**Using Intruder:**
1. Mark the parameters
2. Use a payload list
3. Test in bulk

### Custom Scripts

```python
import requests
import json

def test_price_manipulation():
    # Test price modification
    for price in [0.01, -100, 0, 999999]:
        data = {
            "product_id": 123,
            "price": price,
            "quantity": 1
        }
        response = requests.post('https://target.com/api/purchase',
                                json=data)
        print(f"Price {price}: {response.status_code}")

test_price_manipulation()
```

## Verification and Reporting

### Verification Steps

1. Confirm that the business logic restrictions can be bypassed
2. Verify that unauthorized operations can be performed
3. Assess the impact (financial loss, data tampering, etc.)
4. Record a complete PoC
5. Enter confirmed vulnerabilities into the platform via the `report_finding` tool (the sole entry point for recording vulnerabilities on this platform), with fields covering location, type, severity, reproduction steps/PoC, and remediation advice

### Reporting Key Points

- Vulnerability location and business process
- Unauthorized operations that can be performed
- Complete exploitation steps and PoC
- Remediation advice (server-side validation, business rule checks, etc.)

## Protective Measures

### Recommended Approaches

1. **Server-side validation**
   ```python
   def process_purchase(product_id, quantity, price):
       # Get the real price from the database
       real_price = db.get_product_price(product_id)
       
       # Validate the price
       if price != real_price:
           raise ValueError("Price mismatch")
       
       # Validate the quantity
       if quantity <= 0:
           raise ValueError("Invalid quantity")
       
       # Process the purchase
       process_order(product_id, quantity, real_price)
   ```

2. **State machine validation**
   ```python
   class OrderState:
       PENDING = "pending"
       PAID = "paid"
       SHIPPED = "shipped"
       COMPLETED = "completed"
       
       TRANSITIONS = {
           PENDING: [PAID],
           PAID: [SHIPPED],
           SHIPPED: [COMPLETED]
       }
       
       def can_transition(self, from_state, to_state):
           return to_state in self.TRANSITIONS.get(from_state, [])
   ```

3. **Concurrency control**
   ```python
   import threading
   
   lock = threading.Lock()
   
   def process_order(order_id):
       with lock:
           # Check the order state
           order = db.get_order(order_id)
           if order.status != 'pending':
               raise ValueError("Order already processed")
           
           # Process the order
           process(order)
   ```

4. **Business rule validation**
   ```python
   def validate_business_rules(order):
       # Validate the quantity limit
       if order.quantity > MAX_QUANTITY:
           raise ValueError("Quantity exceeds limit")
       
       # Validate the price range
       if order.price <= 0:
           raise ValueError("Invalid price")
       
       # Validate the inventory
       if order.quantity > get_stock(order.product_id):
           raise ValueError("Insufficient stock")
   ```

5. **Audit logging**
   ```python
   def log_business_action(user_id, action, details):
       log_entry = {
           "user_id": user_id,
           "action": action,
           "details": details,
           "timestamp": datetime.now()
       }
       db.log_action(log_entry)
   ```

## Notes

- Only perform testing in authorized test environments
- Avoid causing actual impact to the business
- Be mindful of differences between business processes
- Watch for data consistency during testing

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.