Summary
An authorization bypass in n8n's GraphQL node can cause domain restrictions to be evaluated against only one credential while credentials from multiple authentication selectors are attached. An authenticated user with workflow-authoring rights may use this behavior to send a restricted credential to an attacker-controlled endpoint, exposing it within the credential's permitted scope.
Affected context
The issue occurs in n8n workflows that use the GraphQL node with the Authentication parameter configured in expression mode and multiple credentials of different types attached. In this state, authentication-gated credential selectors may all be treated as active, while the allowed-domains policy is enforced using only the first credential's configuration. Exploitation depends on an authenticated user having permission to create or modify workflows and on the workflow being able to reach an attacker-controlled destination.
Exploit preconditions
- Attack surface: n8n workflow authoring and GraphQL node configuration
- Required access: An authenticated account with workflow-authoring rights
- Trigger point: Execution of a GraphQL node whose Authentication parameter uses expression mode
- Configuration condition: Multiple credentials of different types are attached to the node
- Why exploitation is possible: The node may attach material from all active credential selectors while applying domain restrictions from only the first credential
Why this happens
The underlying bug is an authorization-policy mismatch caused by inconsistent handling of multiple credential selectors. When authentication is configured through an expression, the node treats every authentication-gated selector as active, but evaluates the allowed-domains restriction against only one selected credential. This maps to CWE-639: Authorization Bypass Through User-Controlled Key, because attacker-influenced workflow configuration can cause an authorization check to be applied to the wrong security-sensitive object or credential.
Potential impact
- A restricted credential could be transmitted to an attacker-controlled endpoint
- Credential material could be exposed within the permissions granted to that credential
- Connected services may be accessed or queried without the intended domain boundary
- Workflows or downstream integrations could be abused for data access or lateral movement
General mitigation guidance
Mitigation generally focuses on making credential authorization decisions consistent, explicit, and fail-closed.
Common defensive patterns include:
- Evaluate allowed-domains policies independently for every credential that may be attached
- Avoid treating all authentication selectors as active when expression-based configuration is used
- Reject ambiguous configurations that combine incompatible credential types
- Restrict workflow-authoring privileges according to least privilege
- Limit outbound network access from workflow runtimes using allowlists and segmentation
- Keep credential values inaccessible to workflow authors and prevent unnecessary credential exposure in node outputs
How teams detect issues like this
Detection approaches commonly include:
- Static analysis for credential-selection logic that validates only the first item in a collection
- Code review checks for expression-driven authentication state and inconsistent per-credential policy enforcement
- Tests covering multiple credential types, mixed selector states, and domain-restricted credentials
- Runtime monitoring for credential-bearing requests sent to destinations outside approved domains
- Policy enforcement that blocks workflows combining sensitive credentials with unapproved outbound endpoints
Automated security review tools may help identify missing authorization checks and unsafe credential propagation paths.

