Skip to main content

Automated Pen Testing for Identity Verification APIs with OWASP ZAP

Run OWASP ZAP against your own backend endpoints that call Didit, never against Didit itself. Use a free sandbox application for test data, respect the documented rate limits, and gate deploys on High risk alerts.

Automated Pen Testing for Identity Verification APIs with OWASP ZAP

Contents

In this guide

Jump to the part you need.

This guide is for teams that call Didit from their own backend and want a repeatable security check on the endpoints they control. The tooling is free: OWASP ZAP is open source, and the Didit sandbox is free on every plan, with sandbox sessions never billed. Live full ID checks bill at $0.33 each. The caveat is scope: you scan your own integration, never Didit infrastructure, and the API key stays server side.

Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.

Automated pen testing of an identity verification API at a glance
ItemAnswer
OutcomeA triaged scan report on your own endpoints, plus a pass or fail gate in CI
ToolOWASP ZAP, free and open source, desktop client or the zap-stable container
TargetYour staging backend that calls Didit, never didit.me itself
Test dataA Didit sandbox application; new keys start with sk_test_
Sandbox cost$0.00. Sandbox sessions are never billed
Live replay cost$0.33 per full ID check
Limits to plan around500 session creates per 24 hours per sandbox application; 600 per minute live
What it does not replaceA manual pen test, and the audit evidence behind SOC 2 Type 2 and ISO/IEC 27001:2022

Start free in the sandbox at business.didit.me (no sales call), and for developer work connect Didit to an AI assistant via the Didit MCP server. The API you will exercise is documented on the Create Session API page and the ID Verification API page, and every unit price is on didit.me/pricing.

What automated pen testing of an identity verification API should produce

Two artifacts, not one. First, a ZAP report that lists every alert against the endpoints you expose to your own clients, with the request that triggered it, so an engineer can reproduce it by hand. Second, a pass or fail signal in your pipeline that blocks a deploy when a High risk alert appears. Everything else, including scan scheduling and report retention, exists to support those two.

For this guide, we recommend this order: scan passively on every pull request, scan actively weekly against staging, and re-test every finding against the Didit sandbox before you file it. These are recommendations for the guide, not documented Didit requirements. A passive scan sends no attack payloads, so it is safe to run continuously. An active scan sends attack payloads, so it needs a target you are allowed to break and a request budget you respect.

One distinction keeps the exercise honest. Didit's hosted verification API is our surface. The endpoint that calls it is yours. ZAP belongs on yours. Scanning ours without written authorization is an attack on a third party, and you would trip the documented rate limits long before you learned anything useful.

Prerequisites

  • A Didit organization and a sandbox application, created at business.didit.me. Every sandbox application has all products on and plan features enabled on its own screens. Organization-wide features still follow your plan.
  • A sandbox API key. New keys start with sk_test_ for a sandbox application or sk_live_ for a live one, followed by 43 URL-safe characters. Older keys have no prefix and keep working, so never validate a key by its prefix.
  • A workflow UUID. Session create takes workflow_id, a stable UUID from /v3/workflows/.
  • OWASP ZAP, either the desktop client or the zap-stable container image.
  • A staging deployment of your own backend, reachable over HTTPS, that holds the Didit key server side.
  • Written scope for every host in the scan. For your own staging host that is an internal ticket. For anything else it is a signed authorization.

Two documented limits decide how you shape the scan. A sandbox application enforces 500 session creates per 24 hours, raisable on Enterprise on request. Live traffic has its own budgets: 600 session creates per minute, 100 decision reads per minute on the v1 and v2 paths, 50 PDF generations per minute, 10 add-image or update-data calls per minute, and 600 GET or 300 write requests per minute on the generic scopes. Each one is a 60 second fixed window per API key or, when no key is sent, per client IP.

Step by step

1. Write the scope before you open ZAP

List the hosts, the paths and the accounts. For an identity flow the list usually has four entries: your session-create endpoint, your webhook receiver, your decision-read endpoint and the page users land on after the hosted flow, included only when that page is part of the scope you are authorized to test. Write down which sandbox application you will use, because a scan should never touch a live application.

2. Create the sandbox key without a sales call

Register and verify programmatically, or copy the key from Developers, API keys in the Business Console. The verify-email response returns both applications inline, so persist sandbox_application.api_key as DIDIT_API_KEY for testing and keep application.api_key for the day you go live.

3. Create one sandbox session per outcome you care about

This is the reference call. Run it once by hand, save the response, and let the scan compare against it later.

