Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-50129

Bug detected in auth/cas plugin

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.7.7, 2.8.5
    • Fix Version/s: None
    • Component/s: Authentication, Libraries
    • Labels:

      Description

      Hi,

      We found a possible bug when proxy settings when we defined as CAS authentication method.

      The problem is given in the file ... /auth/cas/auth.php, specifically in the line 218.

      CAS configuration in the hostname parameter, we have configured the CAS server with the hostname "www.xxxxx.org". When on line 218:

      if (! empty ($CFG-> proxyhost) &&! is_proxybypass ($this->config->hostname)) {

      is_proxybypass function returns false when it should return true. And this is because when in the is_proxybypass function in ../lib/moodlelib.php in the parse_url function ($url, PHP_URL_HOST) returns null because don`t understand the hostname syntax "www.xxxx.org", but understand this other sytanx "https://www.xxx.org".

      To solve this, we had to make the following change in code, adding the string "https://" in the line 218 of the file ... /auth/cas/auth.php:

      if (! empty ($CFG->proxyhost) && is_proxybypass ('https: //' . $this->config->hostname)) {

      In this way it ensures that the hostname is returned properly and returns a NULL and therefore can not properly configure the proxy.

      I pray to review this part of the code to add the bug in the next updates.

      Regards

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              eduhernandezm Eduardo Hm
              Peer reviewer:
              Simey Lameze
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: