Searching for username with underscore on rate limiting exception using MySQL doesn't work as expected

XMLWordPrintable

    • 8
    • 2
    • Severity 3 - Minor
    • 0

      Issue Summary

      Note: the issue described here is applicable to Jira running on MySQL database.

      Searching for the user with an underscore, e.g., "T_STI" in rate limit exception page returns no result.

      • URL: <BASE_URL>/plugins/servlet/ratelimiting#exemptions
      1. Jira does not escape underscore "_" in SQL searches using LIKE and that causes unexpected behavior when searching for users.
      2. Jira searches for users using fields lower_user_name, lower_display_name and lower_email_address. However, the front end does an extra filter and only uses the lower_user_name.

      This is reproducible on Data Center: yes

      Steps to Reproduce

      • Step 1
        1. Create the following users having the user full name.
          Carlo Battisti 1
          Carlo Battisti 2
          Alfiero Battisti 1
          Alfiero Battisti 2
          Dea Battisti 1
          Dea Battisti 2
          Dea Battisti 3
          Lucio Battisti 1
          Lucio Battisti 2
          Lucio Battisti 3
          
        • It should look like this.
      • Step 2
        1. Create a user having the username "T_STI".
      • Step 3
        1. Go to Rate Limit and enable it.
          1. URL: <BASE_URL>/plugins/servlet/ratelimiting
      • Step 4
        1. Still on the rate limit page, go to exception, add an exception.
        2. Search for "T_STI".

      Expected Results

      You find the user T_STI

      Actual Results

      You don't find the user T_STI.

      Workaround

      Apply the rate-limiting to the user via REST API endpoint:

      <BASE_URL>/rest/rate-limiting/latest/admin/rate-limit/settings/users/token-bucket/

      Using the payload:

      {"tokenBucketSettings":{"capacity":50,"fillRate":10,"intervalFrequency":1,"intervalTimeUnit":"SECONDS"},"userIds":["admin"]}
      

            Assignee:
            Rory Armstrong (Inactive)
            Reporter:
            Mateus Gomes (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: