/

CVE-2026-45732

Severity:

HIGH RISK

(8.1)

Authorization Bypass (CWE-639) in n8n OAuth Reconnect

CVE-2026-45732

Analyzed

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-639

Impact:

Account and Integration Takeover

Severity:

HIGH RISK

(8.1)

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

An authorization flaw in n8n's OAuth reconnect endpoints allowed users with only read access to shared credentials to refresh and overwrite OAuth token material.

When exploited, workflows using the affected credential would execute under the attacker-controlled OAuth identity, enabling data exfiltration and takeover of shared integrations.

Affected context

This vulnerability occurs in n8n instances where OAuth1 or OAuth2 credentials are shared among users and workflows, and where the reconnect endpoints authorize using a read-only permission.

It is relevant in environments that rely on shared OAuth credentials to connect to external services, particularly when multiple users have credential:read access but only a subset should be allowed to modify or refresh those credentials.

Exploit preconditions

  • Attack surface: n8n API/UI endpoints responsible for OAuth1/OAuth2 credential reconnect.
  • Required access: Authenticated user with credential:read permission on a shared OAuth credential, but without credential:update rights.
  • Trigger point: Initiation of an OAuth reconnect flow via the affected endpoints, resulting in new token material being stored.
  • Why exploitation is possible: The reconnect endpoints enforce authorization using the read permission instead of update, allowing users with read-only access to alter credential state and overwrite stored OAuth tokens.

Why this happens

The underlying issue is an authorization misconfiguration that maps to CWE-639: Insecure Direct Object Reference (IDOR) in the context of access control.

The OAuth reconnect endpoints relied on a permission intended only for viewing credential data (credential:read) to guard an operation that changes credential state (refreshing and storing new tokens).

This mismatch between the sensitivity of the operation and the enforced permission boundary allowed users who should only observe credential details to perform state-changing actions, effectively bypassing intended privilege separation on shared OAuth integrations.

Potential impact

  • Workflows may execute under an attacker-controlled OAuth identity instead of the original owner.
  • Data could be exfiltrated from connected external services to attacker-controlled accounts or endpoints.
  • Shared integrations can be persistently hijacked, disrupting legitimate workflow behavior.
  • Audit trails and activity logs may misleadingly associate actions with the original shared credential rather than the true controlling account.

General mitigation guidance

Effective mitigation focuses on tightening authorization boundaries around credential operations and treating token refresh flows as privileged actions.

Common patterns include:

  • Enforcing distinct permissions for reading versus updating credential material, ensuring that reconnect and token mutation operations require explicit update-level rights.
  • Designing credential management APIs so that any operation capable of changing authentication context (such as token refresh, rotation, or reconnect) is guarded by the same or higher privilege as initial credential creation.
  • Applying least-privilege principles to shared credential access, granting read-only visibility without implicit rights to modify or reconnect.
  • Introducing explicit ownership or stewardship models for shared credentials, so only designated maintainers can trigger reconnect or token replacement flows.

How teams detect issues like this

Detection typically involves reviewing how authorization is enforced on credential-related endpoints and identifying operations that can change token material or authentication context.

Useful approaches include:

  • Static analysis or architectural review to ensure that state-changing credential operations always check for update or admin-level permissions rather than relying on read-level access.
  • Code review practices that flag any API route handling reconnect, rotate, or refresh actions and verify that authorization checks match the sensitivity of the operation.
  • Runtime monitoring and audit logging for unusual reconnect activity on shared credentials, such as reconnects initiated by users who are not designated maintainers.
  • Policy enforcement within CI/CD pipelines that require security review for changes to credential management logic and access-control rules, optionally assisted by automated authorization analysis tools.

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-6h4j-wcr9-2vg7

Frequently asked

questions

No. Exploitation requires an authenticated n8n user account with read-level access to a shared OAuth credential; anonymous access is not sufficient.

No. A user with only credential:read permission can exploit the reconnect endpoints due to the misapplied authorization check and overwrite the stored token material.

The safest fix is to ensure that any operation capable of altering credential state—such as token refresh, reconnect, or rotation—requires a dedicated update-level or admin permission distinct from read access, and that authorization checks are consistently aligned with the sensitivity of the operation.

Preventive strategies include designing clear permission models that separate read from write actions, performing regular access-control reviews for credential and integration-related APIs, and incorporating automated checks or approval gates for changes touching authorization logic or sensitive endpoints.

Find out what's already
exploitable in your codebase.