ruby-saml 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ruby-saml might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 573fb055ce99a95923ac659b58226dc511813b16
4
- data.tar.gz: 0421758aea7faed852223275d20afc55b50f2114
3
+ metadata.gz: e6899da69ca7253760c8766c25579be80e078459
4
+ data.tar.gz: a38aa8ac9f56af0ecc11d2a41143570f3ba2c55f
5
5
  SHA512:
6
- metadata.gz: 2b4c1aeab1619e8f9a25edc5e49cad974f6ca11f33546a77ae60f548ee8d97f03d9f17622124a1343da3c27c75c465b33757abde593a745d5d42714843f4cd3b
7
- data.tar.gz: 2e1e414280a4098a36be4a2be9d32845b941e087df5d799e779a42e548aa19b61b6efe5c230146ef8894f1eba574745415f7d538d47a840868b60742b342874e
6
+ metadata.gz: 9bbe6c965d9d01e30e48e7378d98bfe0daae344f83e3a63349a51df674c9e59bf9f4d1304c01a3e040f1c1aabeb87040d2e1ee9a6866a7161c58fef251ecafcc
7
+ data.tar.gz: ee92e4423bedfb8889b56cb763754cdafd24e4f5ec42cd36e904169af827c14422412f0a5537899abab47a1a210bb9f960439b988f30ff343a1853954a85bafc
@@ -1,5 +1,8 @@
1
1
  # RubySaml Changelog
2
2
 
3
+ ### 0.9.4 (March 5, 2018)
4
+ * Improve the fix for CVE-2017-11428 to parse CDATA properly
5
+
3
6
  ### 0.9.3 (Feb 27, 2018)
4
7
  * Fix vulnerability CVE-2017-11428. Process text of nodes properly, ignoring comments
5
8
 
@@ -42,7 +42,7 @@ module OneLogin
42
42
  # that there all children other than text nodes can be ignored (e.g. comments). If nil is
43
43
  # passed, nil will be returned.
44
44
  def self.element_text(element)
45
- element.texts.join if element
45
+ element.texts.map(&:value).join if element
46
46
  end
47
47
  end
48
48
  end
@@ -1,5 +1,5 @@
1
1
  module OneLogin
2
2
  module RubySaml
3
- VERSION = '0.9.3'
3
+ VERSION = '0.9.4'
4
4
  end
5
5
  end
@@ -0,0 +1,41 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "test_helper"))
2
+
3
+ class UtilsTest < Minitest::Test
4
+ describe "Utils" do
5
+ describe 'element_text' do
6
+ it 'returns the element text' do
7
+ element = REXML::Document.new('<element>element text</element>').elements.first
8
+ assert_equal 'element text', OneLogin::RubySaml::Utils.element_text(element)
9
+ end
10
+
11
+ it 'returns all segments of the element text' do
12
+ element = REXML::Document.new('<element>element <!-- comment -->text</element>').elements.first
13
+ assert_equal 'element text', OneLogin::RubySaml::Utils.element_text(element)
14
+ end
15
+
16
+ it 'returns normalized element text' do
17
+ element = REXML::Document.new('<element>element &amp; text</element>').elements.first
18
+ assert_equal 'element & text', OneLogin::RubySaml::Utils.element_text(element)
19
+ end
20
+
21
+ it 'returns the CDATA element text' do
22
+ element = REXML::Document.new('<element><![CDATA[element & text]]></element>').elements.first
23
+ assert_equal 'element & text', OneLogin::RubySaml::Utils.element_text(element)
24
+ end
25
+
26
+ it 'returns the element text with newlines and additional whitespace' do
27
+ element = REXML::Document.new("<element> element \n text </element>").elements.first
28
+ assert_equal " element \n text ", OneLogin::RubySaml::Utils.element_text(element)
29
+ end
30
+
31
+ it 'returns nil when element is nil' do
32
+ assert_nil OneLogin::RubySaml::Utils.element_text(nil)
33
+ end
34
+
35
+ it 'returns empty string when element has no text' do
36
+ element = REXML::Document.new('<element></element>').elements.first
37
+ assert_equal '', OneLogin::RubySaml::Utils.element_text(element)
38
+ end
39
+ end
40
+ end
41
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-saml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - OneLogin LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-27 00:00:00.000000000 Z
11
+ date: 2018-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uuid
@@ -225,6 +225,7 @@ files:
225
225
  - test/slo_logoutrequest_test.rb
226
226
  - test/slo_logoutresponse_test.rb
227
227
  - test/test_helper.rb
228
+ - test/utils_test.rb
228
229
  - test/xml_security_test.rb
229
230
  homepage: http://github.com/onelogin/ruby-saml
230
231
  licenses:
@@ -247,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
248
  version: '0'
248
249
  requirements: []
249
250
  rubyforge_project: http://www.rubygems.org/gems/ruby-saml
250
- rubygems_version: 2.5.2.1
251
+ rubygems_version: 2.5.1
251
252
  signing_key:
252
253
  specification_version: 4
253
254
  summary: SAML Ruby Tookit
@@ -292,4 +293,5 @@ test_files:
292
293
  - test/slo_logoutrequest_test.rb
293
294
  - test/slo_logoutresponse_test.rb
294
295
  - test/test_helper.rb
296
+ - test/utils_test.rb
295
297
  - test/xml_security_test.rb