CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-65595

CVE-2026-65595: Privilege Escalation and Remote Code Execution in n8n Token Exchange Module

Alon Barad
Alon Barad
Software Engineer

Jul 22, 2026·6 min read·7 visits

Executive Summary (TL;DR)

The n8n Token Exchange module blindly assigns full Public API scopes to exchanged tokens. This allows low-privileged users with a valid external JWT to escalate to administrative status and achieve remote code execution via community package installations.

CVE-2026-65595 is a high-severity privilege escalation vulnerability in the Token Exchange module of the n8n visual workflow automation platform. Due to an validation omission, the system unconditionally maps all Public API scopes to session tokens exchanged through trusted Identity Providers, entirely bypassing user-specific role checks.

Vulnerability Overview

The vulnerability designated as CVE-2026-65595 is a security flaw in the Token Exchange module of the n8n visual workflow automation platform. This module allows the application to exchange valid external JSON Web Tokens (JWTs) for internal session credentials. When the system processes these exchanges, it fails to evaluate the identity or authorization levels of the requesting entity, resulting in an improper privilege management condition.

The vulnerability is exploitable under specific deployment conditions. Both the Token Exchange feature and the Public API must be actively enabled. When these prerequisites are met, any authenticated user with permissions sufficient to obtain a valid trusted external JWT can escalate their privileges. This allows the executing security principal to bypass role-based access controls and perform high-privilege operations.

Ultimately, an attacker who successfully exploits this flaw achieves administrative capabilities within the n8n environment. If the configuration allows unverified Community Packages to be installed, the security boundary of the host platform can also be breached. This extends the impact of the flaw to potential remote code execution on the underlying server container.

Root Cause Analysis

The root cause of CVE-2026-65595 lies within the credential translation logic of the n8n Token Exchange module. When n8n receives an external JWT issued by a trusted Identity Provider (IdP), the application is designed to verify the integrity and origin of the credential. While the cryptographic signature of the token is successfully validated against the trust store, the flaw occurs during the authorization scope mapping phase.

During the construction of the internal n8n session token, the application code unconditionally binds all Public API key scopes to the session context. This mapping occurs without querying the database for the user's local role assignments. The system assumes that any token processed through the trusted exchange pathway should be granted absolute access to the Public API endpoints.

Because the system skips local role verification, there is no differentiation between low-privileged users and platform administrators during the exchange process. This omission directly leads to CWE-269 (Improper Privilege Management). The resulting internal session token is issued with maximum privileges, granting administrative power to any authenticated user regardless of their intended access limits.

Code Analysis

To understand the implementation flaw, it is necessary to examine the authorization flow during credential processing. The application logic fails to restrict the generated scopes based on the identity context extracted from the token claims. Below is a conceptual representation of the vulnerable scope assignment sequence.

// Vulnerable Scope Assignment Logic
async function processTokenExchange(externalJwt: JwtClaims): Promise<InternalToken> {
  // Confirm the identity provider signature is valid
  await crypto.verifySignature(externalJwt);
  
  // Vulnerability: Unconditionally maps administrative scopes to the session
  const assignedScopes = PublicApi.getAllScopes(); 
  
  return TokenService.sign({
    sub: externalJwt.subject,
    scopes: assignedScopes
  });
}

The corrected implementation implements strict validation against the local database context before generating the scopes. The application verifies the user's role and restricts the scopes to match the user's actual permissions.

// Patched Scope Assignment Logic
async function processTokenExchange(externalJwt: JwtClaims): Promise<InternalToken> {
  // Confirm the identity provider signature is valid
  await crypto.verifySignature(externalJwt);
  
  // Retrieve local user data to identify authorization boundaries
  const userRecord = await db.users.find({ id: externalJwt.subject });
  if (!userRecord) {
    throw new UnauthorizedError('Subject mapping failed');
  }
  
  // Restrict scopes based on the verified database role
  const assignedScopes = PublicApi.getScopesForRole(userRecord.role);
  
  return TokenService.sign({
    sub: externalJwt.subject,
    scopes: assignedScopes
  });
}

