The vulnerability allows attribute smuggling by tampering with a SAML response. This implies that the parsing mechanism for SAML assertions was not strictly isolating the legitimate assertion from potentially injected ones. The provided patch addresses this by modifying XPath queries in key functions to be highly specific, ensuring that only the first 'Assertion' element (and its children) within the first 'Response' element is processed.
-
Samlp.extractAssertion is the initial point where the assertion is pulled from the larger SAML response. If it could be tricked into picking a smuggled assertion, the vulnerability would propagate. The patch makes its XPath selectors more specific (Response[1]/Assertion[1]).
-
SAML.parseAssertion is responsible for the detailed parsing of the already extracted (and hopefully validated) assertion. This function and its various helper methods (like getAttributes, getNameID20, etc.) were updated to use XPath queries that explicitly target elements within the first Assertion (Assertion[1]). This prevents these helpers from accidentally reading data from a second, smuggled Assertion element that might have been appended to the XML structure.
The core of the fix lies in ensuring that any XPath query or selection logic that deals with 'Assertion' elements is scoped to the first such element encountered, mitigating the risk of processing attacker-injected attributes from a secondary, smuggled 'Assertion' element.