GraphQL Node ID Decoding
Decode global node identifiers and verify the server enforces ownership after the decode, which is where GraphQL authorization usually fails
Use when: the API exposes GraphQL with global node identifiers or relay-style connections
Avoid when: the service is plain REST with no GraphQL surface to analyze
Procedure
- Capture a node identifier from your own account's query result and decode its base64 payload locally to see the type and key inside.
- Check whether the decoded form leaks internal identifiers, type names or numeric sequences.
- Query the node through the generic node field using an identifier from your second test account and observe the response.
- Test the equivalent direct field queries, since resolvers for direct fields and node resolution may use different checks.
- Review mutations that accept node identifiers, verifying ownership is re-checked before any write.
- Check connections and pagination for cross-account edges, where list-level filtering is often weaker than single-node checks.
Signals
- Decoding a node id reveals a sequential database key and a type name in plain form.
- The node query returns a peer-owned object while the equivalent direct field correctly refuses it.
- A mutation accepts a node id without verifying ownership before performing the write.
- A connection's edges include nodes belonging to another account when queried with attacker-controlled arguments.
Patterns
1. Node decode
Zm9vOjEyMw== -> "foo:123"
type=order key=123 -> internal key exposed by design
2. Resolver check
node(id=peer) -> 200 + data vs order(id=peer) -> null/error
-> node resolver missing the ownership check
3. Result row
field=node resolver=node leak=yes mutation=updateOrder(id=peer) accepted=yes
Pitfalls
- Assuming one resolver's check covers all resolvers; GraphQL exposes many independent code paths.
- Testing only reads while the damaging path is a mutation that accepts the same identifier.
- Forgetting introspection-disabled deployments, where schema knowledge must come from client documents instead.
Done when
- Node identifiers are decoded and characterized, and both node and direct-field resolvers are tested with peer identifiers.
- Mutations accepting node ids are verified to re-check ownership, with per-resolver results recorded.