Manual pentesters find API business-logic bugs by modelling what the product is supposed to guarantee, then changing identity, sequence, state, quantity, timing and channel in ways unit tests and DAST rarely explore. They do not merely send unusual payloads. They test whether individually valid API calls can be combined to violate a business invariant such as one-time redemption, approved ownership, positive balance or ordered authorization.
Define the architecture question before testing
Start with the invariant, not the endpoint. Ask what must never happen even if every request is syntactically valid: a refund exceeds payment, an invitation grants a stronger role, a cancelled order ships, a coupon is redeemed twice, or one tenant causes work in another. Those are executable hypotheses.
Write the expected security invariant and the prohibited outcome in language that engineering, security and operations interpret the same way. Name the identity, trust transition, protected asset and authoritative state. That statement becomes the basis for scope, evidence and retesting.
Build the minimum evidence pack
- A current component and trust-boundary diagram for the environment under test.
- Identity, credential, network and data-flow details relevant to the decision.
- Representative accounts, workloads and synthetic records with known ownership.
- Logs or traces that follow the action through every material control point.
- Explicit safety limits, stop conditions, owners and restoration steps.
Provide critical workflows, roles and tenants, state diagrams, business rules, API collections, test accounts, synthetic records, asynchronous components, third-party sandboxes and authoritative ways to inspect final state. Explain known compensating controls without prescribing the tester’s exact path.
Why ordinary unit tests miss adversarial composition
Unit tests usually confirm expected inputs and local outcomes. Attackers combine valid operations across controllers, services and time while selecting identities and objects developers did not pair.
- Cross workflow and service boundaries.
- Reuse outputs from one operation as input to another.
- Repeat actions after state or permission changes.
- Use legitimate low-privilege accounts against foreign objects.
- Inspect delayed side effects after the response.
A passing unit suite proves implemented examples, not completeness of the business invariant. Map missing adversarial cases back into regression tests after validation.
Build state-transition abuse cases
List allowed states and transitions, then attempt to skip, reverse, repeat or race them. Include who may cause each transition and what side effects must be atomic.
- Move directly from initial to privileged or completed state.
- Repeat a one-time transition.
- Act after cancellation, expiry or revocation.
- Change the object between validation and execution.
- Invoke transitions through alternate APIs or versions.
Capture the full state before and after, including ledger, inventory, notifications and downstream systems. A misleading HTTP response may hide a committed mutation.
Vary identity and ownership throughout the workflow
Authorization can be correct at creation and wrong at approval, retrieval, export or callback. Carry paired users and tenants through every stage.
- Create as one user and approve as an unauthorized peer.
- Transfer or share an object mid-workflow.
- Remove membership before a queued action runs.
- Use tenant A job or token references in tenant B.
- Test support and administrator exceptions explicitly.
Record actor, tenant, object owner and delegated authority at each transition. Do not assume the first authorized step legitimizes all later work.
Challenge quantities, limits and economic invariants
Values can remain within field constraints while their combination creates negative balances, duplicated value, quota bypass or inconsistent totals.
- Split one prohibited amount across several allowed operations.
- Use zero, boundary, precision and rounding cases.
- Change currency, unit, tier or discount ordering.
- Race balance, quota or inventory consumption.
- Compare preview, confirmation and settlement calculations.
Use synthetic value and agreed ceilings. Verify the authoritative ledger or allocation, not only the client-visible amount.
Test sequence, replay and idempotency
Retries, duplicate submissions and asynchronous delivery create business outcomes that scanners cannot infer from one request.
- Replay with the same and different idempotency keys.
- Send valid steps out of order.
- Trigger client and worker retries together.
- Repeat callbacks or queue messages.
- Resume partially failed workflows from multiple points.
Correlate every request, job attempt and final side effect. A duplicate response is harmless only if processing and external effects occur once.
Cross channels and integrations
Web, mobile, partner APIs, administrative tools and webhooks may enforce different portions of the same business rule.
- Begin in one channel and complete in another.
- Use a deprecated or partner route for the same object.
- Modify server-side state between preview and confirmation.
- Replay a signed webhook for another object or tenant.
- Compare administrative and customer-side validation.
Report the chain as one finding when the combined workflow violates one invariant, while naming every component needed to reproduce it.
Turn discoveries into durable tests
Once a manual hypothesis succeeds, encode the invariant at the owning domain layer and add regression at the appropriate integration boundary.
- Create one positive and several negative identity-state cases.
- Test authoritative side effects and compensation.
- Keep concurrency tests deterministic where possible.
- Cover alternate consumers of the same domain command.
- Track the invariant when product rules change.
A regression should fail for the reason the exploit succeeded, not merely match one payload or status code.
Execute as controlled hypotheses
- Establish the legitimate baseline and capture authoritative state.
- Change one trust variable—identity, route, scope, object, time or environment.
- Observe the decision at each layer rather than relying only on the response.
- Stop at the minimum proof that demonstrates or rejects the hypothesis.
- Restore test state and record residual uncertainty or blocked coverage.
Use synthetic accounts, controlled balances and reversible objects. Agree concurrency, external integrations and destructive limits. Stop at the minimum proof of invariant failure and avoid real financial, customer or availability impact.
Report the architectural consequence
Explain the intended invariant, adversarial sequence, identities, state changes and final business impact. Provide a timeline for races and asynchronous work. Distinguish confirmed effects from architecture inference and identify the domain owner of the rule.
Separate observed evidence from inference. State prerequisites, repeatability, blast radius and the shared component responsible for the decision. When multiple findings have one architectural cause, keep the individual proofs but group the remediation around the common control.
Required closure evidence
- The original proof no longer succeeds.
- A legitimate workflow still succeeds under the intended identity and route.
- Alternate consumers of the same pattern enforce the same invariant.
- Telemetry records both allowed and denied decisions with useful context.
- The architecture record and threat assumptions reflect the new control.
Remediate at the durable control point
Enforce business invariants atomically at the authoritative domain layer, revalidate identity and state at execution time, use robust idempotency and bind callbacks or messages to actor, tenant and object. Add negative regression around the invariant across all channels.
Retest the invariant, not just the payload
Repeat the original sequence, vary identity and timing, and verify both the prohibited outcome and legitimate retries. Inspect authoritative state and downstream effects. Sample alternate channels sharing the same rule.
Use the NIST Technical Guide to Information Security Testing and Assessment for assessment planning and evidence discipline, and the OWASP Web Security Testing Guide for relevant application techniques. Adapt both to the system-specific trust decision described here.
The architecture decision
Manual API testing adds value when security depends on meaning, sequence and state rather than malformed input. Give testers the workflow model and observable test environment, then let them challenge the invariants across identities, channels and time.
Ask WIMD to test the business rules behind the API with controlled adversarial workflows that scanners cannot model.
