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

Garbled filename when download file using WAF or Load Balancer that implemented on RFC-6266

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 3.1.8, 3.2.5, 3.3
    • Files API
    • None
    • Google Chrome, Firefox on Windows10
    • MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE

      According to RFC-6266(4.3. Disposition Parameter: 'Filename'), 'filename' param on 

      Content-Disposition in HTTP header should be encode.

      But current of lib/filelib.php is not compatible on RFC-6266.

      For example, lib/filelib.php on line 2290, urlencoded only if IE. But, we should urlencode if ANY BROWSERS.

      As a result, when download file named by multi-byte(ex. サンプルファイル.zip), then garbled on some of WAF and Load Balancer implemented on RFC-6266.

      (Using Chrome, Firefox)

       

      In my case, this problem occurred on Azure Application Gateway .

      Bit this problem will occurred on another WAF or LoadBalancer implemented on RFC-6266.

       

      I want to suggest "delete if (core_useragent::is_ie()) { on urlencode to urlencode on any browsers."

       

      if (core_useragent::is_ie()) {
          $filename = urlencode($filename);
      }

       

      to 

      $filename = urlencode($filename);

      on lib/filelib.php line 2263.

            Unassigned Unassigned
            yue Takayuki Fuwa
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.