By querying the local database, the patched code ensures that privilege levels are strictly tied to actual user roles. This prevents arbitrary users from acquiring administrative scopes through the exchange module.

Exploitation Methodology

An attack sequence targeting CVE-2026-65595 requires the attacker to have low-privileged access to an identity provider trusted by the n8n platform. The attacker first requests and receives a standard, valid JWT from the external trusted identity provider. This token contains standard claims confirming the attacker's low-privileged identity.

The attacker then sends an HTTP POST request to the n8n token exchange endpoint, supplying the legitimate external JWT. The vulnerable Token Exchange module validates the token's cryptographic signature and issues an internal session token. Due to the lack of role verification, the returned session token is populated with full Public API administrative scopes.

Using this privileged internal token, the attacker targets administrative endpoints in the n8n Public API. The attacker can issue API calls to escalate their own account permissions, create a new administrator account, or delete existing workflows. If the deployment allows community packages, the attacker can leverage the Public API to install an unverified package containing arbitrary command execution payloads.

Impact Assessment

The impact of successful exploitation is critical, leading to a complete compromise of the n8n deployment. With full Public API access, an attacker can modify workflows, read database credentials stored in connection configurations, and export sensitive system data. This exposes the entire automation footprint of the target organization.

Furthermore, the downstream impacts include potential remote code execution on the server hosting the n8n instance. This scenario becomes viable if the instance allows unverified Community Packages to be installed. An attacker can deploy a custom node module containing arbitrary shell commands, which run with the system privileges of the n8n process.

The CVSS v4.0 score of 8.9 reflects the high severity of this vulnerability, particularly due to the low complexity of execution once initial access is established. Although the vulnerability requires specific configuration parameters, the potential for immediate transition from privilege escalation to host compromise underscores the risk to production environments.

Remediation and Hardening

Remediation of CVE-2026-65595 requires updating the n8n application to a patched version. Administrators should deploy n8n version 2.29.8 or 2.30.1 immediately depending on their release track. These versions enforce strict database checks to ensure that exchanged tokens only receive scopes corresponding to the user's configured role.

For environments where patching cannot be immediately scheduled, several temporary workarounds should be applied to eliminate the attack surface. Disabling the Token Exchange feature completely prevents incoming JWTs from being processed. If the Public API is not required for business operations, disabling it prevents the execution of administrative API calls using escalated tokens.

To prevent privilege escalation from transitioning into remote code execution, administrators must disable the installation of unverified Community Packages. This can be configured by setting the appropriate application environment variables. Restricting network access to administrative endpoints further reduces the risk of exploitation by unauthorized external actors.

Technical Appendix

CVSS Score
8.9/ 10
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

Affected Systems

n8n Workflow Automation Platform

Affected Versions Detail

Product
Affected Versions
Fixed Version
n8n
n8n
< 2.29.82.29.8
n8n
n8n
>= 2.30.0, < 2.30.12.30.1
AttributeDetail
CWE IDCWE-269 (Improper Privilege Management)
Attack VectorNetwork
CVSS v4.0 Score8.9
Vulnerability TypePrivilege Escalation and Remote Code Execution
Exploit StatusNone / Proof-of-Concept not publicly released
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1068Exploitation for Privilege Escalation
Privilege Escalation
CWE-269
Improper Privilege Management

The software does not properly assign or restrict privileges, or it fails to check that the user has the necessary privileges to perform a requested action.

Vulnerability Timeline

Patches published in version 2.29.8 and 2.30.1
2026-07-08
GitHub Security Advisory GHSA-777w-rpr6-c52h released
2026-07-08

References & Sources

  • [1]GitHub Security Advisory GHSA-777w-rpr6-c52h
  • [2]VulnCheck Advisory
  • [3]n8n v2.29.8 Release Page
  • [4]n8n v2.30.1 Release Page

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•GHSA-652Q-GVQ3-74QV
5.3

GHSA-652q-gvq3-74qv: SQL Injection in n8n Snowflake Node via Unparameterized Expression Interpolation

A SQL Injection vulnerability exists in the n8n Snowflake node's executeQuery operation. The vulnerability is caused by improper neutralization of expressions interpolated directly into database query strings. When raw Snowflake queries are built using untrusted external data without parameterization, an attacker can execute arbitrary SQL commands on the subsequent Snowflake database instance.

Alon Barad
Alon Barad
0 views•7 min read
•about 6 hours ago•CVE-2024-7708
7.5

CVE-2024-7708: Resource Exhaustion via HTTP Connection Buffer Leak in Eclipse Jetty

Eclipse Jetty is subject to an uncontrolled resource consumption vulnerability in its HTTP connection handling component. When processing certain HTTP request sequences, such as those invoking the Expect: 100-Continue handshake under specific network constraints, the server fails to return allocated buffers to its central pool. Over time, this leads to buffer pool exhaustion and a complete denial of service via memory starvation.

Amit Schendel
Amit Schendel
5 views•6 min read
•about 8 hours ago•CVE-2026-65597
8.2

CVE-2026-65597: DOM-based Cross-Site Scripting (XSS) in n8n HTML Preview

A critical DOM-based Cross-Site Scripting (XSS) vulnerability exists in n8n's workflow editor HTML preview component. By failing to include a sandbox attribute on the iframe used to display node execution output, n8n allowed rendered execution outputs to run arbitrary JavaScript within the same-origin context of the editor parent window. This vulnerability can be exploited by an attacker with low-privileged ('global:member') access to hijack an authenticated administrator's session and perform unauthorized API actions.

Alon Barad
Alon Barad
5 views•5 min read
•about 9 hours ago•CVE-2026-65592
8.4

CVE-2026-65592: Stored DOM-based Cross-Site Scripting via cachedResultUrl in n8n

A Stored DOM-based Cross-Site Scripting (XSS) vulnerability exists within the frontend Resource Locator component of n8n. The flaw stems from insecure usage of window.open() where the application evaluates the workflow-persisted parameter 'cachedResultUrl' without verifying its protocol scheme. Authenticated attackers with permissions to create or edit workflows can insert a 'javascript:' URI payload, leading to arbitrary code execution in the victim's browser context upon interaction.

Alon Barad
Alon Barad
7 views•5 min read
•about 10 hours ago•CVE-2026-65599
5.1

CVE-2026-65599: Google Service Account Private Key Leakage via JWT Header Parameter in n8n

A credential exposure vulnerability in n8n (CVE-2026-65599) transmits the complete PEM-formatted Google Service Account private key in the 'kid' (Key ID) parameter of outbound JWT headers during Google API authentication. Because JWT headers are encoded in plain Base64URL and not encrypted, any entity that intercepts, logs, or processes these outbound requests can immediately extract the plaintext private key. This enables unauthorized third parties to fully compromise the corresponding Google Cloud Platform (GCP) service account and access any authorized cloud resources.

Alon Barad
Alon Barad
7 views•7 min read
•about 13 hours ago•CVE-2026-47300
8.8

CVE-2026-47300: Elevation of Privilege in ASP.NET Core Negotiate Authentication Handler

CVE-2026-47300 is a high-severity Elevation of Privilege (EoP) vulnerability in Microsoft's ASP.NET Core framework, affecting the Negotiate Authentication Handler when configured to retrieve security groups and role mappings via an LDAP/Active Directory directory service. In cross-platform Linux and macOS environments where native Windows token group expansion is unavailable, an authenticated attacker with low-privileged network access can manipulate LDAP query structures or force connections to untrusted directory resources, resulting in unauthorized administrative role assignment.

Amit Schendel
Amit Schendel
7 views•6 min read