nori 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ == 1.0.3 (2013-01-10)
2
+
3
+ * Fix for remote code execution bug. For more in-depth information, read about the
4
+ recent [Rails hotfix](https://groups.google.com/forum/?fromgroups=#!topic/rubyonrails-security/61bkgvnSGTQ).
5
+ Please make sure to upgrade now!
6
+
1
7
  == 1.0.2 (2011-07-04)
2
8
 
3
9
  * Fix: When specifying a custom formula to convert tags, XML attributes were ignored.
@@ -54,7 +60,7 @@
54
60
 
55
61
  == 0.2.1 (2011-05-15)
56
62
 
57
- * Fix: Changed XML attributes converted to Hash keys to be prefixed with an @-sign.
63
+ * Fix: Changed XML attributes converted to Hash keys to be prefixed with an @-sign.
58
64
  This avoids problems with attributes and child nodes having the same name.
59
65
 
60
66
  <multiRef id="id1">
@@ -1,5 +1,5 @@
1
1
  module Nori
2
2
 
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
 
5
5
  end
@@ -52,9 +52,7 @@ module Nori
52
52
  self.typecasts["decimal"] = lambda { |v| v.nil? ? nil : BigDecimal(v.to_s) }
53
53
  self.typecasts["double"] = lambda { |v| v.nil? ? nil : v.to_f }
54
54
  self.typecasts["float"] = lambda { |v| v.nil? ? nil : v.to_f }
55
- self.typecasts["symbol"] = lambda { |v| v.nil? ? nil : v.to_sym }
56
55
  self.typecasts["string"] = lambda { |v| v.to_s }
57
- self.typecasts["yaml"] = lambda { |v| v.nil? ? nil : YAML.load(v) }
58
56
  self.typecasts["base64Binary"] = lambda { |v| v.unpack('m').first }
59
57
 
60
58
  self.available_typecasts = self.typecasts.keys
@@ -367,7 +367,8 @@ describe Nori do
367
367
  'approved' => nil,
368
368
  'written_on' => nil,
369
369
  'viewed_at' => nil,
370
- 'content' => nil,
370
+ # don't execute arbitary YAML code
371
+ 'content' => { "@type" => "yaml" },
371
372
  'parent_id' => nil,
372
373
  'nil_true' => nil,
373
374
  'namespaced' => nil
@@ -386,7 +387,7 @@ describe Nori do
386
387
  <replies-close-in type="integer">2592000000</replies-close-in>
387
388
  <written-on type="date">2003-07-16</written-on>
388
389
  <viewed-at type="datetime">2003-07-16T09:28:00+0000</viewed-at>
389
- <content type="yaml">--- \n1: should be an integer\n:message: Have a nice day\narray: \n- should-have-dashes: true\n should_have_underscores: true\n</content>
390
+ <content type="yaml">--- \n1: should be an integer\n:message: Have a nice day\narray: \n- should-have-dashes: true\n should_have_underscores: true</content>
390
391
  <author-email-address>david@loudthinking.com</author-email-address>
391
392
  <parent-id></parent-id>
392
393
  <ad-revenue type="decimal">1.5</ad-revenue>
@@ -407,12 +408,13 @@ describe Nori do
407
408
  # Changed this line where the key is :message. The yaml specifies this as a symbol, and who am I to change what you specify
408
409
  # The line in ActiveSupport is
409
410
  # 'content' => { 'message' => "Have a nice day", 1 => "should be an integer", "array" => [{ "should-have-dashes" => true, "should_have_underscores" => true }] },
410
- 'content' => { :message => "Have a nice day", 1 => "should be an integer", "array" => [{ "should-have-dashes" => true, "should_have_underscores" => true }] },
411
+ 'content' => "--- \n1: should be an integer\n:message: Have a nice day\narray: \n- should-have-dashes: true\n should_have_underscores: true",
411
412
  'author_email_address' => "david@loudthinking.com",
412
413
  'parent_id' => nil,
413
414
  'ad_revenue' => BigDecimal("1.50"),
414
415
  'optimum_viewing_angle' => 135.0,
415
- 'resident' => :yes
416
+ # don't create symbols from arbitary remote code
417
+ 'resident' => "yes"
416
418
  }
