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

Details

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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              yue Takayuki Fuwa
              Matteo Scaramuccia, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: