n8n Token Exchange Flaw Grants Admin API Access and Can Lead to RCE
Vulnerability Disclosure · 2 sources · Updated 4mo ago · First seen Jul 22, 2026

A high-severity flaw tracked as CVE-2026-65595 affects n8n versions before 2.30.1 and, on a separate branch, before 2.29.8. The vulnerability stems from the Token Exchange module assigning all Public API scopes to JWT-derived access tokens after validating an external JWT from a trusted issuer, allowing a low-privileged user to gain administrator-level Public API access when both Token Exchange and Public API are enabled. The issue is rated CVSS v4.0 8.9 and classified as CWE-269 Improper Privilege Management.
Successful exploitation can let an attacker perform admin-only actions including creating or deleting users, escalating roles, modifying workflows, reading database credentials stored in connection configurations, and exporting sensitive system data. In deployments that also allow installation of unverified Community Packages, the compromise can be extended to remote code execution on the n8n host, creating a path to full takeover of the automation platform and its underlying server.


