Executive brief
authentik is an open-source identity provider used to manage user logins and access to corporate applications. A security flaw in how it handles SAML login responses allows an attacker to bypass authentication by manipulating their username or email identifier. By injecting specific code into their login data, an attacker could trick the system into logging them in as a different, potentially high-privileged user, leading to unauthorized access to sensitive data and systems.
Technical details
An authentication bypass vulnerability exists in authentik due to improper extraction of the NameID value from SAML assertions. When processing SAML responses from a SAML Source with XML Signing enabled, the application fails to correctly handle XML comments within the NameID field. An attacker with the ability to modify their own NameID (such as a username or email) on the source provider can inject an XML comment to truncate the identifier. For example, changing an identifier to 'admin<!-- -->@example.com' might cause authentik to only see 'admin', granting the attacker access to the target account. This issue is fixed in versions 2025.12.5 and 2026.2.3.
Affected products
- goauthentik authentik <= 2025.12.4, 2026.2.0-rc1 - 2026.2.2
Timeline
- 2026-05-12: advisory: GitHub Security Advisory published by maintainers
- 2026-05-12: patched: Versions 2025.12.5 and 2026.2.3 released
- 2026-05-21: disclosed: CVE-2026-40165 published to NVD