You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use OneLogin for SAML authentication. When an user is authenticated against OneLogin and clicks the Sign in link in Confidant - he/she is automatically authenticated. However, if the user is in the OneLogin dashboard and clicks on the Confidant icon (the authentication is initiated from outside of Confidant) - an error is displayed:
{
"errors": [
"invalid_response"
],
"message": "SAML request failed",
"reason": "No AuthNRequest ID from SP found to match with InResponseTo of response"
}
I think that authentication with IdP initiated requests is not currently supported by Confidant. I am not a Python expert but I believe that in order to fix this issue you need to change this piece of code:
try:
request_id = session['saml_authn_request_id']
except KeyError:
logging.warning('No saml_authn_request_id in session')
resp = jsonify(errors=['invalid_response'],
message='SAML request failed',
reason=('No AuthNRequest ID from SP found '
'to match with InResponseTo of response'))
resp.status_code = 401
return resp
Instead of always throwing an exception when the request_id is not found, you should first check if the response contains InResponseTo="..." field and only if it does, then throw an exception.
Hey @pavelnikolov. There's a minor vulnerability opened by doing so, and the underlying library doesn't have support for choosing whether to open or close it, but @vivianho tracked this down and opened an issue with python-saml: SAML-Toolkits/python-saml#188
The vulnerability requires interception, though, so overall we don't feel like this changes the threat model. Based on that assessment, we're going to loosen up the restriction here and we'll update the library in the requirements when the setting becomes available in a release, for those who want to close this.
Sorry, we're digging into this a bit deeper. OWASP recommendation is to never accept an assertion without InResponseTo set to avoid man-in-the-middle, potentially from malicious SPs.
Following up on this, IdP initiated login introduces a login CSRF vulnerability that could be used to log a user in via CSRF, and could also be used to escalate privileges of that user. Escalation of privileges isn't an issue in confidant right now, as we don't have access controls, but we do have plans on adding support for segregated user classes in the future.
Based on that, I'm going to update the attached PR a bit to wrap this around a setting, that will default to false.
We use OneLogin for SAML authentication. When an user is authenticated against OneLogin and clicks the
Sign in
link in Confidant - he/she is automatically authenticated. However, if the user is in the OneLogin dashboard and clicks on the Confidant icon (the authentication is initiated from outside of Confidant) - an error is displayed:I think that authentication with IdP initiated requests is not currently supported by Confidant. I am not a Python expert but I believe that in order to fix this issue you need to change this piece of code:
Instead of always throwing an exception when the
request_id
is not found, you should first check if the response containsInResponseTo="..."
field and only if it does, then throw an exception.The
InResponseTo
field is not present when the authentication request is initiated from the IdP (e.g. Onelogin).The text was updated successfully, but these errors were encountered: