/

CVE-2026-126385

Severity:

HIGH RISK

(7.7)

Missing Authentication (CWE-306) in n8n OAuth2 Flow

CVE-2026-126385

Deferred

Vulnerability type

Category:

Missing Authentication and User-Binding Failure

CWE:

CWE-306

Impact:

Unauthorized use of a victim's OAuth2 identity and access to resources available through their provider account

Severity:

HIGH RISK

(7.7)

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-credential OAuth2 callback does not verify that the browser completing authorization belongs to the user who initiated the flow. A member with access to a resolvable OAuth2 credential may be able to obtain a victim's consent and have the resulting tokens stored under the member's identity, allowing their workflows to act with the victim's authorization.

Affected context

The issue affects n8n's dynamic-credential connect flow, specifically the OAuth2 credential callback. It may arise when the callback accepts authorization without confirming that the completing browser or session belongs to the user who started the flow.

The description identifies affected releases as n8n before 2.45.5, 2.46.x before 2.46.1, and 3.x before 3.0.1.

Exploit preconditions

  • Attack surface: The dynamic-credential OAuth2 authorization and callback flow
  • Required access: A member account with access to a resolvable OAuth2 credential
  • Victim action: The victim must open the provider authorization URL and consent; the described scenario involves a victim without an active n8n session
  • Trigger point: The provider redirects to the n8n OAuth2 callback
  • Why exploitation is possible: The callback does not adequately verify that the completing browser belongs to the user who initiated the flow

Why this happens

The OAuth2 callback fails to bind completion of an authorization transaction to the initiating user or browser context. This is a missing authentication or authorization check for a security-sensitive function, corresponding to CWE-306. As a result, authorization tokens can be associated with a different n8n identity than the one that initiated the flow.

Potential impact

  • A member's workflows may be able to act using the victim's provider-authorized identity
  • The victim's connected resources or data may be accessed or modified, depending on granted permissions
  • The victim's OAuth2 tokens may be retained under the member's identity and used by workflows
  • Activity performed with the connected account may be difficult to distinguish from legitimate victim-authorized use

General mitigation guidance

Defensive designs typically bind every OAuth2 authorization transaction to the initiating user, browser session, and credential context, then verify that binding at callback time. Use unpredictable, single-use transaction state and reject callbacks that lack a valid matching session or transaction.

Reduce reliance on externally supplied authorization URLs, provide clear confirmation of the account and credential being connected, and limit workflow and credential permissions to the minimum necessary. Secure-by-default flows should fail closed when the initiating identity cannot be verified.

How teams detect issues like this

Review OAuth2 callback code for checks that bind authorization state to the initiating user and session, and for paths that store tokens before verifying that binding. Static analysis and code review can flag callbacks that accept identity-sensitive results without authentication or transaction-state validation.

Monitor for authorization transactions where the initiating and completing identities differ, unexpected credential ownership changes, and unusual workflow activity using newly connected credentials. Policy checks can require session-bound, single-use OAuth2 state validation.

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-426f-xmcv-g8pg
vulncheck.comvulncheck.com/advisories/n8n-before-2.46.1-oauth-account-hijack-via-unauthenticated-credential-callback

Frequently asked

questions

The described scenario requires a member with access to a resolvable OAuth2 credential and a victim who opens the authorization URL and consents.

The described flow can affect a victim who consents without an active n8n session; the key issue is that the callback does not verify the completing browser belongs to the initiating user.

Bind the OAuth2 transaction to the initiating user and browser session, and verify that binding before accepting the callback or storing tokens.

Treat authorization callbacks as identity-sensitive operations: use single-use transaction state, enforce session and ownership checks, fail closed on mismatches, and limit the permissions granted to connected credentials.

Find out what's already
exploitable in your codebase.