# Workflow and State Bypass > A business logic flaw where a multi-step process (verify, pay, approve, upgrade) is enforced only by the order the UI presents steps in, so a later step can be reached without the earlier ones, or the state machine can be pushed into a combination it was never meant to allow. ## How it works Every multi-step flow is a state machine with invariants: *payment before fulfilment*, *mailbox ownership before verified*, *eligibility before extension*, *role X before destructive action Y*. These bugs happen when the server checks the **current request** but not the **current state**: | Failure | What breaks | Example | |---|---|---| | Step skipping | Later endpoints don't check that earlier steps completed | Authenticated pages reachable after password entry without completing 2FA ([[raw/intigriti.com/broken-authentication-7-advanced-ways-of-bypassing-2-fa-intigriti-4528\|7 ways of bypassing 2FA]]); payment step skipped through redirect parameters ([[raw/redfoxsec.com/common-bug-bounty-vulnerabilities-a-technical-deep-dive-for-hunters-in-4902\|Common Bug Bounty Vulnerabilities]]) | | Proof-of-step leaks | The secret meant to prove a step is already in the client's hands | The registration response returned the same JWT the email-verification link used, so the mailbox never had to be read ([[raw/infosecwriteups.com/how-i-found-an-email-verification-bypass-on-an-ai-freelance-platform-10048\|Email verification bypass]]) | | Eligibility not re-checked | The server honours a request without re-validating business preconditions | A payment extension was accepted for another account with no outstanding balance ([[raw/medium.com/idor-and-business-logic-flaw-in-a-payment-extension-api-unauthorized-m-15472\|Payment extension API]]) | | Mid-flow mutation | An input that binds the flow can change after a step is issued | Email on a login flow changed after the OTP was issued, then raced with OTP verification, giving ATO ([[raw/medium.com/race-condition-authentication-bypass-full-account-takeover-4362\|Race condition auth bypass]]) | | Cross-surface desync | Two apps share state but enforce rules differently | A Moderator deleted an org group from the `todo` subdomain, and the deletion cascaded to `account`, where only Admin or Owner could delete ([[raw/infosecwriteups.com/how-i-found-a-data-deletion-bypass-via-subdomain-synchronization-10192\|Data deletion via subdomain sync]]) | | Alternate path | A second route reaches the same state change without the first route's checks | Internal transfers that bypass withdrawal limits, and deposits that become spendable too early ([[raw/blazeinfosec.com/bitvulnex-a-vulnerable-crypto-exchange-12213\|Bitvulnex]]) | ## Testing heuristics - Write the flow down as states and transitions, then ask for each transition: *which earlier state does the server actually check?* One hunter's model: sign up (partial) → change email (verification pending) → upgrade plan (payment processing) → verify email → use premium features. Ask where permissions desync along that chain ([[raw/medium.com/backend-mastery-the-real-bug-bounty-superpower-2026-3601|Backend Mastery]]). - Target the implicit beliefs: "this only happens once", "this state can't change mid-request", "this user already passed step N" ([[raw/medium.com/backend-mastery-the-real-bug-bounty-superpower-2026-3601|Backend Mastery]]). - Compare every token or identifier a step issues with what the previous response already returned ([[raw/infosecwriteups.com/how-i-found-an-email-verification-bypass-on-an-ai-freelance-platform-10048|Email verification bypass]]). - Repeat each action from every role and on every surface: web, API, mobile and sibling subdomains that share a database. Read the developer documentation for the stated role matrix and test against it ([[raw/infosecwriteups.com/how-i-found-a-data-deletion-bypass-via-subdomain-synchronization-10192|Data deletion via subdomain sync]]). - Combine with concurrency: step checks that run in separate threads or transactions are [[Race Conditions]] candidates ([[raw/medium.com/race-condition-authentication-bypass-full-account-takeover-4362|Race condition auth bypass]]). - API checklists put state transitions next to trust boundaries as the core of a logic-focused pentest ([[raw/github.com/api-penetration-testing-combined-checklist-scenario-list-2888|API pentest checklist]]). "Skip payment step" is a standard checklist item ([[raw/dev.to/bug-bounty-hunting-in-2026-dev-community-3605|Bug Bounty Hunting in 2026]]). - Verify that the state actually changed. A `200` with a confirmation number is not proof the change persisted ([[raw/medium.com/idor-and-business-logic-flaw-in-a-payment-extension-api-unauthorized-m-15472|Payment extension API]]). ## Notable cases - Email verification turned into an optional step because the registration and verification tokens were the same JWT ([[raw/infosecwriteups.com/how-i-found-an-email-verification-bypass-on-an-ai-freelance-platform-10048|Email verification bypass]]). - Moderator-initiated cascade deletion across subdomains: triaged High and paid ([[raw/infosecwriteups.com/how-i-found-a-data-deletion-bypass-via-subdomain-synchronization-10192|Data deletion via subdomain sync]]). - A billing API took a client-supplied `billAccountNumber` and created payment extensions without checking ownership or eligibility ([[raw/medium.com/idor-and-business-logic-flaw-in-a-payment-extension-api-unauthorized-m-15472|Payment extension API]]). - An IDOR touching order settlement was rated as a $12,500 P1 on business impact, despite low technical severity ([[raw/dev.to/the-0-idor-that-was-worth-more-than-a-12-500-p1-business-logic-matters-14194|The $0 IDOR worth a $12,500 P1]]). - An OTP and email-change race led to full account takeover ([[raw/medium.com/race-condition-authentication-bypass-full-account-takeover-4362|Race condition auth bypass]]). ## Defenses - Keep flow state on the server and check it on every transition. Never infer it from which endpoint the client called. Use step tokens (an HMAC over flow state) and idempotency keys for high-value flows ([[raw/qodex.ai/owasp-api-security-top-10-2025-guide-with-tests-3722|OWASP API Top 10 guide with tests]]). - Use separate, single-purpose tokens for each step (session vs. email verification vs. reset), delivered only over the channel the step is proving. - Re-validate ownership and business eligibility against authoritative records when the action is committed ([[raw/medium.com/idor-and-business-logic-flaw-in-a-payment-extension-api-unauthorized-m-15472|Payment extension API]]). - Lock flow-binding attributes (email, account, amount) once a step is issued, and invalidate the flow if they change. - Enforce the same role matrix on every surface that shares the data. ## Related - [[Business Logic Vulnerabilities]] (main guide) - [[Price and Quantity Manipulation]] · [[Coupon and Reward Abuse]] · [[Paywall and Entitlement Bypass]] - [[MFA Bypass]] · [[Password Reset Vulnerabilities]] · [[Second-Order and Multi-Step IDOR]] · [[Race Conditions]] · [[Multi-Tenant Isolation]] · [[Account Takeover]] ## Sources - [[raw/intigriti.com/broken-authentication-7-advanced-ways-of-bypassing-2-fa-intigriti-4528|Broken authentication: 7 Advanced ways of bypassing 2-FA]] - [[raw/redfoxsec.com/common-bug-bounty-vulnerabilities-a-technical-deep-dive-for-hunters-in-4902|Common Bug Bounty Vulnerabilities: A Technical Deep Dive]] - [[raw/infosecwriteups.com/how-i-found-an-email-verification-bypass-on-an-ai-freelance-platform-10048|How I Found an Email Verification Bypass on an AI Freelance Platform]] - [[raw/medium.com/idor-and-business-logic-flaw-in-a-payment-extension-api-unauthorized-m-15472|IDOR and Business Logic Flaw in a Payment Extension API]] - [[raw/medium.com/race-condition-authentication-bypass-full-account-takeover-4362|Race Condition Authentication Bypass: Full Account Takeover]] - [[raw/infosecwriteups.com/how-i-found-a-data-deletion-bypass-via-subdomain-synchronization-10192|How I Found a Data Deletion Bypass via Subdomain Synchronization]] - [[raw/blazeinfosec.com/bitvulnex-a-vulnerable-crypto-exchange-12213|Bitvulnex: a vulnerable crypto exchange]] - [[raw/medium.com/backend-mastery-the-real-bug-bounty-superpower-2026-3601|Backend Mastery: The Real Bug Bounty Superpower (2026)]] - [[raw/github.com/api-penetration-testing-combined-checklist-scenario-list-2888|API Penetration Testing Combined Checklist]] - [[raw/dev.to/bug-bounty-hunting-in-2026-dev-community-3605|Bug Bounty Hunting in 2026]] - [[raw/dev.to/the-0-idor-that-was-worth-more-than-a-12-500-p1-business-logic-matters-14194|The $0 IDOR that was worth more than a $12,500 P1]] - [[raw/qodex.ai/owasp-api-security-top-10-2025-guide-with-tests-3722|OWASP API Security Top 10 (2025) Guide with Tests]]