Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2026-40165

HIGH 8.7EPSS 47%

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

Mitigation

  • Upgrade authentik to 2026.2.3 or later.

Who should check

  • Anyone running goauthentik authentik < 2025.12.5; >= 2026.2.0-rc1, < 2026.2.3

Vulnerability facts

Affected
goauthentik authentik < 2025.12.5; >= 2026.2.0-rc1, < 2026.2.3
Fixed in
goauthentik authentik 2025.12.5, goauthentik authentik 2026.2.3
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, no login needed
CVSS
8.7 (v3.1, CNA)CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: High
  • Privileges required: None
  • User interaction: None
  • Scope: Changed (impact reaches other components)
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: None
EPSS
0.68% chance of exploitation in 30 days (percentile 47, 2026-11-26)
CWE
CWE-287, CWE-91, CWE-436
Published
Modified

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 and fixed versions

Package / productAffectedFixedSource
goauthentik authentik< 2025.12.5; >= 2026.2.0-rc1, < 2026.2.3—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2026-40165. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-40165.md
Affected: goauthentik authentik < 2025.12.5; >= 2026.2.0-rc1, < 2026.2.3
Fixed in: goauthentik authentik 2025.12.5, goauthentik authentik 2026.2.3

Steps:
1. Search this machine and project for goauthentik authentik: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2026-40165 being exploited?

There is no confirmed exploitation: CVE-2026-40165 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.68% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2026-40165?

High: CVSS 8.7 (v3.1, scored by CNA). Remote, no login needed. The attack needs conditions outside the attacker's control, which makes it harder.

Which versions are affected by CVE-2026-40165?

goauthentik authentik < 2025.12.5; >= 2026.2.0-rc1, < 2026.2.3.

Is there a fix for CVE-2026-40165?

Yes. Fixed in goauthentik authentik 2025.12.5, goauthentik authentik 2026.2.3. Upgrade authentik to 2026.2.3 or later.

How do I check if I'm affected by CVE-2026-40165?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors