API security

GraphQL resolver authorisation and nested data access

Resolver paths: network, filter, database arranged to illustrate graphql resolver authorisation and nested data access.

A GraphQL entry point still needs authorisation on the objects and fields reached by its resolvers. Understanding GraphQL resolver authorisation and nested data access helps establish which security property the feature needs and where that property is actually enforced.

What does this involve?

Authorisation determines which resources and operations an established identity may use. It must be enforced where protected data is read or changed. User interface restrictions, obscure identifiers and documentation can help usability, but they do not replace the service's own permission decision.

GraphQL is becoming more common as a way of creating data-rich clients that are not tightly coupled to a variety of backend services. This section covers security considerations for GraphQL.

Why it matters

Consider a realistic failure: a permitted parent query exposes a restricted nested customer record.

A missing check can expose another account's information or let an ordinary user perform a privileged action. The result should be described by the actual records and operations reached, including whether access crosses a customer or organisational boundary.

An API review follows the server-side behaviour behind the interface. Direct requests, alternate methods and background operations can reveal boundaries that the normal frontend journey does not exercise.

How penetration testers check for it

Test nested paths and field access under different ownership and role contexts.

  • Confirm that a query allowlist, depth limiting, amount limiting, or query cost analysis is used to prevent GraphQL or data layer expression Denial of Service (DoS) as a result of expensive, nested queries.
  • Confirm that GraphQL introspection queries are disabled in the production environment unless the GraphQL API is meant to be used by other parties.
  • Test nested resources, background processing and state changes.
  • Confirm rejection as well as the legitimate successful journey.

How to fix it

Enforce authorisation at the resolver and data access boundaries that expose protected information.

  • Define explicit access rules and default-deny behaviour.
  • Bind resource selection to trusted ownership and tenant context.
  • Enforce permission checks at each protected operation.
  • Maintain regression cases for unauthorised users and changed permissions.

A successful response alone does not prove unauthorised access. Establish whose resource was affected and what the caller was legitimately entitled to do.

Recheck the changed behaviour against the original failure conditions and the legitimate user journey. Keep enough evidence to show which release and configuration were verified, and include related entry points that depend on the same security decision.

Read about our methodology or contact pentested.com to discuss your APIs and integrations.

See your first test report this week.

Book a 30 minute demo. We will verify one of your targets with you and run a test against it, so you can judge the results on your own systems.

Book a demo