{"id":1870,"date":"2025-02-10T10:03:37","date_gmt":"2025-02-10T10:03:37","guid":{"rendered":"https:\/\/serisec.com\/index.php\/2025\/02\/10\/saml-bypass-authentication-on-github-enterprise-servers-to-login-as-other-user-account\/"},"modified":"2025-02-10T10:03:37","modified_gmt":"2025-02-10T10:03:37","slug":"saml-bypass-authentication-on-github-enterprise-servers-to-login-as-other-user-account","status":"publish","type":"post","link":"https:\/\/serisec.com\/index.php\/2025\/02\/10\/saml-bypass-authentication-on-github-enterprise-servers-to-login-as-other-user-account\/","title":{"rendered":"SAML Bypass Authentication on GitHub Enterprise Servers To Login as Other User Account"},"content":{"rendered":"<p>    SAML Bypass Authentication on GitHub Enterprise Servers To Login as Other User Account<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p>A significant vulnerability has been identified in GitHub Enterprise Servers, allowing attackers to bypass SAML authentication and log in as other user accounts.<\/p>\n<p>This exploit leverages quirks in the <code>libxml2<\/code> library, specifically related to XML entities, to deceive the verification process.<\/p>\n<p>The vulnerability, designated as CVE-2025-23369 and this security flaw highlights the importance of robust <a href=\"https:\/\/cybersecuritynews.com\/security-measures-that-help-protect-your-crypto\/\" target=\"_blank\" rel=\"noreferrer noopener\">security measures<\/a> in authentication systems.<\/p>\n<p>SAML (Security Assertion Markup Language) is a protocol used for exchanging authentication and authorization data between systems.<\/p>\n<p>Security analyst at repz ret, hakivvi <a href=\"https:\/\/repzret.blogspot.com\/2025\/02\/abusing-libxml2-quirks-to-bypass-saml.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">detected<\/a> that it operates similarly to OAuth2\/OpenID but instead of returning an access token, SAML provides a Response object containing user attributes like email and name.<\/p>\n<p>While this Response is protected by a digital signature to prevent tampering.<\/p>\n<pre class=\"wp-block-code\"><code>&lt;samlp:Response xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\"&gt;\n    &lt;saml:Issuer&gt;http:\/\/idp.example.com\/metadata.php&lt;\/saml:Issuer&gt;\n    &lt;ds:Signature&gt;...&lt;\/ds:Signature&gt;\n    &lt;saml:Assertion&gt;\n        &lt;saml:Subject&gt;\n            &lt;saml:NameID SPNameQualifier=\"http:\/\/sp.example.com\/demo1\/metadata.php\"&gt;user@example.com&lt;\/saml:NameID&gt;\n        &lt;\/saml:Subject&gt;\n    &lt;\/saml:Assertion&gt;\n&lt;\/samlp:Response&gt;<\/code><\/pre>\n<h2 class=\"wp-block-heading\"><strong>The Vulnerability<\/strong><\/h2>\n<p>The vulnerability exploits an inconsistency in how XML entities are handled during the signature verification process.<\/p>\n<p>By using an XML entity to define an ID attribute, an attacker can make the verification code mistakenly identify an arbitrary element (an <code>Assertion<\/code>) as the root element (<code>Response<\/code>).<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjr6MEYdl2qHxgj93HawRA1jkuJzza-0sexck6dHy76hbXkTcOsM46rmyAmBYU0BzX0F598SWbXkaoUFivtLnHHy8aee2usIVFF55FH6GLUrwWflwMjR4tN7ycniGN8ct0kr7a5dtdq-QT1J0nZfkLq2Rxbqabo6VRll0InqJaCwuNnZTkR9zlr2seoqmQ\/s16000\/Root%2520element%2520ID%2520%28Source%2520-%2520repz%2520ret%29.webp?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">Root element ID (Source \u2013 repz ret)<\/figcaption><\/figure>\n<\/div>\n<pre class=\"wp-block-code\"><code>require 'Nokogiri'\nxml = &lt;&lt;-XML\n&lt;!DOCTYPE abcd [ &lt;!ENTITY idViaEntity \"_129\"&gt; ]&gt;\n&lt;samlp:Response ID=\"&amp;idViaEntity;\"&gt;\n    &lt;saml:Assertion ID=\"_129\"&gt;http:\/\/idp.example.com\/metadata.php&lt;\/saml:Assertion&gt;\n&lt;\/samlp:Response&gt;\nXML\ndoc = Nokogiri::XML(xml)\nputs doc.xpath('\/\/*[@ID=$uri or @wsu:Id=$uri]', {\"wsu\": \"http:\/\/docs.oasis-open.org\/wss\/2004\/01\/oasis-200401-wss-wssecurity-utility-1.0.xsd\"}).first<\/code><\/pre>\n<p>This code snippet shows that how the XPath query can return the <code>Assertion<\/code> element instead of the expected <code>Response<\/code> element due to the XML entity.<\/p>\n<p>To exploit this vulnerability, an attacker crafts a SAML Response with an XML entity defining the ID of the <code>Response<\/code> element.<\/p>\n<p>This entity is then referenced in the <code>Assertion<\/code> element, causing the verification code to mistakenly validate the signature against the <code>Assertion<\/code> instead of the <code>Response<\/code>.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEiAqRxA0to8hG92gY6qYEKZAxriJqfo4Yf2qvYFjyyVxPi0K8kYXrf6TttOnB7L83r6wInr-UmbemXmusqGbPrNGoyP3MTNmXGucvRLKZ7bUnpNYywrkF6u-V47Lgl2B7pntRgBGoOVzanx54IMvWorKqjWw62qx5To9qogrQX5fXl92YkvwU6dZnebf8E\/s16000\/Referenced_node%2520Mistake%2520%28Source%2520-%2520repz%2520ret%29.webp?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">Referenced_node Mistake (Source \u2013 repz ret)<\/figcaption><\/figure>\n<\/div>\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE abcd [ &lt;!ENTITY idViaEntity \"id198723974770096182351422\"&gt; ]&gt;\n&lt;saml2p:Response ID=\"&amp;idViaEntity;\"&gt;\n    &lt;!-- Injected Assertion --&gt;\n    &lt;saml2:Assertion ID=\"id198723974770096182351422\"&gt;\n        &lt;!-- Original Assertion --&gt;\n    &lt;\/saml2:Assertion&gt;\n&lt;\/saml2p:Response&gt;<\/code><\/pre>\n<p>The CVE-2025-23369 vulnerability shows the importance of thoroughly testing and securing authentication systems.<\/p>\n<p>Not only that even it also highlights how subtle inconsistencies in XML parsing can lead to significant <a href=\"https:\/\/cybersecuritynews.com\/what-is-payroll-auditing-and-how-to-avoid-security-breaches\/\">security breaches<\/a>.<\/p>\n<p>GitHub has addressed this issue, but it serves as a reminder for developers to scrutinize their authentication mechanisms closely.<\/p>\n<p>Developers should thoroughly test XML parsing libraries to ensure that they handle entities correctly and prevent similar exploits.<\/p>\n<p>They must also implement robust signature verification by checking signatures against the expected root element to avoid misidentification.<\/p>\n<p>Besides this, regularly updating dependencies, such as keeping libraries like libxml2 current, helps mitigate known vulnerabilities.<\/p>\n<p>By following these <a href=\"https:\/\/cybersecuritynews.com\/secure-ai-system-development\/\" target=\"_blank\" rel=\"noreferrer noopener\">guidelines<\/a>, developers can enhance the security of their SAML-based authentication systems.<\/p>\n<p class=\"has-text-align-center has-background\" style=\"background:linear-gradient(180deg,rgb(238,238,238) 90%,rgb(169,184,195) 100%)\"><strong><code>Are you from SOC\/DFIR Team? - Join 500,000+ Researchers to Analyze Cyber Threats with ANY.RUN Sandbox -\u00a0<a href=\"https:\/\/any.run\/demo\/?utm_source=li_csn&amp;utm_medium=post&amp;utm_campaign=meme&amp;utm_content=demo&amp;utm_term=100225\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Try for Free<\/a><\/code><\/strong><\/p>\n<p>The post <a href=\"https:\/\/cybersecuritynews.com\/saml-bypass-authentication-on-github-enterprise-servers\/\">SAML Bypass Authentication on GitHub Enterprise Servers To Login as Other User Account<\/a> appeared first on <a href=\"https:\/\/cybersecuritynews.com\/\">Cyber Security News<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Tushar Subhra Dutta<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/cybersecuritynews.com\/saml-bypass-authentication-on-github-enterprise-servers\/\">Go to cyber-security-news<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SAML Bypass Authentication on GitHub Enterprise Servers To Login as Other User Account A significant vulnerability has been identified in GitHub Enterprise Servers, allowing attackers to bypass SAML authentication and log in as other user accounts. This exploit leverages quirks in the libxml2 library, specifically related to XML entities, to deceive the verification process. The [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129,63,649],"tags":[130],"class_list":["post-1870","post","type-post","status-publish","format-standard","hentry","category-cyber-security","category-cyber-security-news","category-threats","tag-cyber-security-news"],"_links":{"self":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/1870"}],"collection":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/comments?post=1870"}],"version-history":[{"count":0,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/1870\/revisions"}],"wp:attachment":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/media?parent=1870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/categories?post=1870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/tags?post=1870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}