/

CVE-2026-42226

Severity:

HIGH RISK

(7.5)

Missing Authorization in n8n Dynamic Credential Resolution

CVE-2026-42226

Analyzed

Vulnerability type

Category:

Missing Authorization

CWE:

CWE-862

Impact:

Credential Exfiltration and Unauthorized Use of Secrets

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

n8n's dynamic-node-parameters endpoints failed to verify whether an authenticated user was authorized to use a referenced credential, allowing foreign credential IDs to be supplied and silently consumed.

In shared workflows, a user could trick the backend into decrypting another user's credential and using it against an attacker-controlled URL, effectively exfiltrating reusable API keys whenever credentials are resolved dynamically.

Affected context

The vulnerability appears when:

  • n8n is deployed with shared workflows involving multiple users or teams.
  • Dynamic-node-parameters endpoints are used to resolve node credentials at runtime.
  • The backend accepts a credential ID from the request body without verifying ownership or access rights.
  • Nodes rely on these endpoints to obtain decrypted credentials for outbound connections.

Under these conditions, an otherwise authenticated but under-privileged user may indirectly leverage credentials that were never meant for them.

Exploit preconditions

  • Attack surface: Authenticated HTTP API for dynamic-node-parameters endpoints in the n8n backend.
  • Required access:
  • Valid authenticated n8n account.
  • Access to at least one shared workflow where dynamic credential resolution is possible.
  • Trigger point:
  • Sending a request to the dynamic-node-parameters endpoint that includes a credential ID belonging to another user.
  • Configuring a node or helper path such that the attacker controls the destination URL for the outbound request.
  • Why exploitation is possible:
  • The backend trusted the credential ID supplied in the request body, decrypting and using the associated secret without verifying that the caller is authorized to access that credential.
  • The same execution path allowed the caller to control the remote endpoint, enabling capture of any authentication material sent in the request.

Why this happens

The core issue is a missing authorization check on a sensitive reference, aligning with CWE-862: Missing Authorization.

The dynamic-node-parameters endpoints treated the credential ID as a trusted reference, assuming that if a user could call the endpoint they were entitled to use any credential referenced in the payload.

There was no secondary check to ensure that:

  • The credential belonged to the calling user, or
  • The credential had been explicitly shared with them, or
  • The workflow's permissions allowed access to that specific secret.

This pattern reflects a common bug class where APIs validate authentication but skip per-resource authorization, especially for indirect references such as IDs in the request body, leading to privilege escalation and unauthorized secret use.

Potential impact

  • Attackers may exfiltrate reusable API keys and tokens belonging to other users.
  • Attackers could cause the backend to authenticate against attacker-controlled infrastructure, leaking headers or other sensitive request metadata.
  • Unauthorized actions may be performed against third-party services using stolen credentials.
  • Compromise of external integrations (e.g., SaaS APIs, data stores, messaging systems) tied to the exposed credentials.
  • Erosion of tenant isolation, where one user's secrets are effectively accessible to another within shared workflow environments.

General mitigation guidance

Mitigation focuses on enforcing strict per-credential authorization and reducing implicit trust in client-supplied identifiers:

  • Introduce server-side checks that verify the caller's ownership or explicit access rights before decrypting or using any credential.
  • Treat credential IDs, workflow IDs, and similar references as untrusted input that must be resolved through permission-aware queries (e.g., scoping by user, team, or tenant).
  • Centralize secret access logic so that all paths (including helper and dynamic endpoints) consistently enforce the same authorization rules.
  • Apply least-privilege principles in workflow sharing: share only the minimum necessary credentials and limit which workflows can use high-value secrets.
  • Separate "view" and "use" permissions for credentials so that being able to interact with a workflow does not automatically imply unrestricted secret usage.
  • Implement auditing and monitoring around credential access, so anomalous patterns of secret usage can be detected and investigated.

How teams detect issues like this

Detection can combine code-level analysis with runtime monitoring:

  • Static analysis / code review:
  • Look for endpoints that decrypt or access credentials based on IDs supplied by the client.
  • Verify that each such endpoint includes a clear authorization step that checks ownership or sharing relationships.
  • Flag helper or utility functions that bypass standard access control layers when dealing with secrets.
  • Security tests / policy enforcement:
  • Incorporate authorization-focused tests that attempt to use foreign credential IDs within authenticated sessions.
  • Add regression tests ensuring that credential queries are always scoped by user or tenant context.
  • Enforce architectural policies requiring that secret access goes through a single, hardened service or module.
  • Operational monitoring:
  • Log credential resolution events with caller identity, credential identifier, and target endpoint details.
  • Use alerting rules to detect unusual patterns, such as one user suddenly triggering many outbound connections using varied credentials.

Automated code review tools and application security testing platforms can help surface missing-authorization patterns before deployment.

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-r4v6-9fqc-w5jr

Frequently asked

questions

Yes, if the n8n instance is exposed over the network and accessible to users, an authenticated user can exploit the issue remotely by calling the dynamic-node-parameters endpoints. However, it does not allow anonymous exploitation; valid authentication is required.

The attacker needs a valid n8n account and access to a shared workflow that uses dynamic credential resolution. They do not need direct access to the victim's credentials; the flaw lies in the backend accepting arbitrary credential IDs from any authenticated caller.

Enforce strict, centralized authorization checks for every secret access path. The backend should derive allowed credentials from the authenticated user's context or workflow ownership, rather than trusting IDs from the request, and should refuse to decrypt or use any credential not explicitly permitted.

Design APIs under a "deny by default" model for resource access, especially for credentials and other high-value objects. Treat all client-supplied identifiers as untrusted, route all secret operations through a unified access-control layer, and include authorization-focused tests and reviews in the development lifecycle to catch missing checks early.

Find out what's already
exploitable in your codebase.