-
-
Notifications
You must be signed in to change notification settings - Fork 574
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
OneLogin::RubySaml::Response is broken on rexml 3.3.9 #729
Comments
We need to get off REXML entirely and move to Nokogiri. REXML is not thread safe, and RubySaml patches it in a way that could potentially conflict with other gems. |
Work started here: #736 |
@jwoodrow we are happy to accept a patch that fixes these specific REXML errors. We are also working on REXML removal as our next major step, but no specific timeline for it yet. |
Hey @johnnyshields I'm not too knowledgable about how rexml is used in the case of ruby-saml but I could at least provide the stack trace for the error (since it occurs in the CI when testing an invalid SAML response) SamlSessionsController#post when the identity provider response is not valid when the identity provider response is not valid redirects to the login page with flash error
Failure/Error: @saml_response = OneLogin::RubySaml::Response.new(saml_response_params[:SAMLResponse], settings: saml_settings)
REXML::ParseException:
Malformed XML: Content at the start of the document (got 'fc8xT8MwEAXgv5')
Line: 1
Position: 14
Last 80 unconsumed characters:
# ./vendor/bundle/ruby/3.3.0/gems/rexml-3.3.3/lib/rexml/parsers/baseparser.rb:487:in `pull_event'
# ./vendor/bundle/ruby/3.3.0/gems/rexml-3.3.3/lib/rexml/parsers/baseparser.rb:218:in `pull'
# ./vendor/bundle/ruby/3.3.0/gems/rexml-3.3.3/lib/rexml/parsers/treeparser.rb:22:in `parse'
# ./vendor/bundle/ruby/3.3.0/gems/rexml-3.3.3/lib/rexml/document.rb:448:in `build'
# ./vendor/bundle/ruby/3.3.0/gems/rexml-3.3.3/lib/rexml/document.rb:101:in `initialize'
# ./vendor/bundle/ruby/3.3.0/gems/ruby-saml-1.17.0/lib/xml_security.rb:191:in `initialize'
# ./vendor/bundle/ruby/3.3.0/gems/ruby-saml-1.17.0/lib/onelogin/ruby-saml/response.rb:67:in `new'
# ./vendor/bundle/ruby/3.3.0/gems/ruby-saml-1.17.0/lib/onelogin/ruby-saml/response.rb:67:in `initialize' I'm down to try and look into it as a monkey patch to begin with (until our specs pass) and then try and open up a pull request, but I'm truly at a loss when is comes to this baseparser file and the xml_security file too 😓 |
We are working on get off REXML entirely. |
If you need some real world testing once a branch that seems to be running and passing tests, I can give it a shot and give you some updates if you want |
Hi there,
Given an invalid SAMLResponse, the Response object now raises
REXML::ParseException
on rexml 3.3.9.Which means the response interface is now broken on
1.17.0
Related to ruby/rexml#211
TIA
The text was updated successfully, but these errors were encountered: