A serious security vulnerability, CVE-2025-23369, has been found in GitHub Enterprise Server (GHES) that lets attackers bypass SAML authentication and impersonate user accounts.
This vulnerability takes advantage of specific anomalies in the libxml2 library employed in SAML response validation, allowing unauthorized access to accounts, even those with administrative rights.
The vulnerability arises from improper handling of XML entities within SAML responses.
Attackers can bypass signature verification by creating a malicious SAML response that manipulates XML entity references, allowing them to inject arbitrary assertions.
The issue impacts how GHES handles cryptographic signatures in SAML responses, resulting in a failure to validate the signed content’s integrity.
Security Assertion Markup Language (SAML) is a popular protocol for Single Sign-On (SSO) authentication. It uses an Identity Provider (IdP) to send signed authentication responses, which are verified by the Service Provider (SP). In this scenario, GitHub Enterprise Server is the SP, and the vulnerability arises from a flaw in how it validates SAML responses.
The problem lies in the has_root_sig_and_matching_ref? function within GHES’s SAML validation logic.
This function verifies if the root element of a SAML response is signed correctly. However, due to issues with libxml2, attackers can exploit XML entity references to make the system validate a different element as the root signature.
According to the report, this avoids important security measures and lets attackers insert harmful assertions.
For example, by using an XML entity like <!ENTITY idViaEntity “_129”> and referencing it in the root element’s ID attribute, attackers can cause inconsistencies between schema validation and XPath queries.
These inconsistencies allow unauthorized claims to be added while keeping the document structure intact.
All versions of GitHub Enterprise Server before 3.13.0 are vulnerable. This allows attackers to:
Gain unauthorized access to user accounts.
Escalate privileges to administrator levels.
Compromise sensitive repositories and data.
GitHub has released patches for this issue in versions 3.9.15, 3.10.12, 3.11.10, and 3.12.4. Administrators should update their systems right away to reduce risks.