Why a GraphQL API needs its own penetration test
A GraphQL API needs its own penetration test because one endpoint, a self-describing schema and client-chosen queries change where weaknesses sit. A compliance assessor, a customer security review, a launch date or an insurer may ask for evidence that the API was tested, and a generic test of URLs and HTTP methods does not show that the schema, resolvers and authorization rules were examined. The OWASP GraphQL Cheat Sheet lists injection, denial of service, broken authorization including insecure direct object references, batching attacks and insecure default configurations as the main GraphQL threats. The OWASP Web Security Testing Guide v4.2 includes a dedicated Testing GraphQL page under section 4.12 API Testing, so buyers can ask a provider to map the work to that guidance and to the GraphQL Cheat Sheet controls.
Because a single endpoint serves every query, a request that looks ordinary in a web server log can return data from several types, and nested fields can reach objects the user should never see. Authorization therefore has to be checked at the resolver and field level, for each object identifier and for each relationship between types, not only at the route. A scanner that sends a fixed set of requests cannot follow these paths, and a REST-oriented test may check the outer request without testing what the resolvers return. The tester needs the schema, at least two roles with known permissions and a clear view of which operations exist, so the test can compare what each role should see with what it does see.
Denial of service is a core concern here, not an afterthought. The GraphQL Foundation's security guide notes that many GraphQL-specific attack vectors are denial of service attacks, so a test must cover resource exhaustion alongside data exposure. The controls the Cheat Sheet names, including query depth and amount limits, query cost analysis, rate limiting and disabling introspection and GraphiQL in production, are the settings a reader should confirm with the engineering team before testing starts. Ask the provider to state how resource limits will be tested in your environment, and confirm with your team beforehand which load-generating activity is permitted so the test does not cause an outage.
What a GraphQL penetration test can cover
A GraphQL API exposes one endpoint through which clients send queries, mutations and subscriptions, so a test follows the request from transport through schema and resolvers to the data behind them. The GraphQL Foundation's security guide notes that many generalizable API practices apply, but GraphQL adds its own considerations, so each component below should be confirmed for the target before scoping.
Single endpoint and transports
GraphQL typically serves all operations from one HTTP path, so the test covers which HTTP methods, content types and transports the endpoint accepts, including whether GET requests can carry operations. Confirm the endpoint URLs, any gateway or CDN in front of them, and whether WebSocket or other subscription transports are exposed outside the internal network.
GraphQL security guideSchema and introspection exposure
The schema defines every type, field and argument the API accepts, so a tester checks whether introspection is enabled for unauthenticated or production callers and how much of the schema it reveals. The OWASP GraphQL Cheat Sheet treats disabling introspection in production as a standard control. Confirm with the team whether introspection is intentionally on for any consumer.
OWASP GraphQL Cheat SheetQueries, mutations and subscriptions
Each root operation type exposes a different risk: queries read data, mutations change state, and subscriptions push updates over a long-lived connection. Testers map which fields each operation reaches and whether any of them perform actions without the checks a REST endpoint would carry. Ask for the list of root fields and which ones are documented as internal.
Resolvers and backend data sources
Resolvers connect schema fields to databases, microservices and third-party APIs, and authorization often fails at this layer when a field is fetched without checking the caller's rights to the underlying object. Testing covers object-level access through nested fields and whether resolvers call backends that accept untrusted input. Confirm which data stores and downstream services each resolver uses.
Authentication and token handling
Authentication may be enforced at the gateway, in middleware or inside individual resolvers, and each placement creates different gaps. The test examines how tokens are issued, validated, scoped and revoked, and whether unauthenticated operations are reachable. Confirm the identity provider, token lifetimes and which operations are meant to be public.
Role-based accounts and authorization
Broken authorization is one of the main GraphQL threats named in the OWASP cheat sheet, and IDOR through object identifiers is a frequent form of it. Testers compare what each role can read and change across the same operations, using accounts at every privilege level. Ask for test accounts per role, tenant boundaries and a written permission matrix.
GraphiQL, playground and error output
Browser-based consoles such as GraphiQL and playground tools can expose the schema and help a user run operations, and verbose error messages can reveal stack traces, field names or backend details. Testing checks whether these interfaces are reachable in production and what errors return to unauthenticated callers. Confirm which consoles are deployed in each environment.
How a GraphQL penetration test runs, phase by phase
The sequence moves from a written agreement on scope and rules of engagement to a schema-driven test of authorization, input handling and resource limits, ending in a report the client can verify and a retest of the fixes.
Agree scope and rules of engagement in writing
The client and the testing provider agree in writing which GraphQL endpoints, environments and versions are in scope, which operations and data are off limits, which testing viewpoints apply, and when load-related tests may run. The testing provider owns drafting the rules of engagement, and the client's security and platform owners approve them before any traffic is sent. The step closes when both parties have signed the scope and the named contacts for emergencies are recorded. The detailed scoping decisions are covered on the scope and rules of engagement page.
Collect the schema and test accounts
The client provides the schema, or the testing provider retrieves it from the endpoint where introspection is enabled and the client has approved that. The client also supplies test accounts for each role that should exist, such as anonymous, standard user, administrator and any tenant or partner roles, along with the authentication method each role uses. The testing provider confirms that every account is isolated so that tests cannot affect real customer records. The step closes with a written inventory of the schema version, the roles and the accounts, agreed by the client.
Map the schema, operations and roles
The tester reads the schema to identify types, queries, mutations, subscriptions, arguments, nested relationships and fields that return sensitive data. The tester then records which operations each role can reach and which fields depend on object identifiers. Where introspection is disabled, the tester states how the schema was reconstructed and flags that gap as a finding in its own right. The step closes with a map of entry points and role-to-operation coverage that the rest of the test follows.
Test authorization and input handling from each viewpoint
The tester runs the same operations as unauthenticated, standard and privileged users and compares what each one can read or change. Object-level checks are tested by requesting records that belong to other accounts, and function-level checks by calling mutations that the role should not reach. Arguments, variables and nested inputs are tested for injection and unsafe handling, and error responses are reviewed for stack traces or internal detail. This follows the OWASP WSTG v4.2 Testing GraphQL page and the object-level risk in the OWASP API Security Top 10 2023. The step closes with logged results for each role and operation, with the evidence needed to reproduce each issue.
Test resource consumption limits in agreed windows
The tester checks whether the endpoint limits query depth, query cost, the number of aliases or batched operations, and request rate, and whether those limits hold under the nested and batched queries the schema allows. These tests run only inside the windows and load ceilings written into the rules of engagement, because many GraphQL attack vectors are denial of service issues. The client's operations team monitors the service during the window and can stop testing. The step closes with measured limits, any point where the service degraded, and a note of what was not tested.
Review configuration and disclosure defaults
The tester checks whether introspection, GraphiQL or similar interactive consoles are reachable in production, whether debugging output appears in responses, and whether the endpoint is reachable from networks it should not be. The tester compares these settings with the controls in the OWASP GraphQL Cheat Sheet and records each deviation with its impact. The client confirms which settings are intended in each environment. The step closes with a configuration summary that the client can act on directly.
Report findings with reproduction and fixes
The testing provider writes a report that lists each finding with its affected operation, the role used, the steps needed to reproduce it, the observed result, the impact and a recommended fix. Findings are mapped to OWASP identifiers and rated with a stated scoring method. The report also lists what was tested with no issue found and any gaps in coverage. The client reviews a draft with the testers and agrees on factual accuracy before the final version is issued. The step closes with a final report and a list of findings to fix.
Retest the fixes and close the engagement
After the client applies fixes, the tester repeats the original reproduction steps against the same schema version and role set, and checks for regressions in neighboring operations. Each finding is marked as resolved, partly resolved or still open, with the evidence for that status. The client confirms whether the retest is included in the agreed scope or handled separately. The step closes with a retest record that the client can share with its auditor or customer.
What drives GraphQL penetration testing cost and duration
This table compares the scope factors that move the effort of a GraphQL penetration test, explains why each one matters, and lists what to request in a written quote. No public rate exists for this work, so use the table to compare proposals on the same inputs rather than on a headline figure.
| Driver | Why it moves cost or effort | What to ask for in a quote |
|---|---|---|
| Number of GraphQL endpoints and schemas | Each endpoint or separately built schema has its own types, resolvers and authorization logic, so each one adds test planning and execution. | A list of every endpoint, gateway and schema version in scope, with the ones excluded and why. |
| Schema size and number of types, queries and mutations | Larger schemas have more fields and arguments to map and more paths to test for authorization and injection, which extends manual review time. | Schema export or introspection output (if permitted), field counts by type, and how the tester will sample fields. |
| Number of roles and test accounts | Each role needs its own authorization matrix, so testing object and field access across roles multiplies the work. | Named roles, the permissions each holds, and how many test accounts the client will provide per role. |
| Authenticated versus unauthenticated coverage | Authenticated testing covers business logic and per-role access, which unauthenticated testing does not reach, so both modes add effort. | Which modes are in scope, the authentication method used, and whether testers may act as more than one user. |
| Source or schema access | Resolver code and schema definitions let testers confirm authorization checks directly, which reduces guesswork but requires code review time. | Whether source, schema files or design documents are provided, and the level of review (schema only, resolver review or both). |
| Resource consumption testing | Depth, batching, alias and cost limit testing can degrade shared environments, so it needs extra planning, monitoring and agreed limits. | Whether denial of service style testing is included, the agreed limits, the test window and the monitoring the client will provide. |
| Test environment and its data | A production-like environment with realistic data takes more setup, and data cleanup or reset adds time during and after testing. | Environment name and version, data reset rules, whether production is excluded, and who supplies test data. |
| Retest | Retest effort depends on how many findings were fixed, how many need re-verification across roles, and whether the schema changed. | A fixed retest scope tied to the findings list, the number of retest rounds and the window in which retests are accepted. |
| One-time engagement versus recurring work | The initial test is a single engagement. Retests, scheduled re-tests after schema changes, retainers and continuous testing recur and are priced separately. | Separate line items for the initial test, each retest round and any retainer, with the trigger for re-testing after major schema changes. |
What you receive and whether it satisfies your auditor or customer
A GraphQL penetration test produces a set of artifacts, and each one serves a different reader. Before the test starts, confirm with your auditor or customer which format they accept, because a penetration report is not an audit attestation and is judged on its own terms.
Scope and method statement
This sets out the endpoint, schema version, roles or test accounts, environments, and the testing viewpoint used, such as unauthenticated, authenticated or documentation-led. It also records what was excluded and why. Check that the statement names the exact GraphQL endpoint and the schema snapshot tested, since a result without those details cannot be reproduced or compared later.
Executive summary
A short narrative for leadership that states the overall exposure of the GraphQL API, the most significant findings and the decisions needed from management. It should avoid technical jargon and should not repeat the detailed findings. Ask the tester to describe how the summary relates to the technical sections so that the two do not contradict each other.
Findings with reproduction steps
Each finding should describe the weakness, the affected type, field or resolver, and the evidence that it exists. Reproduction steps should let your own engineers confirm the issue in a controlled environment without the tester present. Expect defensive descriptions of the condition rather than working exploit code, and confirm how sensitive data seen during testing will be handled.
Severity ratings with environmental context
Each finding should carry a severity rating that explains how it was scored and how your environment changes that score. For example, an authorization gap on a field that returns personal data in production warrants a different rating from the same gap in a non-production copy with synthetic records. Ask which scoring method the tester uses and whether the scoring rationale is written down.
Mapping to OWASP identifiers
Findings should be tied to the OWASP categories that apply, including the OWASP API Security Top 10 2023 items for broken object level authorization, unrestricted resource consumption and security misconfiguration, and the GraphQL Cheat Sheet controls for introspection, depth limits and batching. This mapping lets an auditor or customer see which risks were tested rather than reading a list of isolated issues.
API Top 10 2023ASVS coverage summary
Where ASVS verification was agreed in scope, the report should list which requirements were checked, which had exceptions with guidance, and which do not apply. ASVS 5.0.0 expects this summary to cover all requirements checked, not only failures. If your customer asked for ASVS evidence, agree the chapters and level in writing before testing.
ASVS 5.0.0 sourceFix guidance and retest results
Fix guidance should explain the remediation for each finding, such as enforcing object-level checks in each resolver, disabling introspection in production, or setting query depth and cost limits. Retesting then confirms which fixes work. Ask whether a retest is included, how long a retest window lasts, and whether the retest is documented as a separate, dated result.
Engagement letter for customers
A letter summarizing the engagement, the tester, the dates, the scope at a high level and the outcome status can be shared with customers who ask for evidence without receiving the full report. It should not disclose sensitive findings. Confirm with the customer whether they accept such a letter or require the full report under their own confidentiality terms.
What you prepare before a GraphQL test starts
The most useful preparation is a current schema or introspection output, supplied only where your policy permits introspection in the tested environment. Testers need the full type graph, including mutations, subscriptions and the fields hidden behind unusual resolvers, because a GraphQL endpoint can expose far more than its documented client queries use. Alongside it, provide a current endpoint list covering every GraphQL path, version, gateway route and any separate batch or persisted-query endpoint, plus the GraphiQL or playground URLs if they exist. Confirm whether introspection is enabled in production, since the OWASP GraphQL Cheat Sheet treats disabling it there as a control the test should verify rather than assume.
Provide test accounts for each role the schema distinguishes, such as anonymous, standard user, tenant administrator and support staff, each with agreed seed data. Authorization testing on GraphQL depends on comparing what two accounts can read through the same object identifiers, so agree in writing which records belong to which account and which ones may be modified. Name a technical contact who can answer schema questions and an escalation contact with authority to pause the test. Decide the test window and any change freeze in advance, and record whether the schema will be changed during the engagement.
Resource-consumption testing needs its own agreement. Depth, alias, batching and cost-based limits can be exhausted by deliberately expensive queries, so on shared or production systems agree the request rate ceiling, the time of day and an abort condition, and confirm that the monitoring team knows the test is running so that alerts are not mistaken for an attack. Finally, check with your hosting provider and API gateway vendor whether they have rules on load or denial-of-service testing, whether a gateway or web application firewall will rate limit or block testing traffic, and which source addresses the tester should use for allowlisting. Ask for those answers in writing before the window is booked.
What to check in a GraphQL testing provider before you sign
A GraphQL test is only as useful as the tester's grasp of schemas, resolvers and query execution. The cards below cover the decisions that separate a GraphQL-specific engagement from a generic web scan with a new label, and the evidence to request before you sign.
GraphQL-specific method
Ask how the provider maps its work to the WSTG v4.2 Testing GraphQL page and to the controls in the OWASP GraphQL Cheat Sheet. A credible answer names the checks it runs against introspection, field-level authorization, depth and batching limits and error handling, and shows how each one is recorded. Ask whether testing starts from the schema and resolver documentation or only from observed traffic, since schema-led work finds hidden fields and mutations that crawling misses. Note that OWASP does not certify providers, so this evidence has to come from the provider's own documents.
WSTG GraphQL pageAuthenticated and role-based testing
GraphQL usually serves several roles through one endpoint, so most authorization defects only appear when testers hold different accounts. Ask whether the provider tests as an unauthenticated user, as each role and as a user attempting to reach another tenant's objects through ID arguments. Confirm who supplies the test accounts, how many roles are covered and whether the provider will test mutations as well as queries. Testing that uses only one privileged account leaves most object-level and function-level authorization questions unanswered.
Safe handling of denial of service tests
Many GraphQL-specific attack vectors are denial of service issues, so the provider must test resource exhaustion without taking your service down. Ask how it bounds test queries for depth, alias count and batch size, which environments it uses for load-sensitive checks and who approves those checks in writing. A good answer describes stopping conditions and monitoring during the test. Vague answers such as "we test carefully" are a reason to ask for the written rules of engagement.
Findings written for developers and auditors
Each finding should name the affected field, resolver or mutation, the authorization or limit that was missing, the evidence that proves it and a fix a developer can apply. Ask for a sample report, redacted under the provider's confidentiality terms, and check whether findings map to OWASP identifiers such as API1 Broken Object Level Authorization. Also confirm that the report records which checks passed, because an auditor needs coverage as well as defects.
Accredited or aligned methods where relevant
Where a customer or framework expects a named assurance route, check the provider's status before you rely on it. CREST announced OVS accreditation for testing organizations that run ASVS-based web assessments, so ask whether the provider holds that accreditation or follows an OVS-aligned method, and ask for the scope it covers. If the provider holds no such accreditation, ask how its method still meets the ASVS level you chose. Verify any claim directly with the accrediting body rather than accepting a logo.
CREST OVS announcementReferences and written scope
Ask for references from comparable GraphQL engagements, and for a scope of work that names the endpoints, schema versions, environments, accounts and out-of-bounds actions before testing begins. The rules of engagement should record who to contact during the test, how critical findings are escalated and how retesting is priced. Request references and sample reports under confidentiality terms, and check any reference you contact directly. A provider that will not put scope and rules in writing before work starts is a poor fit for a production GraphQL API.
GraphQL penetration testing questions buyers ask before hiring help
How much effort does a GraphQL API penetration test take?
Effort depends mostly on the size and complexity of the schema, the number of roles that must be tested, and whether the tester has the schema and documentation. Introspection-enabled schemas with many types, nested relationships and mutations take longer to map and test for object-level authorization than a small schema with a few queries. Ask the provider to break the quote into schema mapping, role-based authorization testing, resource consumption testing, reporting and retest, so you can see where the time goes. No public effort rate exists for GraphQL testing, so compare quotes on the stated scope rather than on a day rate alone.
How long does a GraphQL penetration test take, and what changes the timeline?
Duration follows scope and access. A test against one endpoint with a published schema and test accounts for each role usually moves faster than one where the tester must discover the schema, obtain several credentials and agree on safe limits for resource consumption checks. Delays often come from waiting for test accounts, environment fixes or clarification on which mutations may change data. Ask the provider for a written schedule with dates for kickoff, testing, findings review and report delivery, and confirm how much of the window depends on your team's responses.
What does the client need to provide before testing starts?
The tester needs the GraphQL endpoint or endpoints, the schema if you can share it, documentation for queries and mutations, and at least one test account per role that should be tested, such as anonymous, standard user and administrator. You should also provide the environment details, the allowed hours, contacts for escalation and a list of mutations that must not run. Where the schema is not shared, the provider will map it through introspection if enabled, or through observed traffic, which takes longer and should be stated in the scope of work. Confirm the exact list with your provider before kickoff.
Can our own engineering team run a GraphQL penetration test internally?
Your team can run useful checks, such as disabling introspection in production, reviewing query depth and cost limits, and confirming that resolvers enforce authorization on every object. An independent penetration test is different because it tests whether those controls hold against an adversarial approach, and independence matters when auditors or customers ask who performed the test. Many organizations use internal engineers for continuous checks and bring in an external tester for the scheduled assessment. Ask any provider, including DeployOpen, to document the tester's independence from the team that built the API.
Is an automated GraphQL scanner enough to find authorization flaws?
No. Scanners can detect some exposure such as enabled introspection, verbose error messages and missing depth limits, but broken object-level authorization and field-level access problems depend on understanding which user should see which object. ASVS 5.0.0 states that automated DAST and SAST tools cannot fully verify many requirements, especially business logic and access control. The OWASP GraphQL Cheat Sheet points to authorization checks in resolvers and to query cost analysis, which a scanner tends to test only at a surface level. A scanner is a reasonable input to a manual test, not a replacement for one.
Can GraphQL penetration testing run against production?
It can, but only with written rules of engagement that define which operations are allowed, which accounts are used, how much load is acceptable and who is contacted if something degrades. Resource consumption testing is the main concern in production, because the GraphQL Foundation's security guide notes that many GraphQL-specific attack vectors are denial of service attacks. Many teams test authorization and schema exposure in production and run load-sensitive checks in a staging copy that matches production configuration. Confirm how the provider handles test data, mutations and cleanup before agreeing to any production work.
Does the penetration test report satisfy PCI DSS or a customer's security review?
The report is evidence for an assessor or customer, but it does not certify compliance. PCI DSS requirement 11.4.1 calls for application-layer penetration testing that covers the vulnerabilities in requirement 6.2.4, including business logic abuse through API manipulation, so a GraphQL test can contribute to that evidence when its scope includes the payment-relevant APIs. Your Qualified Security Assessor or the customer's security team decides whether the report is sufficient. DeployOpen does not issue audit reports or attestations; independent auditors and certification bodies do. Ask the provider to confirm in writing how findings map to the standards your assessor uses, and how retest results are recorded.
How does retesting work after a GraphQL penetration test?
Retesting checks whether the fixes for reported findings work, and it is usually scoped and priced separately from the original test. The usual sequence is that your team fixes the issues, documents each change, and asks the tester to verify the specific findings in the same environment and roles. The retest report should state which findings are closed, which remain open and which the tester could not verify. Confirm whether the quote includes one retest round, how long the provider keeps the test accounts available, and how results are delivered for your auditor.
How DeployOpen scopes, tests, reports and retests GraphQL APIs
DeployOpen treats a GraphQL API test as a single-endpoint, schema-led engagement. We agree the schema, roles and rules of engagement in writing first, then test authorization, query-cost controls and error handling against the schema as it actually runs, and hand over findings with fixes and a retest.
How we scope
- Written scope names the GraphQL endpoint, environments, API versions and any separate REST or gateway routes included.
- We agree which schema sources are provided, such as introspection output or a schema file, and whether introspection is expected to be on.
- Test accounts for each role, with the object types and mutations each role should and should not reach, are listed in the scope document.
- Fixed-scope terms set deliverables, timelines and rules of engagement before any testing begins, with ongoing support available as a retainer.
How we test
- Testers map the schema's queries, mutations and subscriptions, then check each field and resolver against the role model.
- Object-level checks confirm that every ID-based lookup enforces ownership, covering the object authorization risk in the OWASP API Security Top 10 2023.
- Depth, alias, batching and cost limits are exercised at controlled volumes to confirm the denial-of-service controls in the OWASP GraphQL Cheat Sheet hold.
- Argument handling, error messages and disabled debug tooling are reviewed alongside authorization, since each can leak data or internal structure.
How we hand over
- Each finding records the affected type, field or mutation, the role used, the observed behavior and the risk to the business.
- Findings map to OWASP identifiers and include specific remediation steps for the schema, resolvers, gateway or configuration.
- The report states which checks were run, which passed, and which were out of scope, so an auditor or customer can see the coverage.
- Findings are discussed with your developers before the report is finalized, and the retest scope is agreed at handover.
How we support
- Retesting confirms that fixes to authorization, depth limits and introspection settings work against the same schema and roles.
- Teams that change the schema can add new types and mutations to the written scope for a follow-up test.
- Ongoing support and continuous testing are available as a retainer for APIs that change frequently.
- Ask us to confirm in writing how retest and change requests are priced before signing the scope.

