# 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

- Skill: `wsh7ash/graphql-node-id-decoding` (Agent Skill)
- Install (CLI): `npx get-skill add wsh7ash/graphql-node-id-decoding`
- Raw SKILL.md: https://api.skillmd.com/api/skills/wsh7ash/graphql-node-id-decoding/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: Wsh7Ash (https://skillmd.com/u/wsh7ash)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/wsh7ash/graphql-node-id-decoding

---


# 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

1. Capture a node identifier from your own account's query result and decode its base64 payload locally to see the type and key inside.
2. Check whether the decoded form leaks internal identifiers, type names or numeric sequences.
3. Query the node through the generic node field using an identifier from your second test account and observe the response.
4. Test the equivalent direct field queries, since resolvers for direct fields and node resolution may use different checks.
5. Review mutations that accept node identifiers, verifying ownership is re-checked before any write.
6. 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**

```text
Zm9vOjEyMw== -> "foo:123"
type=order key=123 -> internal key exposed by design
```

**2. Resolver check**

```text
node(id=peer) -> 200 + data   vs   order(id=peer) -> null/error
-> node resolver missing the ownership check
```

**3. Result row**

```text
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.

## References

- [GraphQL specification - object identification](https://spec.graphql.org/)
- [OWASP API Security Top 10](https://owasp.org/www-project-api-security/)

