Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IdPMetadataParser: unconditionally disables certificate validation for HTTPS #522

Open
aburch opened this issue Apr 13, 2022 · 2 comments
Open

Comments

@aburch
Copy link

aburch commented Apr 13, 2022

The OneLogin_Saml2_IdPMetadataParser::parseRemoteXML function allows to retrieve the metadata file over HTTPS.
However, it unconditionally disables certificate validation:

https://github.com/onelogin/php-saml/blob/4f94a76934d9900ef0bac349182907f4b7e554ae/lib/Saml2/IdPMetadataParser.php#L40

This seems a bad choice as it bypasses the reason to use HTTPS (integrity protection).

@pitbulk
Copy link
Contributor

pitbulk commented Dec 29, 2022

@aburch We should at least add a parameter to the parseRemoteXML method:

($url, $entityId = null, $desiredNameIdFormat = null, $desiredSSOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT, $desiredSLOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT, $validatePeer = false)

and then use it

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $validatePeer);

Do you want to provide a PR?

@TheJosh
Copy link

TheJosh commented May 8, 2023

This disabling of validation is dangerous and renders this method unusable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants