All vulnerabilities

Servers and applications

CVE-2026-40165

SAML NameID XML Comment Injection Enables Authentication Bypass via Identifier Truncation

Severity
High 8.7
Published
12 May 2026
Last changed
12 May 2026
Added to UpHeron
3 Nov 2026
Fixed in
2025.12.5, 2026.2.3
Exploit chance
0.5% in the next 30 daysHigher than 43% of CVEs. EPSS by FIRST, 19 Nov 2026
Attack
Over the network · Only under certain conditions · No login needed · No user action needed
Attacker can
Read data · Change data
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N
Also known as
GHSA-9wj8-xv4r-qwrp
Sources
Project advisories (GitHub)

Description

Due to how authentik used to extract 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 get access to other accounts.

This issue can be exploited given an authentik instance with a SAML Source, where the attacker has an account on the SAML Source and the ability to modify their NameID value (commonly username or E-mail), and XML Signing is enabled. The attacker can modify the SAML assertion given to authentik by injecting a comment within the NameID value, which effectively truncates the NameID value to the snippet before the comment, and give the attack access to any user account.

From goauthentik/authentik's security advisory.

Workarounds

Create a SAML Source property mapping with the following expression and add it to all SAML Sources:

Workarounds as given by goauthentik/authentik's security advisory.

Affected software

SoftwareAffected versions
authentikServers and applications · github:goauthentik/authentik
  • Every version before 2026.2.3
  • Every version before 2025.12.5

About authentik

The authentication glue you need.

From its GitHub repository.
Total installations
1 millionauthentik
GitHub stars
26,351GitHub, 15 Nov 2026
Forks
2,134GitHub, 15 Nov 2026
Latest release
version/2026.8.5GitHub, 15 Nov 2026
Released
21 Oct 2026GitHub
First published on GitHub
30 Dec 2019GitHub

Release lines

ReleaseLatestSecurity fixes
2026.82026.8.5Yes
2026.52026.5.8Yes
2026.22026.2.7Ended 18 Aug 2026
2025.122025.12.6Ended 22 May 2026
2025.102025.10.4Ended 24 Feb 2026
2025.82025.8.6Ended 13 Jan 2026

From endoflife.date.

References

  • CVE.org https://www.cve.org/CVERecord?id=CVE-2026-40165
  • GitHub Advisory Database https://github.com/advisories/GHSA-9wj8-xv4r-qwrp
  • github.com https://github.com/goauthentik/authentik/security/advisories/GHSA-9wj8-xv4r-qwrp