Testing

API security testing: SAST, DAST, IAST, fuzzing

Choose the right mix of design checks and runtime probes.

Published: February 3, 2026 • Author: APISAST

Published: 3 February 2026 · Updated: 19 September 2026

Method overview

  • SAST: Inspects source or specs for missing auth, weak schemas, and unsafe defaults.
  • DAST: Probes running services to find runtime issues like CORS misconfig or verbose errors.
  • IAST: Instruments apps to trace data flow during tests.
  • Fuzzing: Generates malformed inputs to uncover crashes and logic bugs.

When to use each

Start with SAST in CI to block design flaws. Add DAST on staging to validate headers, TLS, and error hygiene. Use IAST for complex microservices where data lineage matters. Run fuzzers against high-risk endpoints such as auth and file uploads.

Start with the question you need answered

If the question is whether a contract declares authentication, pagination, and safe error schemas, scan the OpenAPI file. If the question is whether a server enforces ownership, sends the promised headers, or rejects malicious inputs, test the running API. A single technique cannot answer both. Source-code SAST can also find unsafe implementation patterns that a contract scanner cannot see; APISAST specifically analyses OpenAPI and Swagger files, not application source code.

Choose a representative endpoint and write the expected outcome before selecting a tool. For example, a payment operation should declare a security requirement, reject an anonymous request, reject a valid token from another tenant, and avoid echoing sensitive data in errors. The contract scan covers the declaration and some schema signals; integration and dynamic tests cover the observed behaviour. This framing prevents a passing static report from being mistaken for a full security assessment.

Use dynamic tests with controlled identities

Dynamic Application Security Testing sends requests to a running service. It can reveal verbose runtime errors, unexpected routes, broken response headers, and some input-handling problems. Configure stable test users, rate limits, and test data before scanning staging. A scanner without valid credentials may see only login pages and miss protected operations; a scanner with an overly privileged token may miss authorization gaps between roles.

For object-level authorization, create two users with separate resources and attempt cross-user access. For rate limiting, send a bounded burst and observe the actual 429 response. Record the request, identity, response, and expected policy. Avoid running disruptive scans against production without a plan for load and data changes. Dynamic coverage is strongest when it is paired with explicit business-logic cases, not left to generic payload lists.

Know when instrumentation or fuzzing helps

Interactive Application Security Testing observes a running application while tests exercise it. It can connect an incoming request to internal code paths and data flow, but it only sees paths the tests reach and requires compatible instrumentation. Use it where a complex service makes a runtime symptom hard to locate. Keep its findings connected to a reproducible test; a trace alone is not a fix.

Fuzzing varies inputs to explore parsing and state-handling failures. Start with an operation's schema and meaningful boundary values rather than random bytes alone. Test file formats, nested objects, large collections, and unexpected sequences where failure would be costly. A fuzzer can find crashes or unhandled exceptions, but it cannot reliably prove that a returned record belongs to the correct user. Pair it with explicit authorization tests.

Turn findings into a release decision

Run contract checks early, implementation tests on each change, and heavier probes in a controlled staging environment. Define who reviews a finding, how a false positive is recorded, and what severity blocks a release. Retest after a fix and compare the same endpoint and identity, not merely the same dashboard score. Save enough evidence to explain what was tested without storing tokens or personal data in a public artifact.

The CI/CD scanning guide shows a real APISAST API call. Use it for contract checks and add a separate job for runtime behaviour. When the two disagree, investigate the drift: the specification may be outdated, or the implementation may not enforce its promise.

Keep both results visible to the API owner.

Build a layered program

  • Gate merges with static API scanning.
  • Schedule dynamic scans of a staging API with a tool designed to send live requests. The APISAST overview compares static and dynamic coverage.
  • Instrument critical services for IAST and keep findings tied to Git issues.
  • Use fuzzing to stress auth flows and file parsers before peak traffic events.
Back to blog