CVE-2026-40165

authentik: SAML NameID XML Comment Injection Enables Authentication Bypass via Identifier Truncation

HIGH
8.7
CVSS Score
Published: May 20, 2026 at 11:35 PM UTC
Updated: July 23, 2026 at 07:32 PM UTC
1 product affected across 1 vendorAuthentik

Using authentik by goauthentik?

Get instant alerts when new vulnerabilities affect authentik - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH8.7
Exploit prediction
EPSS 0.5%
SSVC
No known exploit

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 2025.12.5v < 2026.2.3
Affected range stops below 2025.12.5, so it looks safe — our inference, not a vendor statement
Affected range stops below 2026.2.3, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet, and no fixed version or vendor advisory is recorded against it.

SSVC — Action Prioritization

SSVCNo known exploitNot automatableTotal impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

8.7HIGHGitHub_M
Attack Vector
NETWORK
Complexity
HIGH
Privileges
NONE
User Interaction
NONE
Scope
CHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
NONE
Vector?

Quick Info

StatusDEFERRED
CWE
CWE-287CWE-91CWE-436

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card