UTF-8 encoded HTTP header value with a multi-byte character causes a 400 Bad Request response on some requests

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 10.2.10, 10.5.3
    • Affects Version/s: 10.0.0, 10.1.1, 10.2.0, 10.3.0, 10.4.0, 10.5.0
    • Component/s: Repositories
    • None
    • Severity 2 - Major

      Issue Summary

      Sending a UTF-8 encoded HTTP header value that contains a multi-byte character causes Bitbucket to respond with 400 Bad Request. This header could also be added by authenticating reverse proxies that add more metadata to the request.

      Steps to Reproduce

      1. Configure your browser or reverse proxy to add any HTTP header with a UTF-8 multi-byte value
      2. Browse to /projects/<PROJECT>/repos/<REPO>/commits

      Expected Results

      The commits are displayed.

      Actual Results

      The below exception is thrown in the xxxxxxx.log file:

      org.springframework.security.web.firewall.RequestRejectedException: The request was rejected because the header: "headername" has a value "xxxxxxxx" that is not allowed.
      

      Workaround

      Disable the HTTP firewall by putting this setting in your bitbucket.properties:

      http.firewall.strict=false
      

              Assignee:
              Unassigned
              Reporter:
              Wolfgang Kritzinger
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: