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

Module shouldn't use file_get_contents to fetch URLs #25

Open
madmatt opened this issue Jul 31, 2019 · 3 comments
Open

Module shouldn't use file_get_contents to fetch URLs #25

madmatt opened this issue Jul 31, 2019 · 3 comments

Comments

@madmatt
Copy link
Member

madmatt commented Jul 31, 2019

See cross-post issue on silverstripe/fulltextsearch: silverstripe/silverstripe-fulltextsearch#264

This module uses file_get_contents() to post/retrieve data from Solr in some instances. It shouldn't do so, as some servers may have allow_url_fopen disabled in php.ini.

Instead, use of Guzzle (or raw curl) is encouraged for security reasons, mainly to prevent accidental remote code execution/remote file inclusion bugs.

Note that this module explicitly isn't susceptible to RFI vulnerabilities as far as I can tell, but if you're trying to use the module on a hardened server this config value is likely disabled.

edit: Also, renaming the variable from $targetDir would help avoid doubt about whether or not it's a URL. Suggested name: $targetUrl

@madmatt
Copy link
Member Author

madmatt commented Jul 31, 2019

@sminnee
Copy link
Member

sminnee commented Aug 2, 2019

Should title be "Module shouldn't use file_get_contents to fetch URLs"?

@brynwhyman brynwhyman changed the title Module shouldn't use file_get_contents Module shouldn't use file_get_contents to fetch URLs Aug 2, 2019
@madmatt
Copy link
Member Author

madmatt commented Aug 6, 2019

Thanks for changing that @brynwhyman!

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

4 participants