417
419
 
418
420
  parse(topic_xml)["topic"].each do |k,v|
metadata CHANGED
@@ -1,79 +1,72 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: nori
3
- version: !ruby/object:Gem::Version
4
- hash: 19
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.3
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 2
10
- version: 1.0.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Daniel Harrington
14
9
  - John Nunemaker
15
10
  - Wynn Netherland
16
11
  autorequire:
17
12
  bindir: bin
18
13
  cert_chain: []
19
-
20
- date: 2011-07-04 00:00:00 Z
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
14
+ date: 2013-01-10 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
23
17
  name: nokogiri
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
18
+ requirement: !ruby/object:Gem::Requirement
26
19
  none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 7
31
- segments:
32
- - 1
33
- - 4
34
- - 0
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
35
23
  version: 1.4.0
36
24
  type: :development
37
- version_requirements: *id001
38
- - !ruby/object:Gem::Dependency
39
- name: rspec
40
25
  prerelease: false
41
- requirement: &id002 !ruby/object:Gem::Requirement
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
28
+ requirements:
29
+ - - ! '>='
30
+ - !ruby/object:Gem::Version
31
+ version: 1.4.0
32
+ - !ruby/object:Gem::Dependency
33
+ name: rspec
34
+ requirement: !ruby/object:Gem::Requirement
42
35
  none: false
43
- requirements:
36
+ requirements:
44
37
  - - ~>
45
- - !ruby/object:Gem::Version
46
- hash: 27
47
- segments:
48
- - 2
49
- - 5
50
- - 0
38
+ - !ruby/object:Gem::Version
51
39
  version: 2.5.0
52
40
  type: :development
53
- version_requirements: *id002
54
- - !ruby/object:Gem::Dependency
55
- name: autotest
56
41
  prerelease: false
57
- requirement: &id003 !ruby/object:Gem::Requirement
42
+ version_requirements: !ruby/object:Gem::Requirement
58
43
  none: false
59
- requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- hash: 3
63
- segments:
64
- - 0
65
- version: "0"
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 2.5.0
48
+ - !ruby/object:Gem::Dependency
49
+ name: autotest
50
+ requirement: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
66
56
  type: :development
67
- version_requirements: *id003
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
68
64
  description: XML to Hash translator
69
65
  email: me@rubiii.com
70
66
  executables: []
71
-
72
67
  extensions: []
73
-
74
68
  extra_rdoc_files: []
75
-
76
- files:
69
+ files:
77
70
  - .gitignore
78
71
  - .rspec
79
72
  - .travis.yml
@@ -105,38 +98,29 @@ files:
105
98
  - spec/spec_helper.rb
106
99
  homepage: http://github.com/rubiii/nori
107
100
  licenses: []
108
-
109
101
  post_install_message:
110
102
  rdoc_options: []
111
-
112
- require_paths:
103
+ require_paths:
113
104
  - lib
114
- required_ruby_version: !ruby/object:Gem::Requirement
105
+ required_ruby_version: !ruby/object:Gem::Requirement
115
106
  none: false
116
- requirements:
117
- - - ">="
118
- - !ruby/object:Gem::Version
119
- hash: 3
120
- segments:
121
- - 0
122
- version: "0"
123
- required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
124
112
  none: false
125
- requirements:
126
- - - ">="
127
- - !ruby/object:Gem::Version
128
- hash: 3
129
- segments:
130
- - 0
131
- version: "0"
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
132
117
  requirements: []
133
-
134
118
  rubyforge_project: nori
135
- rubygems_version: 1.8.5
119
+ rubygems_version: 1.8.24
136
120
  signing_key:
137
121
  specification_version: 3
138
122
  summary: XML to Hash translator
139
- test_files:
123
+ test_files:
140
124
  - spec/nori/core_ext/hash_spec.rb
141
125
  - spec/nori/core_ext/object_spec.rb
142
126
  - spec/nori/core_ext/string_spec.rb