A recently disclosed vulnerability in GitHub Enterprise Server (GHES), tracked as CVE-2025-23369, has raised serious security concerns.
This flaw, stemming from quirks in the libxml2
library used for SAML authentication validation, allows attackers to bypass authentication and gain unauthorized access to GHES instances.
The issue specifically affects environments utilizing SAML single sign-on (SSO) with encrypted assertions enabled, a configuration designed to enhance security but inadvertently introducing this critical flaw.
Technical Analysis of the Exploit
The vulnerability lies in how GitHub’s SAML implementation validates cryptographic signatures in SAML responses.
Normally, SAML responses are signed by an Identity Provider (IdP) to ensure their integrity and authenticity.
However, the flaw allows attackers to manipulate the XML structure of a SAML response by exploiting inconsistencies in libxml2
‘s handling of XML entities and XPath queries.
By crafting a malicious SAML response, attackers can trick the system into validating an arbitrary XML element as the root signature.
This bypasses critical checks, such as ensuring that the root element’s signature matches its ID.
In essence, the attacker can inject a forged assertion granting administrative privileges without proper validation.
How It Works
- Entity Injection: The attacker uses XML entities to manipulate the document structure during parsing.
- Signature Misinterpretation: By exploiting these inconsistencies, the attacker ensures that their injected assertion is treated as valid despite not being part of the original signed response.
- Privilege Escalation: Once authenticated as an administrator, the attacker gains unrestricted access to sensitive data and administrative controls.
This vulnerability has been assigned a maximum CVSS score of 10.0 due to its severe implications:
- Unauthorized Access: Attackers can impersonate any user, including administrators.
- Data Compromise: They can view, modify, or delete repositories and sensitive information.
- Infrastructure Control: Full administrative privileges allow attackers to create new accounts or disable security measures.
According to the report, the flaw affects all GHES versions prior to 3.13.0 when configured with SAML SSO and encrypted assertions enabled.
Notably, encrypted assertions are not enabled by default, limiting the scope of affected instances.
GitHub has released patches addressing this vulnerability in GHES versions 3.9.15, 3.10.12, 3.11.10, and 3.12.4. Administrators are urged to update their systems immediately to mitigate potential risks.
For organizations unable to update immediately:
- Disable encrypted assertions if feasible.
- Monitor authentication logs for suspicious activity.
- Implement additional network-level controls to restrict access to GHES instances.
This incident underscores the importance of rigorous testing and validation in security-critical implementations like SAML authentication systems.