Skip to content

OpenSamlLogoutRequestValidator invalidates correct SAML2 Logout Request  #10663

@bitrecycling

Description

@bitrecycling

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:

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]

against https://github.com/spring-projects/spring-security/blob/main/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/authentication/logout/OpenSamlLogoutRequestValidator.java](https://github.com/spring-projects/spring-security/blob/ad907457eeeee46da101215f5408d3cd98de4881/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/authentication/logout/OpenSamlLogoutRequestValidator.java#L162)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions