samlify: Decrypt assertion broken
Since a tightened checking was introduced in xmldom a week ago, decryptAssertion in libsaml has been broken. Here is the change that affects how replaceChild behaves: https://github.com/xmldom/xmldom/commit/3bc6ccffc89cda391a4e003d36002dfbca2f5403
Because of this change, xml.replaceChild(assertionNode, encryptedAssertions[0]) fails with the error ‘Not found: child not in parent’ and an ERR_EXCEPTION_OF_ASSERTION_DECRYPTION is thrown.
This happens at least when the SAML response XML contains a header in the beginning (e.g. <?xml version="1.0" encoding="UTF-8"?>). When this is the case, entireXML contains the header as the first element, and Response as the second element, and EncryptedAssertion is a child of Response. Therefore, EncryptedAssertion is not a direct child of entireXML, and replaceChild fails due to the tightened checking.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 8
- Comments: 19 (4 by maintainers)
I opened https://github.com/tngan/samlify/pull/511 just now to fix this.
@isanttila and @jsgsdev Tempory solved using an old version of samplify
2.7.7.@isanttila the commit doesn’t seem to be the only culprit as using an overrides with @xmldom/xmldom 0.8.5, which doesn’t contain the backported commit, doesnt fix the problem :
Using samlify 2.7.7 fixes the problem :
I’ll check to see if I find a more recent xmldom version which works