What Are Business Logic Flaws?
Business logic flaws are vulnerabilities caused by incorrect implementation of the application's intended behavior. They are not caused by coding bugs, but rather by flawed assumptions about how users will interact with the system. These flaws can lead to severe consequences such as bypassing payment flows, privilege escalation, or abuse of discounts and limits.
π§© Key Concepts
- Application Workflow: The expected sequence of actions or validations in a process (e.g., checkout, registration).
- Logical Validation: Ensuring actions are allowed in the current context (e.g., preventing refunds after shipping).
- User Manipulation: Attackers tamper with parameters or order of actions to trick the system.
π Real-World Examples
1. Skipping Payment Step
A user modifies a request to change the status of an order to βpaidβ without completing the payment process.
POST /checkout/complete
order_id=789&payment_status=paid
π₯ Impact: The system marks the order as paid without validating the actual transaction.
2. Abuse of Discount Logic
A site allows a discount coupon once per user. By registering multiple accounts or manipulating the user ID in requests, the same coupon can be reused.
POST /apply-coupon
user_id=1002&coupon=SUMMER50
π₯ Impact: Business suffers financial loss from uncontrolled discounts.
3. Bypassing Access Control
A user requests another userβs invoice by changing the ID in the URL:
GET /invoices/view?id=401
π₯ Impact: Sensitive financial data is exposed due to missing logic validation on ownership.
π§ͺ How to Test for Business Logic Flaws
- Understand the intended business flow by using the application as a normal user.
- Analyze edge cases: incomplete steps, wrong sequences, replaying requests.
- Tamper with parameters, skip steps, or modify HTTP methods.
- Use tools like Burp Suite Repeater/Intruder to simulate variations.
- Test multi-user scenarios (e.g., impersonation, privilege boundaries).
π‘ Actionable Tips
- Always validate business conditions server-side (never trust client logic).
- Define and enforce correct workflows with strict state transitions.
- Use rate-limiting, identity checks, and audit trails for financial processes.
- Focus testing on features with monetary value: coupons, refunds, loyalty points, etc.