Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Mapping execution paths involves understanding how users navigate through an application and identifying all possible workflows, decision points, and code paths. This foundational step ensures testers comprehend the application's structure before conducting comprehensive security testing. Understanding execution paths helps identify areas where security controls might be bypassed, business logic could be exploited, or race conditions might occur.
# Parallel request testing
# Two users purchasing last item
Request 1: GET /item/123/stock → 1
Request 2: GET /item/123/stock → 1
Request 1: POST /purchase/123
Request 2: POST /purchase/123
# Both succeed? Race condition!
Step 8: Test Path Coverage
Path Testing Approach
# Example: Function with decision pointsdefprocess_order(user, cart, coupon=None):
# Decision Point 1: User authenticated?ifnot user.is_authenticated:
return redirect('login')
# Decision Point 2: Cart not empty?if cart.is_empty:
return error('Empty cart')
# Decision Point 3: Coupon valid?if coupon:
ifnot coupon.is_valid:
return error('Invalid coupon')
cart.apply_discount(coupon)
# Decision Point 4: Stock available?ifnot check_stock(cart):
return error('Out of stock')
# Process orderreturn create_order(user, cart)
# Test paths:# 1. Unauthenticated user → redirect# 2. Empty cart → error# 3. Invalid coupon → error# 4. Out of stock → error# 5. Valid order → success
graph TD
A[Start] --> B{Authenticated?}
B -->|No| C[Login Page]
C --> D{Valid Credentials?}
D -->|No| E[Error]
D -->|Yes| F{MFA Enabled?}
F -->|Yes| G[MFA Challenge]
F -->|No| H[Dashboard]
G --> I{MFA Valid?}
I -->|Yes| H
I -->|No| J[MFA Error]
B -->|Yes| H
Race Condition Test Script
#!/usr/bin/env python3import asyncio
import aiohttp
asyncdefmake_request(session, url, data):
asyncwith session.post(url, data=data) as response:
returnawait response.json()
asyncdefrace_test(url, data, count=10):
asyncwith aiohttp.ClientSession() as session:
tasks = [make_request(session, url, data) for _ inrange(count)]
results = await asyncio.gather(*tasks)
return results
# Test concurrent purchases
url = "https://target.com/api/purchase"
data = {"item_id": 123, "quantity": 1}
results = asyncio.run(race_test(url, data, 10))
print(f"Successful purchases: {sum(1for r in results if r.get('success'))}")
Remediation Guide
1. Implement Proper State Management
# Use server-side session state# Validate state transitionsdefcheckout(request):
cart = get_cart(request.session)
# Validate current stateif cart.state != 'active':
return error('Invalid cart state')
# Atomic state transitionwith transaction.atomic():
cart.state = 'processing'
cart.save()
process_payment(cart)