-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
Describe the bug
IDP sends logout request to SP (implemented with spring security 5.6.1). That request correctly does not contain NameID, but either BaseID or EncryptedID, both of which are fine according to SAML2 standard (see OASIS, Logout Request MUST have one of NameID, BaseID, EncryptedId).
The bug is in the private method validateName, it should not only consider NameId but also BaseId and EncryptedID from the Request to validate.
See here:
Line 156 in ad90745
private Consumer<Collection<Saml2Error>> validateName(LogoutRequest request, Authentication authentication) { |
To Reproduce
Have an IDP send correct Logout Request with EncryptedID as Principal / Name Identifier. Spring Security SAML2 (OpenSamlLogoutRequestValidator) invalidates the request, hence no logout is done
Expected behavior
Spring should validate standard-conformant logout requests and hence allow a logout request sent from IDP to log out the principal from the SP.
Sample
I could provide one if really necessary, but just compare the SAML2 Standard regarding the Logout Request (see "core" here http://saml.xml.org/saml-specifications or here ->) from the http://www.oasis-open.org/committees/download.php/35711/sstc-saml-core-errata-2.0-wd-06-diff.pdf Section 3.7.1 Line 2676:
saml:BaseID or saml:NameID or saml:EncryptedID [Required]