CVE-2013-0285
Description
The nori gem 2.0.x before 2.0.2, 1.1.x before 1.1.4, and 1.0.x before 1.0.3 for Ruby does not properly restrict casts of string values, which allows remote attackers to conduct object-injection attacks and execute arbitrary code, or cause a denial of service (memory and CPU consumption) involving nested XML entity references, by leveraging Action Pack support for (1) YAML type conversion or (2) Symbol type conversion, a similar vulnerability to CVE-2013-0156.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
noriRubyGems | >= 2.0.0, < 2.0.2 | 2.0.2 |
noriRubyGems | >= 1.1.0, < 1.1.4 | 1.1.4 |
noriRubyGems | >= 1.0.0, < 1.0.3 | 1.0.3 |
Affected products
9cpe:2.3:a:nori_gem_project:nori_gem:1.0.0:*:*:*:*:*:*:*+ 8 more
- cpe:2.3:a:nori_gem_project:nori_gem:1.0.0:*:*:*:*:*:*:*
- cpe:2.3:a:nori_gem_project:nori_gem:1.0.1:*:*:*:*:*:*:*
- cpe:2.3:a:nori_gem_project:nori_gem:1.0.2:*:*:*:*:*:*:*
- cpe:2.3:a:nori_gem_project:nori_gem:1.1.0:*:*:*:*:*:*:*
- cpe:2.3:a:nori_gem_project:nori_gem:1.1.1:*:*:*:*:*:*:*
- cpe:2.3:a:nori_gem_project:nori_gem:1.1.2:*:*:*:*:*:*:*
- cpe:2.3:a:nori_gem_project:nori_gem:1.1.3:*:*:*:*:*:*:*
- cpe:2.3:a:nori_gem_project:nori_gem:2.0.0:*:*:*:*:*:*:*
- cpe:2.3:a:nori_gem_project:nori_gem:2.0.1:*:*:*:*:*:*:*
Patches
64bcf59abdcecfixed spec for remote code execution vulnerability
1 file changed · +5 −3
spec/nori/nori_spec.rb+5 −3 modified@@ -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 @@ -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|
c3fdce7a2d26fixed spec for remote code execution vulnerability
1 file changed · +5 −3
spec/nori/nori_spec.rb+5 −3 modified@@ -367,7 +367,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 @@ -407,12 +408,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|
c5e07f5c32e6fixed spec for remote code execution vulnerability
1 file changed · +5 −3
spec/nori/nori_spec.rb+5 −3 modified@@ -369,7 +369,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 @@ -409,12 +410,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|
2ca6f8603e40fixed YAML remote code execution vulnerability
2 files changed · +7 −3
CHANGELOG.md+7 −1 modified@@ -1,3 +1,9 @@ +== master + +* Fix for remote code execution bug. For more in-depth information, read about the + recent [Rails hotfix](https://groups.google.com/forum/?fromgroups=#!topic/rubyonrails-security/61bkgvnSGTQ). + Please make sure to upgrade now! + == 1.0.2 (2011-07-04) * Fix: When specifying a custom formula to convert tags, XML attributes were ignored. @@ -54,7 +60,7 @@ == 0.2.1 (2011-05-15) -* Fix: Changed XML attributes converted to Hash keys to be prefixed with an @-sign. +* Fix: Changed XML attributes converted to Hash keys to be prefixed with an @-sign. This avoids problems with attributes and child nodes having the same name. <multiRef id="id1">
lib/nori/xml_utility_node.rb+0 −2 modified@@ -52,9 +52,7 @@ def self.available_typecasts=(obj) self.typecasts["decimal"] = lambda { |v| v.nil? ? nil : BigDecimal(v.to_s) } self.typecasts["double"] = lambda { |v| v.nil? ? nil : v.to_f } self.typecasts["float"] = lambda { |v| v.nil? ? nil : v.to_f } - self.typecasts["symbol"] = lambda { |v| v.nil? ? nil : v.to_sym } self.typecasts["string"] = lambda { |v| v.to_s } - self.typecasts["yaml"] = lambda { |v| v.nil? ? nil : YAML.load(v) } self.typecasts["base64Binary"] = lambda { |v| v.unpack('m').first } self.available_typecasts = self.typecasts.keys
818f5263b1d5fixed YAML remote code execution vulnerability
2 files changed · +7 −3
CHANGELOG.md+7 −1 modified@@ -1,3 +1,9 @@ +# 2.0.2 (2013-01-09) + +* Fix for remote code execution bug. For more in-depth information, read about the + recent [Rails hotfix](https://groups.google.com/forum/?fromgroups=#!topic/rubyonrails-security/61bkgvnSGTQ). + Please make sure to upgrade now! + # 2.0.1 (2012-12-28) * Fix: [#29](https://github.com/savonrb/nori/issues/29) Nori now properly parses XML @@ -113,7 +119,7 @@ Please make sure to read the updated README for how to use the new version. ## 0.2.1 (2011-05-15) -* Fix: Changed XML attributes converted to Hash keys to be prefixed with an @-sign. +* Fix: Changed XML attributes converted to Hash keys to be prefixed with an @-sign. This avoids problems with attributes and child nodes having the same name. <multiRef id="id1">
lib/nori/xml_utility_node.rb+0 −2 modified@@ -77,9 +77,7 @@ def self.available_typecasts=(obj) self.typecasts["decimal"] = lambda { |v| v.nil? ? nil : BigDecimal(v.to_s) } self.typecasts["double"] = lambda { |v| v.nil? ? nil : v.to_f } self.typecasts["float"] = lambda { |v| v.nil? ? nil : v.to_f } - self.typecasts["symbol"] = lambda { |v| v.nil? ? nil : v.to_sym } self.typecasts["string"] = lambda { |v| v.to_s } - self.typecasts["yaml"] = lambda { |v| v.nil? ? nil : YAML.load(v) } self.typecasts["base64Binary"] = lambda { |v| v.unpack('m').first } self.available_typecasts = self.typecasts.keys
d9b68667249bfixed YAML remote code execution vulnerability
2 files changed · +7 −3
CHANGELOG.md+7 −1 modified@@ -1,3 +1,9 @@ +## master + +* Fix for remote code execution bug. For more in-depth information, read about the + recent [Rails hotfix](https://groups.google.com/forum/?fromgroups=#!topic/rubyonrails-security/61bkgvnSGTQ). + Please make sure to upgrade now! + ## 1.1.3 (2012-07-12) * Fix: Merged [pull request 21](https://github.com/rubiii/nori/pull/21) to fix an @@ -77,7 +83,7 @@ ## 0.2.1 (2011-05-15) -* Fix: Changed XML attributes converted to Hash keys to be prefixed with an @-sign. +* Fix: Changed XML attributes converted to Hash keys to be prefixed with an @-sign. This avoids problems with attributes and child nodes having the same name. <multiRef id="id1">
lib/nori/xml_utility_node.rb+0 −2 modified@@ -77,9 +77,7 @@ def self.available_typecasts=(obj) self.typecasts["decimal"] = lambda { |v| v.nil? ? nil : BigDecimal(v.to_s) } self.typecasts["double"] = lambda { |v| v.nil? ? nil : v.to_f } self.typecasts["float"] = lambda { |v| v.nil? ? nil : v.to_f } - self.typecasts["symbol"] = lambda { |v| v.nil? ? nil : v.to_sym } self.typecasts["string"] = lambda { |v| v.to_s } - self.typecasts["yaml"] = lambda { |v| v.nil? ? nil : YAML.load(v) } self.typecasts["base64Binary"] = lambda { |v| v.unpack('m').first } self.available_typecasts = self.typecasts.keys
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
12- github.com/advisories/GHSA-4936-rj25-6wm6ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2013-0285ghsaADVISORY
- seclists.org/oss-sec/2013/q1/304nvdWEB
- github.com/rubysec/ruby-advisory-db/blob/master/gems/nori/CVE-2013-0285.ymlghsaWEB
- github.com/savonrb/nori/commit/2ca6f8603e406f884a8fcea6bc26f8f6bf168f40ghsaWEB
- github.com/savonrb/nori/commit/4bcf59abdcec6bcd1153241b122eda61a494e4fbghsaWEB
- github.com/savonrb/nori/commit/818f5263b1d597b603d46cbe1702cd2717259e32ghsaWEB
- github.com/savonrb/nori/commit/c3fdce7a2d2670b44f1cda35da0ae73cc1372084ghsaWEB
- github.com/savonrb/nori/commit/c5e07f5c32e615f0a4a7ee2782d37f7a33261be4ghsaWEB
- github.com/savonrb/nori/commit/d9b68667249b98776fb23ba9e9c548dc4b524709ghsaWEB
- web.archive.org/web/20130203232028/https://support.cloud.engineyard.com/entries/22915701-january-14-2013-security-vulnerabilities-httparty-extlib-crack-nori-update-these-gems-immediatelyghsaWEB
- support.cloud.engineyard.com/entries/22915701-january-14-2013-security-vulnerabilities-httparty-extlib-crack-nori-update-these-gems-immediatelynvd
News mentions
0No linked articles in our index yet.