Summary
n8n's Dynamic Credentials endpoints failed to enforce per-resource ownership and scope checks, allowing any authenticated user to interact with credentials and workflows they did not own.
Under these conditions, an attacker can enumerate private credential metadata, hijack OAuth tokens to run workflows under their own identity, or revoke tokens to disrupt automation, making any shared instance at risk.
Affected context
This vulnerability occurs in n8n environments where the Enterprise Dynamic Credentials feature is enabled and multiple users share the same instance.
The affected endpoints accept any authenticated n8n session, without verifying whether the caller has ownership or proper access to the target workflow or credential.
The risk is highest in multi-tenant or team deployments where users rely on shared infrastructure but expect strict isolation of their private workflows and stored OAuth credentials.
Exploit preconditions
- Attack surface: n8n EE API endpoints backing the Dynamic Credentials feature.
- Required access: Any valid authenticated n8n user account on the instance; no project membership or credential sharing relationship is required.
- Trigger point: Requests to the vulnerable endpoints that enumerate credential references or initiate / revoke OAuth flows for credentials linked to private workflows.
- Why exploitation is possible: The endpoints perform authentication but not fine-grained authorization, omitting ownership and scope checks on credentials and workflows, so the system incorrectly treats any logged-in user as allowed to act on those resources.
Why this happens
The underlying bug is a broken access control design: authentication was enforced, but authorization was not aligned with resource ownership.
Endpoints responsible for managing Dynamic Credentials trusted any authenticated session without verifying whether the caller actually had permission to access the associated workflow or credential.
This maps to CWE-284: Improper Access Control and CWE-200: Exposure of Sensitive Information, because credential metadata and control over OAuth tokens were exposed beyond intended scopes.
At an abstract level, the system failed to associate operations on credentials with a clear access policy tied to projects, sharing relationships, or user roles, leaving sensitive integration state broadly actionable.
Potential impact
- Attackers can enumerate identifiers, names, and types of credentials referenced by any private workflow.
- Attackers can hijack OAuth credentials so that affected workflows execute under accounts they control.
- Sensitive data processed by workflows may be exfiltrated to attacker-controlled external services.
- Revoked tokens can cause workflow failures, breaking automation and integrations.
- Persistent takeover of integrations may occur until credentials are reconfigured or rotated.
General mitigation guidance
Effective mitigation focuses on enforcing strict, resource-level authorization and minimizing implicit trust in authenticated sessions.
Recommended design patterns include:
- Apply ownership and scope checks on every endpoint that interacts with credentials, tokens, and workflows, ensuring callers have a legitimate relationship (e.g., project membership or explicit sharing).
- Treat credential metadata and token management APIs as highly sensitive, restricting them to least-privilege roles and isolating them from generic authenticated access.
- Model credentials as separate, access-controlled resources with explicit permissions, rather than inferring access from general user authentication.
- Reduce trust in shared instances by segmenting tenants or projects and avoiding cross-tenant visibility for internal identifiers or integration details.
- Implement secure-by-default behavior where new endpoints inherit conservative access policies and deny operations when ownership cannot be definitively established.
How teams detect issues like this
Detection typically involves both code-level and operational approaches:
- Use static analysis or manual code review to flag endpoints that perform authentication but lack authorization checks tied to specific resources or scopes.
- Review controller and service methods that handle credential or workflow references to ensure they consistently enforce project membership, sharing rules, and role-based access.
- Establish API security policies requiring explicit authorization decisions for any operation involving credentials, tokens, or external integrations, and verify compliance during pull-request review.
- Monitor logs for unusual patterns, such as non-owner users invoking credential-related endpoints or initiating OAuth flows for resources they do not typically use.
- Employ application security testing tools that exercise authenticated endpoints with varying identities to validate that access is properly constrained.