# 1) Register and verify to get a sandbox key (docs: API authentication)
curl -X POST https://apx.didit.me/auth/v2/programmatic/register/ -H "Content-Type: application/json" -d '{"email": "you@yourdomain.com", "password": "StrongP@ss1"}'

curl -X POST https://apx.didit.me/auth/v2/programmatic/verify-email/ -H "Content-Type: application/json" -d '{"email": "you@yourdomain.com", "code": "A3K9F2"}'
# 200 -> sandbox_application.api_key (sk_test_...) and application.api_key (sk_live_...)
export DIDIT_API_KEY="sk_test_..."

# 2) Create a sandbox session (docs: Create Session)
curl -X POST https://verification.didit.me/v3/session/ -H "x-api-key: $DIDIT_API_KEY" -H "Content-Type: application/json" -d '{"workflow_id":"<WORKFLOW_ID>","vendor_data":"user-42","callback":"https://myapp.com/return"}'

# 3) Baseline ZAP run against YOUR staging endpoint, never didit.me
# The -t value must be an endpoint you own and control, never didit.me
docker run -t zaproxy/zap-stable zap-baseline.py -t https://<YOUR_STAGING_ENDPOINT> -r zap-baseline.html

Keep the sandbox deterministic by passing sandbox_scenario on create, or by arming a scenario after create at POST /v3/session/{session_id}/sandbox/arm/ while the session is still Not Started. The live catalogue is GET /v1/sandbox/scenarios/, authenticated with the same x-api-key. Determinism matters for a scanner: if the same request returns Approved on Monday and Declined on Tuesday, every diff in your report is noise.

4. Record the responses you will compare against

Save the create response, one decision read and one webhook body per outcome. Webhooks carry "environment": "sandbox" for sandbox sessions and "environment": "live" for live ones, which is a cheap assertion to add to your tests. Read the decision with GET /v3/session/{sessionId}/decision/.

5. Run the passive baseline first

The baseline scan sends no attack payloads. It crawls, records traffic and flags what it can see: missing security headers, verbose errors, cookies without flags, information disclosure. On an identity flow this is where excessive data exposure tends to surface, because your own wrapper often returns more of the Didit response than the client renders. Trim the response before you file anything as a Didit issue.

6. Run the active scan inside the rate budget

Active scanning probes for injection, broken authentication and misconfiguration. Throttle it. If a scan runs 200 threads against a key that allows 600 session creates per minute, a chunk of your report will be 429 responses, and a 429 is not a vulnerability. Set a request rate you can justify, and add a request header rule so the scanner replays the same header your backend sends.

The key itself never appears in a browser or a mobile bundle. That means a scan of your frontend cannot see x-api-key, and it should not. If a scanner finds a Didit key inside client code, that is the finding of the day, not a false positive.

7. Triage before you file

Sort alerts into three buckets: real defects in your code, expected sandbox behaviour, and transport noise such as 429 or 503. Only the first bucket goes to your backlog. The second bucket is easy to get wrong, so check the documented error table before you write a ticket.

8. Put it in CI and keep it there

Run the baseline on every deploy that touches the verification flow, and the active scan weekly against staging. Fail the build on High risk alerts and open a ticket automatically for Medium. A scan nobody reads is a compliance artefact, not a control.

Expected output

From ZAP: an HTML report with alerts grouped by risk, each carrying the URL, the parameter or header, the evidence string and a suggested fix, plus a JSON or XML file your pipeline can parse. From your side: a session record in the Business Console you can open and compare against the alert.

A session overview with its warnings in the Didit Business Console
What a clean run looks like: one sandbox session with its warnings listed, so a scan finding is checked against the record rather than against a screenshot.

From the API: a successful session-create response containing the session record, and a decision document from GET /v3/session/{sessionId}/decision/. If the scan produced a 200 where the reference call produced a 403, that is the interesting diff, the same request reaching data with a weaker key.

Failure cases and recovery

Documented Didit API failures a scan will hit, and what to do
StatusWhat it usually means during a scanRecovery
401The key is wrong, malformed, revoked or expiredRe-fetch the key with the recover-key flow, or create a new one
403No x-api-key header, a scoped key without access, an address outside the key IP list, or a balance that cannot cover the callUse a key with that access, from an allowed address, on an application with credit
403 with application_deletedThe key application was just deletedDo not retry. The application and its keys are gone
404The session sits outside the scoped key workflows or statusesWiden the key limits or use the right key
409A reused Idempotency-Key, or a step that already ranRead the body code and reload the state
415The body is not JSONSend Content-Type: application/json
429A rate limit or quota was hit. Body carries Retry-After, X-RateLimit-Scope and a referenceWait for Retry-After, then back off 5s, 10s, 20s, 40s with jitter and stop after about 5 attempts
500, 502, 503An unexpected error, a failed dependency or a timeout on our sideRetry with backoff, and contact support if it persists
Sandbox quota500 session creates per 24 hours per sandbox application is exhausted by a looping scanPace the scan, or spread the load across sandbox applications

