-
-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix verification of SAML message signatures #418
Fix verification of SAML message signatures #418
Conversation
Old behaviour is preserved if the correct (raw URI-encoded) parts are not provided.
Those test failures on some configs appear to have nothing to do with the code changes. |
Yes, it seems not related, we will need to apply the same at the validate_signature of the Logout Response. As well as provide tests and documentation on the README. |
Test that providing raw URI components allows correct signature verification where the URI-encoding differs from that generated by ruby-saml itself.
Old behaviour is preserved if the correct (raw URI-encoded) parts are not provided. Previous commits fix (and test) the equivalent check for SloLogoutrequest.
@pitbulk I've written some tests, and made the equivalent change for I'm not sure what kind of change you'd like to the README; I can't see any existing documentation about using |
I think we may write an "Update from 1.5.0 to 1.6.0 version" and we ahould describe there that previously we used in LogoutRequest and LogoutResponse constructor the optioms [get_params] but now we recommend to use raw_get_params... and maybe and example of code of the new use. |
Explains the new parameter, and why to use it.
@pitbulk I've pushed some documentation in |
Cheers. 😎 |
Is there anything I can do to help move this (and #420) closer to landing? |
Sorry for the delay, I will merge and do a new release today. |
No drama whatsoever. 😃 Cheers! |
Status
?? READY/IN DEVELOPMENT/HOLD
Description
Current implementation of
validate_signature
incorrectly assumes it can reconstruct the relevant URI parts (RelayState, SAMLRequest, SigAlg) from the decoded values it receives. This contradicts the SAML specification, which requires computing the signature based on the URI components as sent by the Identity Provider.The spec actually explicitly remarks that trying to reconstruct the URI parts is a bad idea because there is no single canonical URI encoding of a given value:
I've preserved the old behaviour in the case that the caller doesn't provide the the correct (raw URI-encoded) parts, for backward compatibility.
This could probably use a couple of tests, but I figured I'd better see if you're ok with the general approach first.
Todos
Steps to Test or Reproduce