Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-6141

Screenshot attachment allows invalid characters -- Leads to downstream problems

XMLWordPrintable

      When attaching a screenshot to an issue, the user is allowed to enter anything for the filename. If the name happens to include certain, "special characters" this has far reaching implications.

      Case 1: Name has the colon character e.g. "Screenshot1:The login page"
      This is an invalid file name on Windows. What happens is that Jira makes a record in the appropriate table in the database that this issue has an attachment by storing the name of the file. However, the actual attachment never got saved to the \attachmentsdir\issue-number directory. The reason as noted is because a file name of "Screenshot1:The login page" is a no-no per Windows.

      This results in a broken image icon for the thumbnail and an error when clicking on the thumbnail

      Case 2: Name has a percent character e.g. "Item page for 20% discount"
      The percent character has a special meaning when used in a URL. When a user tries to retrieve an attachment named thusly it spawns a thread in the app server that hangs forever. Typical user reaction when not getting a response is to repeat the request – creating another thread. Ad infinitum.

      I think these problems can be prevented by enforcing OS-driven and HTTP-driven naming restrictions.

              dylan@atlassian.com Dylan Etkin [Atlassian]
              f28b37f5f996 Sri Sankaran
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: