Skip to content

Commit e89a31b

Browse files
committed
Add warning about the use of IdpMetadataParser class. If Metadata URLs are provided by 3rd parties, the URL inputs MUST be validated to avoid issues like SSRF
1 parent bff32ac commit e89a31b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ can create an XML External Entity (XXE) vulnerability if the XML data is not tru
152152
However, ruby-saml never enables this dangerous Nokogiri configuration;
153153
ruby-saml never enables DTDLOAD, and it never disables NONET.
154154

155+
The OneLogin::RubySaml::IdpMetadataParser class does not validate in any way the URL that is introduced in order to be parsed. Usually is the same administrator that handles the Service Provider the ones that set the URL that should belong to a trusted third-party IdPs.
156+
But there are other scenarios, like a SAAS app where the administrator of the app delegates on other administrators. In such case, extra protection should be taken in order to validate such URL inputs and avoid attacks like SSRF, that could be prevented with the use of the [ssrf_filter](https://rubygems.org/gems/ssrf_filter) gem.
157+
158+
155159

156160
## Getting Started
157161
In order to use the toolkit you will need to install the gem (either manually or using Bundler), and require the library in your Ruby application:

lib/onelogin/ruby-saml/idp_metadata_parser.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ module RubySaml
1111

1212
# Auxiliary class to retrieve and parse the Identity Provider Metadata
1313
#
14+
# This class does not validate in any way the URL that is introduced,
15+
# make sure to validate it properly before use it in a parse_remote method.
16+
# Read the `Security warning` section of the README.md file to get more info
17+
#
1418
class IdpMetadataParser
1519

1620
module SamlMetadata

0 commit comments

Comments
 (0)