Inputs and outputs

What goes into the run and what comes out
InputWhere it comes fromOutput it produces
x-api-key (sandbox)Register and verify flow, or Developers, API keysAn authenticated call, or a 401 or 403 you must not file as a vulnerability
workflow_id/v3/workflows/A session that follows that workflow
vendor_dataYour own stable user identifierA session bound to a user entity, used for duplicate detection
callbackA URL on one of your allowed domainsA return redirect carrying verificationSessionId and status
sandbox_scenarioGET /v1/sandbox/scenarios/A deterministic Approved, Declined or In Review outcome
ZAP context and request headersYour staging deploymentAlerts with request, evidence and solution
ZAP report fileThe scan itselfA pass or fail gate in CI
GET /v3/session/{sessionId}/decision/The session id from createA decision document to compare against the scan response

What is billable, and where automated review stops

Sandbox work is free. Sandbox sessions are never billed, the balance check is bypassed and every external provider is mocked, so a scan campaign of any size costs $0.00 in Didit usage. The quota is the real limit: 500 creates per 24 hours per application.

Anything on a live application bills per completed check from prepaid credit. A full ID check is $0.33: ID document verification $0.15, passive liveness $0.10, face match 1:1 $0.05, and device and IP analysis $0.03. Standalone server-to-server calls have their own lines. ID Verification is $0.15 per check; read the standalone API line on the feed before you replay live. Some no-match lookups and retries are billable, per the docs pricing page, so a scanner that re-sends the same live request is a spend decision as well as a load decision.

Review boundaries. An automated scan covers the OWASP API Security Top 10 categories detectable from outside: broken object level authorization where ids are guessable, broken authentication, broken object property level authorization including excessive data exposure, unrestricted resource consumption, and security misconfiguration. It does not reason about business logic abuse, it does not test inside our infrastructure, and it is not an audit opinion. Keep the manual pen test, and keep our SOC 2 Type 2 and ISO/IEC 27001:2022 evidence separate from your scan report. Those certifications cover our side. Your scan covers yours.

Worked cost example

Assume one regression cycle: 1,000 sessions created by the scanner, with a decision read on each.

  • Sandbox cycle: 1,000 x $0.00 = $0.00. Sessions never bill. At 500 creates per 24 hours per application the cycle spans two days, or you split it across two sandbox applications.
  • The same flow live, full ID check per session: 1,000 x $0.33 = $330.00.
  • On Growth, 4% off every Didit price: 1,000 x $0.3168 = $316.80, on a $99.00 monthly plan with $115.00 of monthly credit.
  • On Scale, 10% off: 1,000 x $0.297 = $297.00, on a $299.00 monthly plan with $350.00 of monthly credit.
  • Add AML screening to each live session: $0.33 + $0.20 = $0.53 per session, so 1,000 x $0.53 = $530.00.

The price list has no line for decision reads or webhook delivery, so the checks above are the billed units. The arithmetic makes the point: scan in sandbox, and spend live credit only on the handful of sessions you replay to confirm a fix.

Which OWASP API risks matter here

Broken object level authorization (API1:2023) is the one that hurts most in identity. If your decision endpoint takes a session id from the client, an attacker changes one character and reads someone else's verification. Test it with two sandbox accounts and a scripted id swap rather than a generic fuzzer, because the signal is behavioural: an authorized read and an unauthorized read return different bodies for the same URL shape.

Broken authentication (API2:2023). In a Didit integration the interesting failure is not your login screen, it is the boundary between your user session and the verification. A decision read must require your own user's session, not a shared server key plus an id.

Broken object property level authorization (API3:2023), which often shows up as excessive data exposure. The decision document is rich. Return the minimum your client renders. Names, document numbers and extracted addresses have a way of ending up in a JSON payload a browser caches.

Unrestricted resource consumption (API4:2023). Confirm your own endpoints throttle. Didit returns 429 with Retry-After and X-RateLimit-Scope, so the upstream is bounded. Your wrapper has to be bounded too, or one client can burn the session create budget for everyone.

Security misconfiguration (API8:2023). Verbose error bodies are the usual leak. Didit error bodies have documented shapes, so if your wrapper echoes them straight to the client, compare what you return with what the docs say is safe to expose.

Didit Business Console session detail for an ID document check
One sandbox session, one document check. The console shows the extracted fields your wrapper should trim before returning them to a browser.

