Skip to main content
Business Logic Vulnerabilities: The Flaws Scanners Can't Find

Business Logic Vulnerabilities: The Flaws Scanners Can't Find

KU
· Founder & Chief Editor
• 8 min read•Updated •

Business logic vulnerabilities exploit legitimate application workflows rather than broken code, so scanners routinely miss them entirely.

Key takeaways

  • A business logic vulnerability is a workflow flaw where every request is valid but the outcome breaks a business rule, like redeeming a coupon twice.
  • Scanners miss them because there is no malicious payload to match.
  • Find them with manual abuse-case testing and threat modeling, and fix them with server-side state checks and atomic database writes.

A business logic vulnerability is a flaw in how a workflow is designed, not in how it is coded. Every request is well-formed, every input passes validation, nothing throws, yet the outcome breaks a rule the business assumed always holds, such as "a coupon can be redeemed once." Scanners miss them; manual abuse-case testing and atomic server-side checks catch them.

Verified against

OWASP Web Security Testing Guide (latest, section 4.10), OWASP API Security Top 10 2023 (API6), PostgreSQL 18 (Read Committed isolation), against the owasp.org, PortSwigger Web Security Academy and postgresql.org docs. Checked October 2026.

Why this class doesn't behave like the others

Every other vulnerability class has a signature. SQL injection has a quote breaking out of a query. XSS has an unescaped tag landing in the DOM. SAST greps for the pattern; DAST throws a payload and watches for the response that proves it landed.

Business logic flaws have no wrong line of code to find. The code runs exactly as designed. The gap is in the workflow: an assumption about the order operations happen in, or about what a legitimate user would never think to do. The attacker isn't breaking the application. They're using it correctly, in an order or context nobody designed for. OWASP's testing guide is blunt about it: "This type of vulnerability cannot be detected by a vulnerability scanner."

The six patterns we see most

Double-redeem race conditions. A coupon endpoint checks "has this code been used?", finds no, credits the account, then marks the code used. Two requests fired at the same instant both pass the check before either write lands.

Client-trusted pricing. Checkout sends the cart total from the browser and the server accepts it instead of recalculating from the catalog. Edit the number, pay the number.

Skippable multi-step workflows. A five-step checkout has a URL per step. If step 5 (confirmation) doesn't verify that step 4 (payment) completed, requesting step 5 directly completes the order unpaid.

Reusable password reset tokens. The link sets a new password and stays valid because nothing revokes it. Anyone who finds it later in a log or a forwarded email can reset again.

Negative quantities. A cart with no lower bound accepts -5 units, and the total calculation treats it as a credit. PortSwigger files this under "failing to handle unconventional input."

Rate limits on the wrong identity. A "forgot password" endpoint is limited per IP address. Rotating through proxies resets the limit every time. OWASP's API6:2023 entry, "Unrestricted Access to Sensitive Business Flows", describes exactly this pattern for bots buying limited stock from many IPs.

Why can't scanners find business logic flaws?

Both SAST and DAST need a signature to match. A logic flaw produces traffic that is legitimate by every technical measure: well-formed requests, typed and in-range parameters, an authenticated session. Two coupon redemptions 3 ms apart look identical to two customers checking out at once. "A coupon can only be used once" isn't a property of the code; it's a property of the business the code is supposed to enforce, and no scanner has that rule. That is why OWASP keeps business logic as its own testing category (WSTG 4.10, covering data validation, forged requests, process timing, usage limits, workflow circumvention and payment functionality) and says it "remains a manual art relying on the skills of the tester."

How to test for them, with commands

Manual testing with an attacker's mindset asks the questions a scanner can't formalize: skip a step, replay a request, send two at once, change a server-owned value. You can script the race test in a few lines. This fires 20 concurrent redemptions of one code against a staging endpoint:

Terminal
seq 20 | xargs -P 20 -I{} curl -s -o /dev/null -w '%{http_code}\n' \
    -X POST https://staging.example.com/api/coupons/redeem \
    -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
    -d '{"code":"WELCOME10"}' | sort | uniq -c
     19 409
      1 200

One 200 and nineteen 409s is the correct result. Two or more 200s means the check and the write are not atomic, and the balance will show it. Run the same idea against the other patterns: replay a used reset token, POST the confirmation step without the payment step, send "quantity": -5, send "total": 0.01.

Threat modeling the flow before you build it catches more than testing after. Sketch each state, ask who can reach it and what it assumes happened before, and walk STRIDE over the multi-step flows: spoofed steps, tampered server-controlled values, out-of-order requests, gates skipped. Our threat modeling for engineers guide applies STRIDE to flows like these, and broken access control and IDOR covers the neighboring class where the flaw is who, not when.

The double-redeem coupon, fixed properly

Say a referral program credits $10 when a code is redeemed. The vulnerable endpoint does three separate steps: read the code and confirm used = false, credit the balance, set used = true. Two near-simultaneous requests both read used = false and both credit. The account ends up $20 richer from a $10 code, and the logs show two valid requests.

The fix is to make the check and the claim one statement the database serializes:

db/redeem_coupon.sql
BEGIN;
UPDATE coupons
   SET used = true, used_by = $1, used_at = now()
 WHERE code = $2 AND used = false
RETURNING id;
-- zero rows returned: already redeemed, ROLLBACK and return 409
UPDATE accounts SET balance = balance + 10 WHERE id = $1;
COMMIT;

RETURNING hands back the claimed row, so the application credits only when exactly one row came back. Under PostgreSQL's default Read Committed isolation, the second concurrent UPDATE waits on the row lock, re-checks used = false after the first commits, and matches nothing. Add an idempotency key per request and keep the credit amount server-side. The broader habits are in our application security best practices guide.

Failure modes and the symptom each one leaves

Symptom you seeLikely logic flawFix
Balance higher than the sum of valid redemptionsCheck-then-write raceSingle conditional UPDATE ... RETURNING, unique constraint
Orders with paid = false but status confirmedSkippable workflow stepServer-side state machine, each step checks the previous state
Order totals that don't match catalog pricesClient-trusted priceRecalculate totals server-side from product IDs
Same reset token used twice in auth logsToken not revoked on useSingle-use tokens, delete on consumption, short TTL
Refunds or credits from cart operationsNegative quantity acceptedValidate quantity >= 1 at the API and the database CHECK
Many password reset requests per account from many IPsRate limit keyed on IPKey limits on account and flow, add bot detection

Where this breaks

Atomic updates fix races inside one database. They don't help when the check lives in one service and the write in another, or when a cache answers "already used?" before the database does; there you need a distributed lock, an outbox, or a single owner of the state. Concurrency tests against staging also prove little if staging has one app instance and production has twenty. And none of this replaces knowing the business rules. If nobody wrote down that a referral can't be self-referred, no test will check it.

Questions people ask

What is an example of a business logic vulnerability?

A coupon meant for one use that can be redeemed twice by sending two requests at the same moment. Each request is valid and passes validation, but both read "unused" before either marks the code used. Other common examples are trusting a price sent by the browser, skipping the payment step by requesting the confirmation URL directly, and accepting negative quantities that turn into credits.

Can automated scanners detect business logic flaws?

Mostly no. SAST and DAST tools match known-bad code patterns and payloads, and logic flaws use well-formed, authenticated, in-range requests. The OWASP Web Security Testing Guide states this vulnerability type "cannot be detected by a vulnerability scanner." Scanners still earn their place for injection and misconfiguration, but logic flaws need manual abuse-case testing, threat modeling, and concurrency tests written against the specific business rules.

How do you prevent race conditions in coupon or payment flows?

Make the check and the write a single atomic operation. A conditional UPDATE coupons SET used = true WHERE code = ? AND used = false RETURNING id lets the database serialize concurrent attempts, so only one request gets a row back. Add a unique constraint on redemptions, an idempotency key per request, and keep amounts server-side. Then prove it with 20 parallel requests against staging.

The call we'd make

Run your scanners; they're worth it for the classes they're built for. Then budget real time for manual walkthroughs of every multi-step flow that touches money, credentials, or state transitions, and do the threat model before the sprint, not after the incident. Business logic flaws don't show up in a scan report. They show up in a support ticket asking why a customer's balance doesn't add up.

Sources

Explore topics:SecurityDevOps
React
Share this post
Cite this article
Plain text

Kiril Urbonas (2026). Business Logic Vulnerabilities: The Flaws Scanners Can't Find. DevOpsNess. Updated 2026-10-31. https://www.devopsness.com/blog/business-logic-vulnerabilities

Markdown

[Business Logic Vulnerabilities: The Flaws Scanners Can't Find](https://www.devopsness.com/blog/business-logic-vulnerabilities) (Kiril Urbonas, DevOpsNess, updated 2026-10-31)

KU

Kiril Urbonas

Founder & Chief Editor

607 articles
View all articles by Kiril Urbonas

You might have missed

Evergreen posts worth revisiting.