CVE-2026-40165 Details
Description
authentik is an open-source identity provider. Versions 2025.12.4 and prior, and versions 2026.2.0-rc1 through 2026.2.2 were vulnerable to Authentication Bypass through SAML NameID XML Comment Injection. Due to how authentik extracted the NameID value from a SAML assertion, it was possible for an attacker to trick authentik into only seeing a part of the NameID value, potentially allowing an attacker to gain access to other accounts. This issue could be exploited on an authentik instance with a SAML Source, where the attacker had an account on the SAML Source and the ability to modify their NameID value (commonly username or E-mail), and XML Signing was enabled. The attacker could modify the SAML assertion given to authentik by injecting a comment within the NameID value, which effectively truncated the NameID value to the snippet before the comment, and gave the attacker access to any user account. This issue has been fixed in versions 2025.12.5 and 2026.2.3.
A vulnerability in authentik, an open-source identity provider, allows for authentication bypass through SAML NameID XML comment injection. This issue affects versions 2025.12.4 and prior, as well as 2026.2.0-rc1 through 2026.2.2. The vulnerability arises from how authentik processes the NameID value in SAML assertions. An attacker with an account on the SAML source and the ability to modify their NameID (typically username or email) could inject a comment into the NameID value. This injection would truncate the NameID to the portion before the comment, potentially granting access to other user accounts. The vulnerability could be exploited on an authentik instance with a SAML source and XML signing enabled.
Users can upgrade to authentik versions 2025.12.5 or 2026.2.3, which address this vulnerability. For other versions, a workaround involves creating a SAML source property mapping to validate the NameID and ensure it matches the expected format.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed May 21, 2026CISA-ADP
Assessed May 21, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/goauthentik/authentik/commit/47dec5c6b7fb4a62bfad2ae8bddf002bde7ba774 | [email protected] | Source CodeVendor |
| https://github.com/goauthentik/authentik/releases/tag/version%2F2025.12.5 | [email protected] | Release NotesVendor |
| https://github.com/goauthentik/authentik/security/advisories/GHSA-9wj8-xv4r-qwrp | [email protected] | AdvisoryRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-287 | Improper Authentication | [email protected] |
| CWE-436 | Interpretation Conflict | [email protected] |
| CWE-91 | XML Injection (aka Blind XPath Injection) | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| authentik | <= 2026.2.2 (semver) <= 2025.12.4 (semver) |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jul 23, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| May 21, 2026 | New CVE Received | [email protected] |
Volerion