# CVE-2026-40165: authentik: SAML NameID XML Comment Injection Enables Authentication Bypass via Identifier Truncation

- Severity: High 8.7 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.50%, higher than 44% of CVEs (2026-12-01)
- Published: 2026-05-20T23:35:18.309Z
- Modified: 2026-07-23T15:10:00.137Z
- Also known as: BIT-AUTHENTIK-2026-40165, GHSA-9wj8-xv4r-qwrp
- Weaknesses: CWE-91, CWE-287, CWE-436
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- goauthentik authentik: < 2025.12.5; >= 2026.2.0-rc1, < 2026.2.3
- authentik (Bitnami): before 2025.12.5; from 2026.2.0 before 2026.2.3

## Every score

- GitHub_M: CVSS:3.1 8.7 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N`
- Bitnami Vulnerability Database: rating High

## References

- <https://github.com/goauthentik/authentik/security/advisories/GHSA-9wj8-xv4r-qwrp> (web)
- <https://github.com/goauthentik/authentik/commit/47dec5c6b7fb4a62bfad2ae8bddf002bde7ba774> (web)
- <https://github.com/goauthentik/authentik/releases/tag/version%2F2025.12.5> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-40165> (web)

## Sources

- CVE List: [CVE-2026-40165](https://www.cve.org/CVERecord?id=CVE-2026-40165), CVE Terms of Use, modified 2026-05-21
- NVD: [CVE-2026-40165](https://nvd.nist.gov/vuln/detail/CVE-2026-40165), Public domain, modified 2026-07-23
- Bitnami Vulnerability Database: [BIT-AUTHENTIK-2026-40165](https://osv.dev/vulnerability/BIT-AUTHENTIK-2026-40165), Apache-2.0, modified 2026-07-08

---

Page: https://cve.day/CVE-2026-40165 · Whole record: https://cve.day/CVE-2026-40165.json · Rebuilt by cve.day 2026-11-25T22:59:22.079Z
