OWASP Top 10 Security Lab

A04

Insecure Design

Exploit fundamental design and business logic flaws

What is Insecure Design?

Insecure Design represents missing or ineffective control design flaws. It's about fundamental weaknesses in application architecture and business logic, not implementation bugs. These flaws arise from insufficient threat modeling, secure design patterns, and reference architectures.

🎯 Key Design Flaws

  • Business Logic Bypass: Circumventing intended business workflows
  • Missing Security Controls: Absence of authentication, authorization, or validation
  • Workflow Manipulation: Skipping critical steps in multi-stage processes
  • Race Conditions: Exploiting timing dependencies in operations
  • Price Manipulation: Bypassing payment validation in e-commerce
  • Account Enumeration: Design allowing user discovery attacks

⚠️ Business Impact

  • Financial losses through pricing manipulation
  • Unauthorized access to premium features
  • Regulatory compliance violations
  • Brand reputation damage
  • Complete business process compromise
  • Legal liability from design negligence

🔍 Common Attack Scenarios

# E-commerce Price Manipulation POST /api/cart/add { "product_id": 123, "quantity": 1, "price": 0.01 // Client controls price! } # Workflow Step Skipping 1. Registration → 2. Email Verification → 3. Account Activation ↓ BYPASS ↓ Direct access to step 3 without completing steps 1-2 # Race Condition Exploitation Thread 1: Check balance ($100) Thread 2: Check balance ($100) // Same time Thread 1: Withdraw $100 (Balance: $0) Thread 2: Withdraw $100 (Balance: -$100) // Overdraft! # Business Logic Bypass Discount Code: "SAVE50" (50% off, one-time use) Attack: Apply code multiple times in same transaction Result: 150% discount = Negative total price

🛡️ Secure Design Principles

  • Threat Modeling: Identify and address security threats early
  • Defense in Depth: Multiple layers of security controls
  • Fail Securely: Deny access when security controls fail
  • Least Privilege: Minimal access rights by default
  • Server-Side Validation: Never trust client-side controls
  • Secure by Default: Secure configurations out of the box
// Insecure Design (Client-Side Trust) function calculateTotal() { return price * quantity; // Client calculates price! } // Secure Design (Server-Side Control) class OrderService { calculateTotal(productId, quantity) { const product = this.getProduct(productId); const basePrice = product.price; // Server controls price const discount = this.validateDiscount(userDiscounts); return (basePrice * quantity) - discount; } } // Insecure Workflow if (userClickedNext()) { proceedToNextStep(); // No validation! } // Secure Workflow if (currentStepCompleted() && hasRequiredPermissions()) { validateStepData(); proceedToNextStep(); }

🎯 Lab Preview

In the following labs, you'll exploit common design flaws:

  • Lab 1: E-commerce business logic bypass - manipulate pricing, abuse discounts, exploit payment flows
  • Lab 2: Multi-step workflow manipulation - skip verification steps, bypass controls, race condition exploitation