Skip to content

Commit 171a41e

Browse files
committed
Release 1.3.0
1 parent a571f52 commit 171a41e

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Ruby SAML [![Build Status](https://secure.travis-ci.org/onelogin/ruby-saml.png)](http://travis-ci.org/onelogin/ruby-saml) [![Coverage Status](https://coveralls.io/repos/onelogin/ruby-saml/badge.svg?branch=master%0A)](https://coveralls.io/r/onelogin/ruby-saml?branch=master%0A) [![Gem Version](https://badge.fury.io/rb/ruby-saml.svg)](http://badge.fury.io/rb/ruby-saml)
22

3+
## Updating from 1.2.x to 1.3.X
4+
5+
Version `1.3.0` is a recommended update for all Ruby SAML users as it includes security fixes. It adds security improvements in order to prevent Signature wrapping attacks. [CVE-2016-5697](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5697)
6+
37
## Updating from 1.1.x to 1.2.X
48

59
Version `1.2` adds IDP metadata parsing improvements, uuid deprecation in favour of SecureRandom, refactor error handling and some minor improvements

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# RubySaml Changelog
22

3+
### 1.3.0 (June 24, 2016)
4+
* [Security Fix](https://github.com/onelogin/ruby-saml/commit/a571f52171e6bfd87db59822d1d9e8c38fb3b995) Add extra validations to prevent Signature wrapping attacks
5+
* Fix XMLSecurity SHA256 and SHA512 uris
6+
* [#326](https://github.com/onelogin/ruby-saml/pull/326) Fix Destination validation
7+
38
### 1.2.0 (April 29, 2016)
49
* [#269](https://github.com/onelogin/ruby-saml/pull/269) Refactor error handling; allow collect error messages when soft=true (normal validation stop after find first error)
510
* [#289](https://github.com/onelogin/ruby-saml/pull/289) Remove uuid gem in favor of SecureRandom

lib/onelogin/ruby-saml/response.rb

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def status_code
173173
node = REXML::XPath.first(
174174
document,
175175
"/p:Response/p:Status/p:StatusCode",
176-
{ "p" => PROTOCOL, "a" => ASSERTION }
176+
{ "p" => PROTOCOL }
177177
)
178178
node.attributes["Value"] if node && node.attributes
179179
end
@@ -186,7 +186,7 @@ def status_message
186186
node = REXML::XPath.first(
187187
document,
188188
"/p:Response/p:Status/p:StatusMessage",
189-
{ "p" => PROTOCOL, "a" => ASSERTION }
189+
{ "p" => PROTOCOL }
190190
)
191191
node.text if node
192192
end
@@ -441,41 +441,40 @@ def validate_signed_elements
441441
{"ds"=>DSIG}
442442
)
443443
signed_elements = []
444-
seis = []
445-
ids = []
444+
verified_seis = []
445+
verified_ids = []
446446
signature_nodes.each do |signature_node|
447447
signed_element = signature_node.parent.name
448448
if signed_element != 'Response' && signed_element != 'Assertion'
449-
return append_error("Found an unexpected Signature Element. SAML Response rejected")
449+
return append_error("Invalid Signature Element '#{signed_element}'. SAML Response rejected")
450450
end
451451

452452
if signature_node.parent.attributes['ID'].nil?
453-
return append_error("Signed Element must contain ID. SAML Response rejected")
453+
return append_error("Signed Element must contain an ID. SAML Response rejected")
454454
end
455455

456456
id = signature_node.parent.attributes.get_attribute("ID").value
457-
if ids.include?(id)
457+
if verified_ids.include?(id)
458458
return append_error("Duplicated ID. SAML Response rejected")
459459
end
460-
ids.push(id)
460+
verified_ids.push(id)
461461

462462
# Check that reference URI matches the parent ID and no duplicate References or IDs
463463
ref = REXML::XPath.first(signature_node, ".//ds:Reference", {"ds"=>DSIG})
464464
if ref
465465
uri = ref.attributes.get_attribute("URI")
466466
if uri && !uri.value.empty?
467467
sei = uri.value[1..-1]
468-
id = signature_node.parent.attributes.get_attribute("ID").value
469468

470469
unless sei == id
471470
return append_error("Found an invalid Signed Element. SAML Response rejected")
472471
end
473472

474-
if seis.include?(sei)
473+
if verified_seis.include?(sei)
475474
return append_error("Duplicated Reference URI. SAML Response rejected")
476475
end
477476

478-
seis.push(sei)
477+
verified_seis.push(sei)
479478
end
480479
end
481480

lib/onelogin/ruby-saml/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module OneLogin
22
module RubySaml
3-
VERSION = '1.2.0'
3+
VERSION = '1.3.0'
44
end
55
end

0 commit comments

Comments
 (0)