n8n Token Exchange gives admin API access to low-privilege users
What this means
A low-privileged user who obtains a valid external token can run administrator-only operations in n8n's API: create or delete users, change roles, and potentially execute unverified code packages. An attacker could take over accounts, escalate their own privileges, or disable security controls. This affects only instances where Token Exchange and Public API are both enabled.
SecurityElites Manager Brief: the decision in one minute
n8n's Token Exchange feature grants full administrator API permissions to any user who can obtain a valid external token, regardless of their actual role. If your n8n instance has both Token Exchange and Public API enabled, any low-privileged user or external attacker who gets a valid token can take over accounts and change system settings.
| SecurityElites Fix-First Score | 43 of 100 Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity. |
|---|---|
| SecurityElites fix window | Within 30 days High severity. This is our suggestion from common practice; your own policy comes first. |
| Who should own the fix | Platform or infrastructure team responsible for n8n deployment and configuration. |
| Likely effort | About 15 minutes per n8n instance: review which versions are deployed, upgrade to the fixed version, and restart. Applying workarounds while awaiting upgrade takes 5 minutes but does not fully fix the problem. |
Questions to ask your team or supplier
- Do we have Token Exchange enabled on any n8n instance? If yes, is it in production, and which external JWT issuers are configured as trusted?
- If Token Exchange is enabled, have we reviewed audit and access logs since the feature was enabled or last token was issued, and do we see any suspicious administrative actions?
- What is our deployment timeline for upgrading all n8n instances to 2.30.1 or 2.29.8, and do we need to apply workarounds in the meantime?
Message you can forward to the owning team
Security notice: n8n Token Exchange gives admin API access to low-privilege users (CVE-2026-65595)
Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to n8n 2.30.1 or later.
What we need from you: confirm whether we run this software, who owns it, and the date it will be fixed.
Full guide: https://securityelites.com/ai-vulnerabilities/cve-2026-65595-n8n-token-exchange-gives-admin-api-access-to-low-privilege/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01740What is at stake in your AI setup
- Keys for external JWT issuers trusted by Token Exchange: an attacker could forge tokens or extract the keys themselves
- API credentials and secrets stored in n8n: an attacker with admin API access can read all credentials used in workflows
- Workflow definitions and prompt templates: an attacker can read, modify, or delete workflows and extract any embedded logic or data
Who is exposed
- n8n instances with both N8N_TOKEN_EXCHANGE_ENABLED=true and Public API enabled, most at risk
- instances where unverified Community Packages are also enabled (N8N_UNVERIFIED_PACKAGES_ENABLED=true)
- teams using Token Exchange to integrate external systems or services
- instances with Advanced Permissions license where role escalation is possible
Upgrades you need
| Software | Affected versions | Move to |
|---|---|---|
| n8n npm | 2.30.0 up to, but not including, 2.30.1; Every version before 2.29.8 | 2.30.1 or later |
Each maintained branch has its own fixed version. Stay on your branch if you cannot jump to the newest: n8n 2.29.8, 2.30.1.
Am I affected?
Enter the version you run. Nothing you type is stored.
SecurityElites Developer Brief: the technical picture
| Is it being attacked | No known attacks and no public attack code when CISA last reviewed it |
|---|---|
| Where the attacker must be | Anywhere that can reach it over a network, including the internet if it is exposed |
| Account needed | An ordinary user account |
| Does a person have to do something | No. It works without anyone clicking or opening anything |
| How hard it is to do | Easy. It works reliably once the attacker can reach it |
| Risk of: data being read | High |
| Risk of: data or settings being changed | High |
| Risk of: the service being taken down | High |
| Can attackers automate it at scale | No, according to CISA. Each target needs manual work |
| How much control an attacker gains | Total control of the affected software, according to CISA |
Read from the official severity rating: CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:L/SA:L
Kind of coding mistake
- CWE-269: privileges are handled incorrectly
If you cannot upgrade today
- Disable Token Exchange by setting N8N_TOKEN_EXCHANGE_ENABLED=false and N8N_ENV_FEAT_TOKEN_EXCHANGE=false, restart n8n, and restrict Public API access at the network level to trusted clients only. These steps reduce risk but do not fully fix
Signs it may already have been used against you
- n8n audit logs: look for user creation, deletion, or role changes performed by accounts with low privilege levels, or by Token Exchange requests
- API access logs: search for POST or PUT requests to /api/rest/users, /api/rest/roles, or administrative endpoints from unusual IP addresses or low-privilege API tokens
- Workflow execution logs: check for workflows or packages that were executed by low-privilege accounts or external tokens
- Security events: review any alerts for privilege escalation, unauthorized administrator actions, or credential exfiltration during the period before the upgrade
Log searches to start from
Administrative API calls from low-privilege Token Exchange requests (adapt field names to your logs)Elastic
source:n8n_audit AND (action:"user_create" OR action:"user_delete" OR action:"role_change" OR path:/api/rest/users OR path:/api/rest/roles) AND auth_type:"token_exchange" AND user_role:("viewer" OR "member" OR NOT "admin")Administrative API access from unexpected low-privilege sources (adapt field names to your logs)Splunk
source=n8n_api_access (endpoint=/api/rest/users OR endpoint=/api/rest/roles OR endpoint=/api/rest/admin*) user_role!=admin auth_method=token_exchange | stats count by user, source_ip, timestampWritten with AI as a starting point. Review them and change the index and field names to match your own logs before you rely on the result.
SecurityElites Fix Guide: step by step
- Find all n8n instances in your environmentList every server, container, or service running n8n. Note the hostname or container ID and which environment (dev, staging, production) each one is in.
- Check the current version of each instanceConnect to each n8n instance and check the version number. You can find this in the UI under Settings > About or by running `npm list n8n` in the n8n installation directory.
- Identify which instances have Token Exchange enabledFor each instance running version 2.30.0 or earlier versions before 2.29.8, check the environment variables: look for N8N_TOKEN_EXCHANGE_ENABLED=true or N8N_ENV_FEAT_TOKEN_EXCHANGE=true in the deployment configuration, .env file, or container environment variables.
- Back up configuration and dataBefore upgrading, back up the n8n database, workflows, and any credentials or secrets. Store the backup in a secure location separate from the production system.
- Upgrade to the fixed versionFor instances running 2.30.0, upgrade to 2.30.1 or later. For instances running any version before 2.29.8, upgrade to 2.29.8 or later. Use npm, your package manager, or your deployment system to perform the upgrade and restart the service.
- Verify the upgrade was successfulAfter restart, check the version number again in the n8n UI or via npm. Confirm it matches 2.30.1, 2.29.8, or a later version. Verify that workflows load normally and the Public API responds.
- Review access logs for prior exploitationCheck n8n logs and audit records from before the upgrade date for signs of unauthorized API calls or permission changes. Look for Public API requests from low-privilege users, user creation or deletion events, or role changes that do not match your team's actions.
- Review and rotate external tokensIf you use Token Exchange with external JWT issuers, review the list of trusted keys and issuers in your n8n configuration. If any external JWT has been compromised or used by an unauthorized person, disable that issuer and rotate or revoke the token.
How to confirm it is fixed: Confirm the installed version is 2.30.1, 2.29.8, or later by checking the version in the n8n UI or running `npm list n8n` in the installation directory.
SecurityElites Quick Fixes: copy and paste
Upgrade n8n with npmupgrade
npm install n8n@2.30.1
npm ls n8nCheck n8n version (Linux/macOS)for this issue
cd /path/to/n8n && npm list n8nCheck Token Exchange environment variablesfor this issue
grep -E 'N8N_TOKEN_EXCHANGE_ENABLED|N8N_ENV_FEAT_TOKEN_EXCHANGE' /path/to/.envRequire sign-in with nginx in front of the servicegeneral hardening
location / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
proxy_pass http://127.0.0.1:8080;
}Test in a non-production environment first. General hardening examples use placeholder names and ports; change them to match your setup.
Let your AI coding assistant do the upgrade
Paste this into the coding assistant you already use, inside the project. It checks first and asks before it changes anything.
Instruction for your coding assistant
You are helping me fix a security vulnerability (CVE-2026-65595) in this project.\n\n1. Search the whole repository, including lock files, container files and CI configuration, for these packages and list every place they are pinned or installed:\n - n8n (npm): must be 2.30.1 or later
2. Tell me which version we use now and whether it is affected. Stop and ask me before changing anything.
3. After I agree, raise each one to the safe version, update the lock files, and keep every other dependency as it is.
4. Run the tests and tell me what failed.
5. Give me a short summary of the files you changed that I can put in the pull request.SecurityElites Incident Drill: could your team handle this?
Four questions to ask in your next team meeting. If any has no clear answer, that is the gap to close.
Ticket for your backlog
Paste into Jira, GitHub Issues or any tracker that reads Markdown.
Ready-made ticket
## n8n Token Exchange gives admin API access to low-privilege users (CVE-2026-65595)
**Severity:** High | **SE Fix-First Score:** 43/100 | **Fix window:** Within 30 days
**Record:** SE-AIV-01740 https://securityelites.com/ai-vulnerabilities/cve-2026-65595-n8n-token-exchange-gives-admin-api-access-to-low-privilege/
### Why this matters
A low-privileged user who obtains a valid external token can run administrator-only operations in n8n's API: create or delete users, change roles, and potentially execute unverified code packages. An attacker could take over accounts, escalate their own privileges, or disable security controls. This affects only instances where Token Exchange and Public API are both enabled.
### What to do
1. Find all n8n instances in your environment
2. Check the current version of each instance
3. Identify which instances have Token Exchange enabled
4. Back up configuration and data
5. Upgrade to the fixed version
6. Verify the upgrade was successful
7. Review access logs for prior exploitation
8. Review and rotate external tokens
Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-65595-n8n-token-exchange-gives-admin-api-access-to-low-privilege/
### Done when
- [ ] n8n is at 2.30.1 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Confirm the installed version is 2.30.1, 2.29.8, or later by checking the version in the n8n UI or running `npm list n8n` in the installation directory.
- [ ] Logs were checked for signs of earlier use
SecurityElites Fix Tracker
Record who owns this fix, the date it is due and when it is done, and see everything still open in one list. Free with a SecurityElites account.
Related vulnerabilities
In the same software
- n8n legacy expression engine allows code execution via JSON.stringify override High · CVE-2026-86083
- n8n OpenAI node bypasses domain restrictions on model search High · CVE-2026-86082
- n8n Git node can freeze the instance with a crafted path High · CVE-2026-86081
- n8n OAuth registration accepts unlimited field sizes, filling the database High · CVE-2026-86075
- n8n expression compiler can run arbitrary code through class field names High · CVE-2026-86076
- n8n Edit Fields node can crash the whole instance with a bad field name High · CVE-2026-72749
The same kind of mistake in other AI tools
- BaaRai ARTEX admin account can be claimed without authentication on first run Critical · CVE-2026-140422
- BaaRai ARTEX admin login can be guessed without limits or lockouts Critical · CVE-2026-140365
- NLTK dependency parser crashes on long sentences High · CVE-2026-129222
- NLTK regex compilation denial of service via many groups High · CVE-2026-129229
- Model Context Protocol SDK tasks can be read by other clients sharing the store High · CVE-2026-111767
Change history
- 22 Jul 2026: Made public
- 2 Dec 2026: Published
Official record
## ImpactJWTs 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 (N8N_TOKEN_EXCHANGE_ENABLED=true, N8N_ENV_FEAT_TOKEN_EXCHANGE=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 `N8N_COMMUNITY_PACKAGES_ENABLED=true` and `N8N_UNVERIFIED_PACKAGES_ENABLED=true`.## PatchesThe 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.## WorkaroundsIf upgrading is not immediately possible, administrators should consider the following temporary mitigations: - Disable the Token Exchange feature by setting `N8N_TOKEN_EXCHANGE_ENABLED=false` or `N8N_ENV_FEAT_TOKEN_EXCHANGE=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 `N8N_UNVERIFIED_PACKAGES_ENABLED=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.
Weakness type: CWE-269
Use this record in your own tools
Get this record as JSON
curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2026-65595For scanners and pipelines: OSV format · CycloneDX format · API guide · Email alerts · Fix tracker
The plain-language sections were written with AI from the official record, and the upgrade versions come directly from the official data. Last updated 2 Dec 2026. Read the vendor advisory before changing a production system.