11 Commits

Author SHA1 Message Date
Stevani Andolo
429c403c3f
MDL-78215 core: support checking if 0.0.0.0 is in subnet 2023-06-08 09:36:00 +08:00
David Mudrák
6e5454780d MDL-72203 curl: Warn if someone actually started to use $maxredirects
The new parameter of curl_security_helper::url_is_blocked() introduced
in MDL-71916 became part of the API. Even if we reverted it quickly,
someone can use a released Moodle version that has that parameter in
place. For that reason and also to avoid potential troubles in the
future (e.g. when yet another argument would be added to this method),
we need to make it clear that the second parameter of this method should
never be used again.

Poor $maxredirects, you did not live long with us. Oh well.
2021-07-27 21:30:16 +08:00
David Mudrák
c619cd1425 MDL-72203 curl: Revert original fix of redirects to blocked URLs
This reverts the original fix introduced in MDL-71916. It introduced an
extra native cURL call inside curl_security_helper to check if the given
URL triggers a redirect to a blocked URL or not.

Shortly after the release, a couple of regressions were reported as a
result of the integrated solution. It was agreed to revert the fix and
progress with implementing an alternative approach.
2021-07-27 21:30:16 +08:00
Michael Hawkins
0afab1d0f9 MDL-71916 lib: Check cURL redirects for blocked URLs before following 2021-07-06 23:45:59 +02:00
David Mudrák
dbaeeeb0ec MDL-69050 lang: Fix variables and methods names in curl_security_helper
The code has been using terms that were found exclusive and potentially
derogatory. Fixing the terms and making the variables and methods
consistent with the related admin settings.
2020-09-24 19:41:57 +02:00
Cameron Ball
9aa776a848 MDL-61143 core_files: Don't append dot when checking domain names or IP addresses.
Previously we appended a dot at the end of IP addresses and domain names in the
cURL security helper, but it causes issues with Google OAuth so this patch removes it.
2018-01-10 15:22:17 +08:00
Cameron Ball
fbe7f1f8ba MDL-61143 core_files: Block hosts that cannot be determined to be an IP address of domain name
Freaky deaky Unicode/octal/hex domains can be resolved by cURL but are technically not valid.

This patch causes anything that Moodle does not consider to be a valid domain or IP to be blocked
by the cURL security helper.
2018-01-09 16:54:32 +08:00
Cameron Ball
cae2eb357d MDL-61143 core_files: Check all A records when testing blocked IPs 2018-01-09 16:54:32 +08:00
Jake Dallimore
e858840437 MDL-58057 core_files: properly trim curl whitelist config when fetching 2017-03-07 09:49:22 +08:00
Jake Dallimore
a448a38b1d MDL-57274 upgrade: fix curl security notices during upgrade/install
Handles the case where $CFG->curlsecurityxxx vars don't yet exist
during install or upgrade by treating not set the same as empty.
2017-02-20 08:55:57 +08:00
Jake Dallimore
f6d9efefaa MDL-48498 core_files: curl_security_helper_base and implementation
Base class and core implementation providing a means to check URLs
against the curl security admin settings entries.
2016-11-08 15:11:15 +08:00