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·47 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

•40 minutes ago•CVE-2026-129300
5.3

CVE-2026-129300: Uncaught Exception Denial of Service in SpamScope mail-parser

CVE-2026-129300 (GHSA-xhrq-2mqv-q8wx) is an unhandled exception vulnerability in SpamScope mail-parser, a Python library used to parse raw emails. When processing an email with a malformed Received header containing an out-of-range year or timezone offset, standard library datetime conversion routines raise OverflowError or OSError. Because the internal error handler only caught TypeError and ValueError, these exceptions escape the parser hierarchy, terminating email ingestion pipelines and causing a denial of service.

Alon Barad
Alon Barad
1 views•8 min read
•about 2 hours ago•CVE-2026-129301
6.5

CVE-2026-129301: Security Scanner Evasion and Batch Denial of Service in SpamScope mail-parser via Unhandled Attachment Exceptions

CVE-2026-129301 (GHSA-8cgq-x343-p74c) is an uncaught exception and MIME interpretation conflict vulnerability in the Python email parsing library mail-parser (versions >= 4.6.0 and < 4.6.3). The write_attachments() function iterates over parsed email attachments without per-attachment exception containment. When processing a specially crafted MIME part containing an RFC 2231-encoded null byte in the filename, a basename exceeding filesystem NAME_MAX limits, or a malformed base64 payload, the function raises an unhandled standard library exception (ValueError, OSError, or binascii.Error). This prematurely aborts the attachment extraction loop, preventing subsequent attachments from being written to disk for downstream security inspection while also triggering unhandled worker crashes in applications that only catch MailParserError.

Amit Schendel
Amit Schendel
3 views•11 min read
•about 3 hours ago•CVE-2026-129239
6.5

CVE-2026-129239: Privilege Escalation and Unauthorized Data Exposure in Directus SharesService

Directus versions prior to 12.3.1 contain an authorization bypass and privilege management flaw in the SharesService component. Authenticated non-administrative users with update permissions on the directus_shares collection can modify the user_created, role, item, and collection fields of an existing owned share. Because the update operation validates permissions solely against the pre-update record state without revalidating the modified fields, an attacker can reassign share ownership and role context to an administrator. Subsequent guest access using the share token derives administrative accountability, exposing restricted relational data.

Alon Barad
Alon Barad
3 views•10 min read
•about 4 hours ago•CVE-2026-88987
5.4

CVE-2026-88987: Stored Cross-Site Scripting via XHTML and XML Data URIs in Silverstripe Framework

CVE-2026-88987 (GHSA-qqrg-8jpm-8mph) is a stored Cross-Site Scripting (XSS) vulnerability in the Silverstripe Framework prior to version 6.2.13. The framework's HTML sanitization engine, XssSanitiser, relies on an incomplete regular expression denylist when filtering URI schemes in HTML attributes. Specifically, the sanitizer strips data:text/html URIs but fails to restrict executable XML and XHTML media types such as data:application/xhtml+xml, data:text/xml, and data:application/xml. An authenticated user with content creation privileges can embed crafted data URIs inside HTML attributes like iframe src or object data, leading to arbitrary JavaScript execution when the content is rendered by a victim's browser.

Amit Schendel
Amit Schendel
2 views•9 min read
•about 5 hours ago•CVE-2026-88988
5.4

CVE-2026-88988: Stored Cross-Site Scripting via SVG Data URIs in Silverstripe Framework

A Stored Cross-Site Scripting (XSS) vulnerability exists in Silverstripe Framework versions prior to 6.2.13 within the SilverStripe\Core\XssSanitiser component. The HTML sanitizer fails to strip SVG data URIs (data:image/svg*) from dangerous HTML attributes such as href, src, lowsrc, and data. Authenticated CMS authors can persist crafted SVG data URIs in stored content, leading to arbitrary JavaScript execution in the browser context of users who view or interact with the rendered page.

Alon Barad
Alon Barad
4 views•9 min read
•about 6 hours ago•CVE-2026-88989
4.3

CVE-2026-88989: Authorization Bypass in Silverstripe Framework GridFieldDetailForm

CVE-2026-88989 (tracked as GHSA-3qh3-54qg-gpq3) is a missing authorization vulnerability (CWE-862) in the Silverstripe Framework affecting versions prior to 6.2.13. The flaw exists within the GridFieldDetailForm_ItemRequest request handler, which orchestrates record creation and editing workflows inside the Silverstripe CMS backend. Specifically, the server-side persistence method saveFormIntoRecord() fails to verify whether an authenticated user possesses the necessary creation permissions (canCreate) when processing an unpersisted DataObject record. Consequently, a low-privileged CMS user who has permission to access a GridField interface and edit existing records can bypass role-based creation restrictions. By sending a crafted HTTP POST request directly to the item/new endpoint with the action_doSave parameter, the user can instantiate and persist unauthorized database records. The vulnerability is rated Medium severity with a CVSS v3.1 base score of 4.3 and is remediated in Silverstripe Framework version 6.2.13.

Amit Schendel
Amit Schendel
3 views•10 min read