CVE-2026-33665: n8n: LDAP Email-Based Account Linking Allows Privilege Escalation and Account Takeover
n8n with LDAP authentication enabled links an LDAP identity to an existing local account when the email matches. An LDAP user who can change their own email attribute can match an administrator's email and take over that account permanently. Fixed in n8n 1.121.0 and 2.4.0.
Published Mar 25, 2026 · Updated Aug 19, 2026 · Analysis Oct 31, 2026
What an attacker can do
With LDAP configured, n8n linked an LDAP login to an existing local account if the LDAP email attribute equalled the local account's email (CWE-287). Email was treated as proof of identity. An LDAP user who controlled their own email attribute could set it to an administrator's address and log in. They then had full access to the admin account.
The link persisted. Reverting the LDAP email afterwards did not remove it, so the takeover was permanent until someone unlinked the account.
The attacker needs a valid LDAP account and the ability to edit their own email attribute in the directory. LDAP must be configured and active, which is not the default. The CVSS vector rates attack complexity high. A takeover of an n8n admin exposes all workflows and stored credentials, and lets the attacker run code through workflows.
Who is affected
The npm package n8n from 2.0.0-rc.0 up to but not including 2.4.0, and every version below 1.121.0. Only instances with LDAP authentication active are affected. Check with:
npm ls n8nThen look in the n8n UI under Settings, LDAP to see whether it is enabled.
n8n
- Ecosystem
- npm
- Affected
- >= 2.0.0-rc.0, < 2.4.0
- Fixed in
- 2.4.0
- Check
npm ls n8n
n8n
- Ecosystem
- npm
- Affected
- < 1.121.0
- Fixed in
- 1.121.0
- Check
npm ls n8n
How to fix it
Upgrade to n8n 1.121.0 or 2.4.0, or later:
npm install -g [email protected]Short-term mitigations from the advisory, which do not fully remediate the risk: disable LDAP authentication until you can upgrade, restrict directory permissions so users cannot edit their own email attributes, and audit existing LDAP-linked accounts for unexpected associations.
How to tell if you were hit
Audit LDAP-linked accounts in n8n and compare each linked LDAP identity with the owner of the local account, especially owner and admin accounts. Review directory change logs for users who edited their own email attribute, and n8n login events for admin sessions from unfamiliar addresses. Because the link survives an email revert, a clean directory today does not prove nothing happened.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Impact
When LDAP authentication is enabled, n8n automatically linked an LDAP identity to an existing local account if the LDAP email attribute matched the local account's email. An authenticated LDAP user who could control their own LDAP email attribute could set it to match another user's email — including an administrator's — and upon login gain full access to that account. The account linkage persisted even if the LDAP email was later reverted, resulting in a permanent account takeover.
- LDAP authentication must be configured and active (non-default).
Patches
The issue has been fixed in n8n versions 2.4.0 and 1.121.0. Users should upgrade to one of these versions or later to remediate the vulnerability.
Workarounds
If upgrading is not immediately possible, administrators should consider the following temporary mitigations:
- Disable LDAP authentication until the instance can be upgraded.
- Restrict LDAP directory permissions so that users cannot modify their own email attributes.
- Audit existing LDAP-linked accounts for unexpected account associations.
These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.
Credited to weblover12, 34selen, B0RI, bde574786, jh-hack.
Questions
- Is n8n without LDAP affected by CVE-2026-33665?
No. LDAP authentication must be configured and active, and it is not the default.
- Does reverting the email undo the takeover?
No. The advisory says the account linkage persisted even after the LDAP email was reverted. You have to audit and fix the links.
- Which versions fix it?
n8n 1.121.0 on the 1.x line and 2.4.0 on the 2.x line.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More n8n vulnerabilities
All n8n entriesCVE-2026-86073
n8n: Per-Resource OAuth Consent Bypass via Unbound Refresh Token Resource Substitution
medium5.9Sep 10, 2026CVE-2026-86074
n8n: Instance AI Credential Setup Accepts Unvalidated Probe URL from Fetched Content
medium5.9Sep 10, 2026CVE-2026-86075
n8n: Unauthenticated Persistent Storage Exhaustion via OAuth Dynamic Client Registration Endpoint
high8.7Sep 10, 2026CVE-2026-86076
n8n: Expression Sandbox Escape via Class-Field Sanitizer Rebinding Can Lead to Code Execution
high8.7Sep 10, 2026CVE-2026-86077
n8n: Anonymous Approval-Gate Bypass via Reused resumeToken over the Chat WebSocket
medium6.3Sep 10, 2026CVE-2026-86078
n8n: Prototype Pollution via Workflow Structure Summary Can Lead to Denial of Service
medium6.0Sep 10, 2026
