Skip to content

InResponseTo checking is brittle #773

@bdewater-thatch

Description

@bdewater-thatch

For added security I'm looking into disallowing IdP initiated flows and requiring SP initiated flows to be used all the time. The current code on master is identical on the v2.x branch:

def validate_in_response_to
return true unless options.has_key? :matches_request_id
return true if options[:matches_request_id].nil?
return true unless options[:matches_request_id] != in_response_to
error_msg = "The InResponseTo of the Response: #{in_response_to}, does not match the ID of the AuthNRequest sent by the SP: #{options[:matches_request_id]}"
append_error(error_msg)
end

This works if you don't specifically care about this, but is odd to work with if you do. You can't use options[:matches_request_id] = session.delete("saml_request_id") (assuming you stored Authrequest#uuid there before) since it may return nil and the above code returns early. Passing in an empty string instead works but feels clunky.

Should there be an explicit security setting like want_request_id (like want_assertions_signed and want_name_id so that a nil value doesn't pass validation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions