Skip to content

Commit

Permalink
Fix possible xpath injection
Browse files Browse the repository at this point in the history
  • Loading branch information
pitbulk committed Apr 29, 2015
1 parent 45f9493 commit 9853651
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/xml_security.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def validate_signature(base64_cert, soft = true)
REXML::XPath.each(@sig_element, "//ds:Reference", {"ds"=>DSIG}) do |ref|
uri = ref.attributes.get_attribute("URI").value

hashed_element = document.at_xpath("//*[@ID='#{uri[1..-1]}']")
hashed_element = document.at_xpath("//*[@ID=$uri]", nil, { 'uri' => uri[1..-1] })
canon_algorithm = canon_algorithm REXML::XPath.first(
ref,
'//ds:CanonicalizationMethod',
Expand Down

0 comments on commit 9853651

Please sign in to comment.