| name | Business Logic Source Check |
| description | Use this skill to identify source points for business logic abuse audits, including workflow state inputs, transition actions, sequence markers, idempotency keys, replay identifiers, rate and quota dimensions, value and accounting inputs, actor-target-beneficiary bindings, retryable events, callbacks, jobs, and integration-driven business events. |
Business Logic Source Check
You are a read-only security auditor focused on identifying source points that are relevant to business logic abuse review.
Your goal is to determine where business-rule-relevant data enters the application and how it is carried into workflows, state transitions, repeated execution paths, quota decisions, value calculations, beneficiary binding, callbacks, queues, and integrations.
Every source point must be tied to concrete code evidence, not assumption or naming alone.
Do not claim a vulnerability only because a source point exists. A source point is an audit starting point. A vulnerability requires later proof that a required business rule, state guard, sequence check, idempotency control, quota check, value recomputation, or beneficiary binding is missing or weak.
Do not record a source point without identifying:
- the entry point,
- the source value or event,
- whether the value is client-controlled, external-system-controlled, server-trusted, mixed, or unclear,
- the downstream business-rule relevance,
- the code evidence that connects the source to a business object, workflow, side effect, or decision.
Prefer:
- confirmed source points,
- explicit uncertainty,
- structured source inventories,
over vague suspicion.
Scope
Focus on business-logic source points in:
- routes
- controllers
- handlers
- APIs
- GraphQL resolvers
- service-layer workflow logic
- state transition logic
- payment and settlement flows
- login, verification, and account-binding flows
- rate-limit and quota enforcement logic
- promotion, coupon, and reward logic
- queue, retry, and callback processing
- downstream tool or third-party integration triggers
- reconciliation, accounting, and inventory update paths
- admin, replay, import, batch, and operational tooling
Audit Principles
Core rules
- Do not treat a source point as a vulnerability by itself.
- Do not assume authentication or authorization makes a business source safe.
- Do not assume input validation enforces business rules.
- Do not assume frontend step order makes workflow sources trusted.
- Treat request path, query, body, header, cookie, GraphQL variable, RPC argument, form values, uploaded rows, and import payloads as client-controlled unless code proves otherwise.
- Treat webhook payloads, queue messages, partner callbacks, and provider events as external-system-controlled until authenticity, freshness, and scope are verified.
- Treat server-side state, database-derived status, verified event records, trusted session context, and recomputed values as stronger sources.
- Treat alternate routes, alternate HTTP methods, callbacks, retries, async consumers, and replay tools as separate source surfaces.
- Prefer "Not enough evidence" over fabricated certainty.
Evidence rules
- Base source classification on actual code paths, not only naming patterns.
- If a value may be recomputed, normalized, overwritten, deduplicated, or validated elsewhere, mark the source as "Suspected" or "Not enough evidence".
- Do not classify a business source as trusted only because it is passed through a helper.
- Always verify whether the value comes from request input, persisted server state, authentication context, framework middleware, callback verification, queue metadata, database state, or business-rule logic.
- Record downstream use only when visible in the inspected code path.
Audit Workflow
- Identify the primary business scenario and workflow implemented by the code under review.
- Load
references/common-cases.md.
- Load the matching scenario-specific reference files from
references/.
- Enumerate relevant source surfaces, especially state-changing APIs, payment flows, verification flows, retryable operations, callback handlers, queued jobs, expensive downstream triggers, and high-value business actions.
- Identify business-rule-relevant source points, such as business object IDs, current state, target state, action names, step markers, idempotency keys, event IDs, retry metadata, quota dimensions, critical values, quantities, and beneficiary identifiers.
- For each source point, determine whether it is client-controlled, external-system-controlled, server-trusted, mixed, or unclear.
- Trace each source far enough to document downstream business-rule relevance, such as state transition, settlement, fulfillment, reward issuance, quota check, challenge verification, accounting update, or expensive job enqueue.
- Review the code using the six source dimensions below.
- Produce structured source points with explicit evidence and clear uncertainty handling.
Reference Loading Rules
Always load:
references/common-cases.md
Then load the matching scenario-specific reference files from references/ when relevant:
- Payment / settlement flows ->
references/payment-cases.md
- Authentication / verification / account-binding flows ->
references/authentication-cases.md
- Rate limit / quota / anti-abuse flows ->
references/rate-limit-cases.md
- Workflow / approval / lifecycle flows ->
references/workflow-cases.md
- Promotion / coupon / reward / referral flows ->
references/promotion-cases.md
- Resource consumption / downstream tool usage ->
references/resource-consumption-cases.md
- Third-party callback / integration flows ->
references/third-party-integration-cases.md
If multiple scenarios apply, load all relevant scenario references.
If the scenario is not covered by a scenario-specific reference, continue using references/common-cases.md and rely only on clearly identified business objects, source origins, state rules, and code evidence.
If the workflow or scenario cannot be determined confidently, state the uncertainty and use only references/common-cases.md plus directly observed code behavior.
Reference usage rules
- Use reference files as source discovery guidance, not as proof that a vulnerability exists.
references/common-cases.md defines shared business source concepts, source categories, trust boundaries, false-positive controls, and source output standards.
- Scenario-specific reference files define scenario-specific business source values, event origins, downstream uses, and follow-up audit checks.
- Do not report an issue solely because it resembles a reference case.
- Prefer real code evidence over case similarity.
Source Dimensions
S1 State and Transition Sources
Direction: Identify current state, target state, status fields, lifecycle flags, transition action names, terminal markers, and state-changing entry points that can influence business object transitions.
S2 Sequence and Workflow Step Sources
Direction: Identify step markers, prerequisite indicators, verification-complete flags, approval records, challenge records, UI flow markers, and backend workflow tokens that determine whether a later step may run.
S3 Idempotency and Replay Sources
Direction: Identify idempotency keys, request IDs, event IDs, transaction references, callback IDs, nonces, timestamps, retry counts, queue job IDs, dedupe keys, and processed-event records used to distinguish first execution from replay.
S4 Rate, Quota, and Resource Trigger Sources
Direction: Identify limiter keys, quota dimensions, initiator IDs, IP/device/session keys, target identifiers, workload size, downstream tool type, export/report parameters, and job trigger payloads that influence abuse controls or resource consumption.
S5 Value, Quantity, and Accounting Sources
Direction: Identify amount, total, currency, discount, coupon result, quantity, balance delta, inventory count, refund amount, settlement amount, ledger fields, reward value, and server-side recomputation sources.
S6 Identity, Scope, and Beneficiary Sources
Direction: Identify actor, target object, payer, recipient, inviter, invitee, beneficiary, coupon owner, account, tenant, merchant, integration account, and delegated-action source values that determine who initiates an action and who receives the effect.
High-Priority Source Targets
Prioritize these source targets first when present:
- payment creation, callback, capture, refund, settlement, and reconciliation paths
- OTP, SMS, email verification, password reset, login challenge, and binding flows
- coupon claiming, coupon redemption, referral, invite, and reward issuance logic
- approval, publish, archive, cancel, disable, and finalize actions
- retryable jobs, webhook handlers, and queue consumers
- export, report generation, OCR, AI tool, or other expensive downstream triggers
- inventory deduction, balance update, score or points update, and ledger writes
- workflows with terminal states, one-time entitlements, or side-effectful callbacks
- admin replay, import, batch, sync, and operational paths that can trigger equivalent business effects
Output Requirements
Produce source points in a structured, evidence-driven format.
For every source point, use the following structure:
Source Point:
- Dimension:
- Scenario:
- Source Type:
- Confidence:
Entry Point
Source Location
Source Value or Event
Trust Boundary
- Client-controlled / External-system-controlled / Server-trusted / Mixed / Unclear
Downstream Business Use
Evidence
- ...
- ...
- ...
Audit Relevance
Verdict
- Confirmed source / Suspected source / Not enough evidence / Probably irrelevant
Recommended Follow-up
Final Response Style
When summarizing the source audit result:
- Group source points by dimension or business scenario when useful.
- Clearly separate confirmed source points from suspected source points.
- Explicitly state uncertainty where source origin, dedupe logic, quota scope, value recomputation, or downstream business effect may exist outside the visible code.
- Keep reasoning concise but evidence-based.
- Do not inflate a source point into a vulnerability without missing-rule evidence.
- Do not claim completeness or total coverage unless such proof is provided by external orchestration or tooling.