CVE-2026-40165

Source
https://cve.org/CVERecord?id=CVE-2026-40165
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-40165.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-40165
Aliases
Published
2026-05-20T23:35:18.309Z
Modified
2026-07-08T08:26:12.925786128Z
Severity
  • 8.7 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N CVSS Calculator
Summary
authentik: SAML NameID XML Comment Injection Enables Authentication Bypass via Identifier Truncation
Details

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.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40165.json",
    "cna_assigner": "GitHub_M",
    "cwe_ids": [
        "CWE-287",
        "CWE-436",
        "CWE-91"
    ]
}
References

Affected packages

Git / github.com/goauthentik/authentik

Affected ranges

Type
GIT
Repo
https://github.com/goauthentik/authentik
Events
Database specific
{
    "source": [
        "DESCRIPTION",
        "REFERENCES"
    ],
    "extracted_events": [
        {
            "introduced": "2026.2.0-rc1"
        },
        {
            "fixed": "2026.2.2"
        }
    ]
}

Affected versions

version/2026.*
version/2026.2.0
version/2026.2.0-rc1
version/2026.2.0-rc2
version/2026.2.0-rc3
version/2026.2.0-rc4
version/2026.2.0-rc5
version/2026.2.1
version/2026.2.1-rc1
version/2026.2.2-rc1
version/2026.2.2-rc2
version/2026.2.2-rc3

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-40165.json"