/

CVE-2026-33665

Severity:

HIGH RISK

(7.5)

Improper Authentication in n8n LDAP Account Association

CVE-2026-33665

Analyzed

Vulnerability type

Category:

Improper Authentication

CWE:

CWE-287

Impact:

Account Takeover and Privilege Escalation

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

n8n's LDAP authentication flow previously auto-linked LDAP identities to existing local accounts solely based on matching email addresses.

An LDAP-authenticated user who could modify their own LDAP email attribute could set it to another user's email, including an administrator's, and gain persistent access to that account even after reverting the LDAP email.

Affected context

This vulnerability affects n8n deployments that:

  • Have LDAP authentication explicitly configured and enabled (non-default), and
  • Allow user-controllable LDAP attributes for email, and
  • Maintain both local n8n user accounts and LDAP-backed identities.

In this context, n8n trusted the LDAP email attribute as a unique link key for associating identities, without enforcing additional verification or ownership checks.

Exploit preconditions

  • Attack surface: n8n web interface using LDAP login.
  • Required access: Valid LDAP credentials for any account in the directory.
  • Additional capability: Ability for the attacker to modify their own LDAP email attribute (e.g., through a self-service portal or overly permissive directory ACLs).
  • Trigger point: Logging into n8n via LDAP after setting the LDAP email to match the target n8n user's email address.
  • Why exploitation is possible: The application implicitly trusted the LDAP email attribute as sufficient proof of identity and automatically linked the LDAP user to an existing local account with the same email, without additional confirmation or ownership validation. The linkage persisted beyond changes to the LDAP email.

Why this happens

The core issue is an improper authentication and identity binding design (CWE-287) where n8n:

  • Treated a single, mutable attribute (email) as a stable, unique identifier across systems.
  • Automatically linked LDAP identities to existing local accounts purely on email equality.
  • Did not verify that the LDAP principal actually owned or originally created the local account associated with that email.

Because some directory configurations allow users to change their own email attribute, a malicious user could impersonate another account at the identity-linking stage. Once the linkage was created, it was not revalidated on subsequent logins, leading to a persistent account takeover even after the LDAP email was changed back.

Potential impact

  • Full compromise of another user's n8n account, including administrators.
  • Unauthorized access to workflows, credentials, integrations, and automation secrets stored in the compromised account.
  • Escalation from a low-privilege LDAP user to an administrative role within n8n.
  • Manipulation or deletion of workflows, resulting in business process disruption.
  • Indirect access to connected systems and APIs through compromised workflow credentials.

General mitigation guidance

Mitigation generally focuses on stronger identity binding and safer use of external authentication attributes:

  • Avoid using mutable, user-controlled attributes (like email) as the sole key for linking external identities to local accounts.
  • Prefer stable, non-user-editable identifiers from the identity provider (e.g., immutable directory IDs) as the primary linkage key.
  • Require explicit, verified account linking flows (e.g., out-of-band confirmation or admin approval) instead of automatic linkage on first login.
  • Enforce least-privilege in directory configurations so regular users cannot modify identity attributes used for authentication or account mapping.
  • Periodically audit identity mappings for anomalies, such as unexpected associations between LDAP identities and privileged local accounts.
  • Apply defense-in-depth by restricting what a single compromised n8n account can do, for example through role-based access controls and scoped credentials.

How teams detect issues like this

Potential detection approaches include:

  • Log analysis: Monitor authentication and account-linking logs for:
  • LDAP logins that result in new linkages to existing local accounts.
  • Sudden changes where a low-privilege LDAP user appears associated with an administrator-level n8n account.
  • Directory monitoring: Detect unusual patterns of email attribute changes, especially where:
  • A user temporarily sets their email to match another known user's address.
  • Email changes cluster around times of new n8n account associations.
  • Configuration review: Regularly review:
  • LDAP schema and ACLs to ensure users cannot modify attributes that are used for identity mapping.
  • n8n authentication configuration to confirm that it uses stable, non-mutable identifiers and does not auto-link accounts without verification.
  • Automated checks: Use security configuration scanners or CI/CD policy checks to flag unsafe authentication/linking patterns, such as reliance on user-editable attributes for identity binding.

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-c545-x2rh-82fc

Frequently asked

questions

Yes. Any user who can reach the n8n login interface and authenticate via LDAP with valid credentials can potentially exploit it, provided they can control their LDAP email attribute.

The attacker needs:

  • Valid LDAP credentials for some account in the directory, and
  • The ability to modify the email attribute of that LDAP account.

No prior access to n8n itself is required beyond the LDAP login capability.

The safest pattern is to redesign the identity-linking mechanism so that:

  • It uses immutable, non-user-editable identifiers from the identity provider (e.g., unique directory IDs).
  • It does not automatically bind external identities to existing local accounts based solely on email or other mutable attributes.
  • Any new link between an external identity and a local account is explicitly validated.

To prevent related problems:

  • Treat account linking as a security-sensitive operation with explicit verification and clear trust boundaries.
  • Avoid relying on user-editable attributes for authentication, authorization, or account mapping decisions.
  • Implement regular reviews of authentication flows and federation configurations.
  • Involve security review for any feature that combines or synchronizes identities across systems, especially SSO, LDAP, or OAuth-based integrations.
Find out what's already
exploitable in your codebase.