Conversation
zachmargolis
approved these changes
Jun 14, 2017
Contributor
zachmargolis
left a comment
There was a problem hiding this comment.
LGTM! Thanks for the fix
**Why**: A bug was discovered where an OIDC Service Provider's configuration included attributes that are only meant for SAML, namely `assertion_consumer_logout_service_url`. That attribute was set to an empty string, but the logic in `SingleLogoutHandler#slo_not_implemented_at_sp?` was checking for `nil?` only, which caused `SamlIdpController#logout` to proceed all the way to call `generate_slo_request` with a nil URL (instead of returning early at `finish_slo_at_idp`), which resulted in an exception in `SecureHeadersWhitelister.extract_domain` due to the `nil` URL. **How**: In addition to the empty SAML attribute, reproducing this bug also requires that the user have an active identity with the OIDC SP. In SAML, identities get deactivated during the logout process, but OIDC identities remain active (which could be another bug). This is why the spec signs the user in fully to the SP first to create the identity, then signs out, then signs in again, but cancels the sign in process on the 2FA screen. Using `blank?` instead of `nil?` fixes the bug.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why: A bug was discovered where an OIDC Service Provider's
configuration included attributes that are only meant for SAML,
namely
assertion_consumer_logout_service_url. That attribute wasset to an empty string, but the logic in
SingleLogoutHandler#slo_not_implemented_at_sp?was checking fornil?only, which causedSamlIdpController#logoutto proceed all theway to call
generate_slo_requestwith a nil URL (instead ofreturning early at
finish_slo_at_idp), which resulted in anexception in
SecureHeadersWhitelister.extract_domaindue to thenilURL.
How: In addition to the empty SAML attribute, reproducing this bug
also requires that the user have an active identity with the OIDC SP.
In SAML, identities get deactivated during the logout process, but
OIDC identities remain active (which could be another bug).
This is why the spec signs the user in fully to the SP first to create
the identity, then signs out, then signs in again, but cancels the
sign in process on the 2FA screen.
Using
blank?instead ofnil?fixes the bug.