Skip to content

Commit 277b642

Browse files
committed
Add warning about the use of OneLogin_Saml2_IdPMetadataParser class
1 parent 201ea4b commit 277b642

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,13 @@ There's an easier method -- use a metadata exchange. Metadata is just an XML fi
522522

523523
Using ````parse_remote```` IdP metadata can be obtained and added to the settings without further ado.
524524

525+
Take in mind that the OneLogin_Saml2_IdPMetadataParser class does not validate in any way the URL that is introduced in order to be parsed.
526+
527+
Usually the same administrator that handles the Service Provider also sets the URL to the IdP, which should be a trusted resource.
528+
529+
But there are other scenarios, like a SAAS app where the administrator of the app delegates this functionality to other users. In this case, extra precaution should be taken in order to validate such URL inputs and avoid attacks like SSRF.
530+
531+
525532
``
526533
idp_data = OneLogin_Saml2_IdPMetadataParser.parse_remote('https://example.com/auth/saml2/idp/metadata')
527534
``

src/onelogin/saml2/idp_metadata_parser.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
class OneLogin_Saml2_IdPMetadataParser(object):
2424
"""
2525
A class that contain methods related to obtaining and parsing metadata from IdP
26+
27+
This class does not validate in any way the URL that is introduced,
28+
make sure to validate it properly before use it in a get_metadata method.
2629
"""
2730

2831
@classmethod

0 commit comments

Comments
 (0)