Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-65595

CVE-2026-65595: n8n Authentication Bypass Vulnerability

CVE-2026-65595 is an authentication bypass vulnerability in n8n that allows low-privileged users to escalate privileges and execute unauthorized admin operations. This article covers technical details, affected versions, and mitigation.

Published:

CVE-2026-65595 Overview

CVE-2026-65595 is a privilege escalation vulnerability in n8n, an open-source workflow automation platform. Versions of n8n before 2.30.1 and 2.29.8 assign all Public API key scopes to JSON Web Tokens (JWTs) issued through the Token Exchange module, regardless of the acting user's role. A low-privileged user who obtains a valid external JWT trusted by a configured issuer can invoke administrator-only Public API operations. The flaw is categorized as improper privilege management [CWE-269].

Critical Impact

Attackers with low-privileged accounts can escalate to administrator, create or delete users, and achieve remote code execution when unverified Community Package installation is enabled.

Affected Products

  • n8n versions before 2.30.1
  • n8n versions before 2.29.8
  • Instances with the Token Exchange module and Public API enabled

Discovery Timeline

  • 2026-07-22 - CVE-2026-65595 published to NVD
  • 2026-07-22 - Last updated in NVD database

Technical Details for CVE-2026-65595

Vulnerability Analysis

The vulnerability resides in n8n's Token Exchange module, which mints internal access tokens after validating externally-issued JWTs from a trusted issuer. The exchange logic grants the resulting access token the full set of Public API scopes rather than scopes bounded by the requesting user's role. This scope inflation allows any authenticated user with a valid external JWT to call administrator-only Public API endpoints.

Once armed with an over-privileged access token, an attacker can invoke user creation and deletion routines directly against the Public API. Role escalation is possible on instances that carry an Advanced Permissions license. When the instance also permits unverified Community Package installation, the attacker can install a malicious package and gain remote code execution on the n8n host.

Root Cause

The root cause is broken authorization inside the Token Exchange flow. n8n did not propagate the acting user's role or scope constraints into the JWT issuance step, effectively treating every exchanged token as fully-privileged. This is a classic instance of improper privilege management [CWE-269] where trust in an external identity assertion is conflated with authorization to act as any role.

Attack Vector

Exploitation requires network access to the n8n Public API and a low-privileged account able to obtain a JWT from a configured trusted issuer. The attacker submits that external JWT to the Token Exchange endpoint and receives an internal access token carrying every Public API scope. The attacker then calls administrator-only Public API operations such as POST /users, DELETE /users/{id}, and role-change endpoints. On instances with unverified Community Package installation enabled, the attacker installs an attacker-controlled Node.js package to achieve remote code execution.

No verified exploit code has been published. See the GitHub Security Advisory and VulnCheck Advisory for vendor details.

Detection Methods for CVE-2026-65595

Indicators of Compromise

  • Public API calls to /users creation, deletion, or role-modification endpoints originating from non-administrator accounts.
  • Token Exchange requests followed within seconds by privileged Public API activity from the same client.
  • Installation events for Community Packages from accounts that historically only executed workflows.
  • New administrator accounts or unexpected role promotions absent a corresponding change ticket.

Detection Strategies

  • Correlate Token Exchange issuance logs with subsequent Public API scope usage and flag tokens invoking scopes above the requesting user's role.
  • Alert on any invocation of administrator Public API routes when the source account is not a member of the administrator group.
  • Baseline Community Package installations and alert on packages installed outside a maintenance window or by non-admin identities.

Monitoring Recommendations

  • Enable n8n audit logging and forward events to a centralized log platform for retention and query.
  • Monitor outbound network connections from the n8n runtime host for unexpected destinations indicative of post-RCE command-and-control.
  • Track changes to the users table and role assignments in the n8n database and alert on out-of-band modifications.

How to Mitigate CVE-2026-65595

Immediate Actions Required

  • Upgrade n8n to version 2.30.1 or 2.29.8 or later immediately.
  • Disable the Token Exchange module until the upgrade is applied if it is not required for production workflows.
  • Disable unverified Community Package installation to remove the remote code execution path.
  • Review recent user creation, deletion, and role change events for unauthorized activity.

Patch Information

The n8n maintainers fixed CVE-2026-65595 in versions 2.30.1 and 2.29.8. The patch scopes JWTs issued by the Token Exchange module to the acting user's role rather than granting the full set of Public API scopes. Refer to the GitHub Security Advisory GHSA-777w-rpr6-c52h for release details.

Workarounds

  • Disable the Public API on instances that do not require programmatic administrative access.
  • Restrict trusted JWT issuers configured for Token Exchange to identity providers whose tokens cannot be obtained by low-privileged users.
  • Set N8N_COMMUNITY_PACKAGES_ENABLED=false or restrict Community Package installation to verified sources only.
  • Place the n8n Public API behind a reverse proxy that enforces role-based access controls on administrator endpoints.
bash
# Configuration example - disable community packages and restrict API exposure
export N8N_COMMUNITY_PACKAGES_ENABLED=false
export N8N_PUBLIC_API_DISABLED=true
export N8N_TOKEN_EXCHANGE_ENABLED=false

# Upgrade via npm
npm install -g n8n@2.30.1

# Or upgrade Docker deployment
docker pull n8nio/n8n:2.30.1
docker stop n8n && docker rm n8n
docker run -d --name n8n -p 5678:5678 n8nio/n8n:2.30.1

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.