Why the sandbox makes a scan repeatable

Sandbox is a per-application mode. Every external provider is mocked, liveness runs as it does live while only the result is simulated, sessions never bill, and webhooks carry the sandbox environment. Outcomes never depend on pixels: extracted data and statuses come from the scenario or magic value. For a scanner that means you can pin Approved, Declined and In Review and diff two reports without a provider changing its answer in between.

Didit Business Console session detail for a liveness check
Liveness runs for real in the sandbox, so the flow your scan exercises matches the live experience while the result stays simulated.

How we support this testing

We document the error contract, the rate limits and the sandbox catalogue because a security test is only as good as the reference behaviour it compares against. Our platform holds SOC 2 Type 2 and ISO/IEC 27001:2022 (certificate ES144068), and 4,000+ companies run on it. None of that replaces your scan of your own integration.

Teams that want an assistant to drive the API during triage can connect Didit to an AI assistant through the MCP server at didit.me/developers/mcp. The integration prompt gets a coding agent to a working call quickly, which is also the fastest way to produce the reference response your scan compares against.

Sources

Start at business.didit.me. Create a sandbox application, take the sk_test_ key, create one session by hand, then point the baseline scan at your staging endpoint the same afternoon. No sales call, no contract, and the sandbox run costs nothing.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alejandro Rosas

Co-founder and CTO

Alejandro Rosas

Alejandro Rosas

Co-founder and CTO

About Didit

Questions

Frequently asked questions

Can I run OWASP ZAP against Didit's API?

No, not without written authorization. Didit's hosted verification API is our production surface, and an active scan against it is an attack on a third party. Point ZAP at the endpoint you expose, which calls Didit from your backend, and use a sandbox application for the test data.

What is automated pen testing of an identity verification API?

It is a scripted vulnerability scan of the endpoints that create, read and decide identity sessions, run without a human driving each request. It sends recorded and mutated requests, compares responses against expected behaviour, and reports the ones that leak data, skip authorization or fail under load. It does not replace a manual pen test, which reasons about business logic.

Does a ZAP scan cost anything in the Didit sandbox?

No. Sessions on a sandbox application are never billed, the balance check is bypassed and every external provider is mocked. The limit is throughput: 500 session creates per 24 hours per sandbox application, raisable on Enterprise on request.

Why does my scan get 429 responses from Didit?

A 429 means a rate limit or quota was reached. The response carries Retry-After, X-RateLimit-Scope, X-RateLimit-Reset and a reference string. Use Retry-After as the floor, add exponential backoff with jitter from 5 to 40 seconds, and stop after about five attempts. A sustained 429 usually means a runaway loop, not a vulnerability.

How do I test broken object level authorization on a Didit integration?

Create two sandbox sessions under two different vendor_data values, then try to read session A's decision with the credentials of session B. If the read succeeds, your endpoint is missing an ownership check. Do it with a script rather than a generic fuzzer, because the difference between an authorized and unauthorized read is behavioural, not a status code.

Where do I get a Didit API key without a sales call?

Sign up at business.didit.me, or call the programmatic register and verify-email endpoints. The verify-email response returns the sandbox and live keys inline. New keys start with sk_test_ or sk_live_ plus 43 URL-safe characters, and older keys without a prefix keep working.

What are the inputs and outputs of a scan run?

Inputs are a sandbox API key, a workflow_id, a stable vendor_data, an allowed callback, an optional sandbox_scenario, and a ZAP context pointed at your staging host. Outputs are a ZAP report with alerts and evidence, a CI pass or fail gate, a session record in the Business Console, and a decision document from GET /v3/session/{sessionId}/decision/.

Is automated pen testing enough, or do I need a manual test?

You need both. Automation covers the categories detectable from outside and runs on every deploy, which is what keeps a regression from shipping. A manual test covers business logic, chained abuse and the reasoning an automated scanner cannot do. Neither one inspects our infrastructure, which is covered by our SOC 2 Type 2 and ISO/IEC 27001:2022 certifications.

Which OWASP API risks should I prioritise?

Broken object level authorization, broken authentication and broken object property level authorization, in that order. Then resource consumption on your own wrapper and error handling that does not echo internal detail. Those five cover most of what a scanner can meaningfully find in an identity verification integration.

How do I keep the Didit API key out of the scan target?

The key is a server-side secret. Never ship it to a browser or a mobile bundle, so scan the backend endpoint that attaches x-api-key rather than the client. If a scan finds a Didit key in client code, treat that as a critical finding in your own deployment.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Tested in Spain's Treasury sandbox

    Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.