Summary
A flaw in authentik's handling of source connections allows an attacker who can modify a source configuration, and who has a valid account in any configured source, to log in as arbitrary accounts.
Under these conditions, normal authentication boundaries between identities can be bypassed, enabling unauthorized access to other users' sessions and data.
Affected context
This vulnerability occurs in authentik deployments that integrate external identity sources (such as LDAP, SAML, OAuth/OIDC, or other directory/identity providers) through configurable "source connections."
It becomes relevant where:
- Administrators or automation can modify source connection settings, mappings, or attribute handling.
- Users authenticate via these external sources and identities are linked or mapped into authentik accounts.
- There is no strong separation of duties or review on changes to identity source configuration.
In such environments, misconfigured or maliciously altered source connections can undermine trust in the external identity-to-account mapping.
Exploit preconditions
- Attack surface: authentik's login flow that uses configured identity sources.
- Required access:
- Ability to change or control a source connection configuration (e.g., administrative or delegated configuration access, compromised automation, or misconfigured management APIs).
- A valid account in at least one of the configured sources.
- Trigger point: Initiating authentication through the manipulated source connection and leveraging the altered mapping to be associated with another user's account.
- Why exploitation is possible: The authentication logic does not sufficiently validate that the authenticated external identity truly corresponds to the target local account once source settings are changed, allowing trust in the source configuration to substitute for robust identity binding.
Why this happens
The core issue maps to CWE-287: Improper Authentication, where the system accepts a claimant as a particular user without adequately verifying identity under all configuration states.
In authentik's source connection handling, the design implicitly trusts that a configured identity source and its mapping logic are always honest and correctly scoped.
When a source connection can be modified by an attacker, the authentication pathway relies on mutable configuration for identity binding instead of enforcing invariant checks (for example, robust, non-overridable account linking rules or strict validation that external identifiers match a pre-established association).
This creates an insecure pattern in which configuration changes can effectively redefine "who" a user is, resulting in cross-account authentication and account takeover.
Potential impact
- An attacker may log into arbitrary user accounts, including high-privilege administrative accounts.
- Confidential data accessible to targeted accounts can be read, modified, or deleted.
- Security settings, access policies, and identity mappings can be altered to entrench persistence.
- Downstream applications relying on authentik for Single Sign-On (SSO) may be compromised via inherited sessions.
- Audit trails and access logs may be polluted, obscuring the true actor behind actions.
General mitigation guidance
Effective mitigation focuses on reducing trust in mutable configuration, hardening identity binding, and limiting who can alter source connections:
- Treat identity source configuration as security-critical: apply strict role-based access control, change management, and multi-party approval for modifications.
- Enforce invariant identity bindings where possible, such as unchangeable primary identifiers (e.g., immutable subject IDs) rather than relying on attributes that can be remapped or reinterpreted through configuration.
- Use least-privilege for administrative roles and automation that manage source connections; avoid broad configuration rights tied to general admin tasks.
- Periodically review and reconcile identity mappings between external sources and authentik accounts, ensuring that unexpected or broad mappings are flagged.
- Implement defense-in-depth around privileged accounts, such as step-up authentication, strong MFA, and additional policy enforcement for sensitive roles.
How teams detect issues like this
Organizations can look for this class of issue using a combination of configuration governance and authentication flow monitoring:
- Static / configuration analysis: Regularly scan source connection definitions and mapping rules for overly broad or ambiguous identity mappings, catch-all rules, or recently added unusual mappings.
- Code and policy review: During security review, pay special attention to areas where authentication decisions depend on mutable configuration; look for logic that assumes all configuration is trusted and correctly scoped.
- Audit log monitoring: Track changes to source connections, including who changed them, what attributes were modified, and when. Alert on:
- Changes made by unexpected actors or service accounts.
- Sudden spikes in successful logins to privileged accounts following configuration changes.
- Automated checks: Integrate configuration linting or policy-as-code tools in CI/CD to enforce rules such as "privileged account mappings must be explicit and tightly scoped" and "identity source changes require review."

