Skip to content

Commit

Permalink
fixed spec for remote code execution vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiii committed Jan 10, 2013
1 parent d9b6866 commit 4bcf59a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/nori/nori_spec.rb
Expand Up @@ -395,7 +395,8 @@
'approved' => nil,
'written_on' => nil,
'viewed_at' => nil,
'content' => nil,
# don't execute arbitary YAML code
'content' => { "@type" => "yaml" },
'parent_id' => nil,
'nil_true' => nil,
'namespaced' => nil
Expand Down Expand Up @@ -435,12 +436,13 @@
# Changed this line where the key is :message. The yaml specifies this as a symbol, and who am I to change what you specify
# The line in ActiveSupport is
# 'content' => { 'message' => "Have a nice day", 1 => "should be an integer", "array" => [{ "should-have-dashes" => true, "should_have_underscores" => true }] },
'content' => { :message => "Have a nice day", 1 => "should be an integer", "array" => [{ "should-have-dashes" => true, "should_have_underscores" => true }] },
'content' => "--- \n1: should be an integer\n:message: Have a nice day\narray: \n- should-have-dashes: true\n should_have_underscores: true\n",
'author_email_address' => "david@loudthinking.com",
'parent_id' => nil,
'ad_revenue' => BigDecimal("1.50"),
'optimum_viewing_angle' => 135.0,
'resident' => :yes
# don't create symbols from arbitary remote code
'resident' => "yes"
}

parse(topic_xml)["topic"].each do |k,v|
Expand Down

0 comments on commit 4bcf59a

Please sign in to comment.