Repository navigation
Conversation
The DNS check fetched the whois page through the Moodle curl wrapper, which does not verify the TLS peer by default, so a forged response could be displayed in the status report. Enable CURLOPT_SSL_VERIFYPEER for this request. This is a security hardening change.
PM84
force-pushed
the
fix-whois-tls-peer-verification
branch
from
December 2, 2026 20:07
5d29ba4 to
ddf9011
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The DNS check looks up the owner of public IP addresses on
who.isand shows the result in the status report. The HTTPS request does not verify the server certificate, so a forged response could be displayed.Cause
\curlfrom Moodle core setsCURLOPT_SSL_VERIFYPEERto0by default anddnscheck.phpdoes not override it.Fix
dnscheck.phppassesCURLOPT_SSL_VERIFYPEER => 1for thewho.isrequest. If verification fails, the response is empty and the check falls back to the existing output without the organisation name.version.phpis bumped as described in the README.The session check in
index.phpalso uses\curlagainst the site's own URL. I deliberately left it unchanged, because enforcing verification there would break setups that use a self-signed or internal CA certificate on that path.This is a security hardening change.
Tests
php -landphpcs --standard=moodleon the changed files: no findings.version.phpbump); it was not run again on this branch.who.isendpoint.Compatibility
Sites whose PHP/curl installation lacks a usable CA bundle will no longer see the organisation name in the DNS check; the check itself keeps working.
Pull request checks