CVE-2026-65016 Overview
CVE-2026-65016 is a privilege escalation vulnerability in n8n, the workflow automation platform. The flaw resides in the Enterprise SSO instance-role provisioning path, which maps an identity provider (IdP) role claim to an n8n global role without excluding the global:owner value. A single sign-on (SSO) authenticated user whose instance-role claim resolves to global:owner is provisioned as instance owner. This grants full administrative control over workflows, credentials, users, and instance configuration. The issue affects n8n versions before 1.123.64, 2.29.8, and 2.30.1. It is classified as [CWE-639] Authorization Bypass Through User-Controlled Key.
Critical Impact
An SSO-authenticated user who controls the IdP-asserted instance-role claim can obtain the global:owner role, gaining complete administrative control over the n8n instance, including all workflows, stored credentials, and user management.
Affected Products
- n8n versions before 1.123.64
- n8n versions before 2.29.8
- n8n versions before 2.30.1
Discovery Timeline
- 2026-07-22 - CVE CVE-2026-65016 published to NVD
- 2026-07-22 - Last updated in NVD database
Technical Details for CVE-2026-65016
Vulnerability Analysis
n8n supports Enterprise SSO with optional instance-role provisioning controlled by the N8N_SSO_SCOPES_PROVISION_INSTANCE_ROLE environment variable. When enabled, the provisioning logic maps an IdP-asserted role claim to an n8n global role. The token-exchange identity path already rejects the global:owner value, but the instance-role provisioning path does not enforce the same restriction. This inconsistency lets a user whose IdP claim resolves to global:owner be assigned instance owner privileges. The owner role provides unrestricted administrative access to workflows, credentials, users, and instance configuration.
Root Cause
The root cause is missing validation in the SSO instance-role provisioning code path. The provisioning function trusts the role claim value without filtering out the reserved global:owner role. This is an authorization bypass through user-controlled key [CWE-639], where the security decision depends on a value influenced by the caller. The token-exchange path implements the correct denylist, exposing the inconsistency as a design defect rather than a missing check across the entire system.
Attack Vector
Exploitation requires three preconditions. First, the target instance must have Enterprise SSO configured. Second, instance-role provisioning must be enabled via N8N_SSO_SCOPES_PROVISION_INSTANCE_ROLE, which is disabled by default. Third, the attacker must control the instance-role claim value issued by the IdP for their account. When these conditions are met, the attacker authenticates through the configured IdP with an instance-role claim set to global:owner. The provisioning path assigns the owner role, and the attacker gains persistent administrative access to the n8n tenant.
No verified proof-of-concept code has been published. See the GitHub Security Advisory for vendor technical details.
Detection Methods for CVE-2026-65016
Indicators of Compromise
- Unexpected users holding the global:owner role in the n8n users table, especially accounts recently provisioned via SSO.
- Audit log entries showing SSO-driven role assignment to global:owner outside of planned administrative onboarding.
- New or modified workflows, credentials, or instance settings created shortly after an SSO login by a non-administrative user.
Detection Strategies
- Query the n8n user database for accounts with global:owner and correlate provisioning timestamps against SSO authentication events.
- Inspect IdP logs for token issuance where the instance-role or scope claim contains global:owner for non-administrative principals.
- Review changes to n8n credentials and workflow ownership after enabling N8N_SSO_SCOPES_PROVISION_INSTANCE_ROLE.
Monitoring Recommendations
- Enable and forward n8n audit logs and IdP authentication logs to a centralized SIEM for correlation.
- Alert on any assignment of the global:owner role that originates from SSO provisioning rather than manual administrative action.
- Monitor egress from the n8n host for anomalous connections that could indicate credential exfiltration by a compromised owner account.
How to Mitigate CVE-2026-65016
Immediate Actions Required
- Upgrade n8n to version 1.123.64, 2.29.8, or 2.30.1 or later, depending on the release train in use.
- If upgrading is not immediately possible, disable instance-role provisioning by unsetting N8N_SSO_SCOPES_PROVISION_INSTANCE_ROLE.
- Audit all existing global:owner accounts and revoke any that were created through SSO provisioning without authorization.
- Rotate credentials stored in n8n if unauthorized owner accounts are found, as those secrets must be considered exposed.
Patch Information
The n8n maintainers released fixes in versions 1.123.64, 2.29.8, and 2.30.1. The patch adds validation to the SSO instance-role provisioning path that rejects assignment of the global:owner role, aligning it with the existing token-exchange identity path behavior. Full details are available in the GitHub Security Advisory GHSA-35q8-9mj6-wjmf and the VulnCheck advisory.
Workarounds
- Keep N8N_SSO_SCOPES_PROVISION_INSTANCE_ROLE disabled, which is the default configuration and blocks the vulnerable code path.
- Restrict the IdP so it cannot issue an instance-role claim value of global:owner to end users, for example by hardcoding allowed claim values in the IdP mapping policy.
- Limit SSO group and role claim sources to attributes that only administrators can modify, preventing self-service claim manipulation.
# Configuration example: disable SSO instance-role provisioning
unset N8N_SSO_SCOPES_PROVISION_INSTANCE_ROLE
# or explicitly set it to false in the environment
export N8N_SSO_SCOPES_PROVISION_INSTANCE_ROLE=false
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

