CVE-2026-65595: n8n before 2.29.8 and 2.30.1 Privilege Escalation via Token Exchange
Impact
JWTs issued through the Token Exchange module were assigned all Public API key scopes, regardless of the acting user's actual role. A low-privileged user who could obtain a valid external JWT trusted by a configured issuer could therefore use the resulting access token to invoke administrator-only Public API operations, such as role escalation, user creation, and user deletion.
The issue only affects instances where the Token Exchange feature and the Public API are enabled (N8NTOKENEXCHANGEENABLED=true, N8NENVFEATTOKENEXCHANGE=true) and the attacker can obtain an external JWT accepted by a configured trusted key. Role escalation additionally requires an Advanced Permissions license; Community Package installation additionally requires N8NCOMMUNITYPACKAGESENABLED=true and N8NUNVERIFIEDPACKAGESENABLED=true.
Patches
The issue has been fixed in n8n version 2.30.1 and 2.29.8. Users should upgrade to this version or later to remediate the vulnerability.
Workarounds
If upgrading is not immediately possible, administrators should consider the following temporary mitigations: - Disable the Token Exchange feature by setting N8NTOKENEXCHANGEENABLED=false or N8NENVFEATTOKENEXCHANGE=false. - If Token Exchange cannot be disabled, restrict Public API access at the network level to trusted clients only. - Disable unverified Community Package installation by setting N8NUNVERIFIEDPACKAGESENABLED=false to eliminate the code execution path.
These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.
Other sources
n8n before 2.30.1 and 2.29.8 assigns all Public API key scopes to JWTs issued through the Token Exchange module regardless of the acting user's role. On instances where the Token Exchange feature and Public API are enabled, a low-privileged user who can obtain a valid external JWT trusted by a configured issuer can use the resulting access token to invoke administrator-only Public API operations such as role escalation, user creation, and user deletion (role escalation requires an Advanced Permissions license), and, when unverified Community Package installation is enabled, achieve remote code execution.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/n8nto a version that resolves this vulnerability.Fixed in 2.29.8 - Upgrade
Upgrade
npm/n8nto a version that resolves this vulnerability.Fixed in 2.30.1 - Upgrade
Upgrade
n8nto a version that resolves this vulnerability.Fixed in 2.29.8 - Upgrade
Upgrade
n8nto a version that resolves this vulnerability.Fixed in 2.30.1 - Configuration
Disable the Token Exchange feature by setting N8N_TOKEN_EXCHANGE_ENABLED=false (or use N8N_ENV_FEAT_TOKEN_EXCHANGE=false, if that is the setting in use).
n8n N8N_TOKEN_EXCHANGE_ENABLED = false - Configuration
Disable unverified Community Package installation by setting N8N_UNVERIFIED_PACKAGES_ENABLED=false to eliminate the code execution path.
n8n N8N_UNVERIFIED_PACKAGES_ENABLED = false - Compensating control
If Token Exchange cannot be disabled, restrict Public API access at the network level to trusted clients only.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-65595?
CVE-2026-65595 has a high severity rating of 8.9 according to CVSS.
How do I fix CVE-2026-65595?
To fix CVE-2026-65595, you should upgrade n8n to version 2.30.1 or later.
What type of vulnerability is CVE-2026-65595?
CVE-2026-65595 is a privilege escalation vulnerability affecting n8n.
Who is affected by CVE-2026-65595?
CVE-2026-65595 affects users of n8n versions prior to 2.30.1.
What is the impact of CVE-2026-65595?
CVE-2026-65595 allows low-privileged users to obtain unauthorized administrative access via token exchange.