Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3390

Support multi-byte UTF-8 characters as percent-encoded escapes in URI

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.16.0
    • Affects Version/s: None
    • Component/s: libmongoc, uri
    • None

      In the auth spec tests, step 4, there are various test cases defined to test SASLprep behavior.

      Examples are given of how usernames and passwords containing unicode characters that need to be UTF-8 encoded and escaped would be specified in a connection string, e.g.

      • mongodb://IX:I%C2%ADX@mongodb.example.com/admin
      • mongodb://%E2%85%A8:IV@mongodb.example.com/admin
      • mongodb://%E2%85%A8:I%C2%ADV@mongodb.example.com/admin

      It seems that since these cases are in the spec libmongoc should be able to successfully parse all these URIs. However, these cases yield the following errors, respectively:

      • Incorrect URI escapes in password
      • Incorrect URI escapes in username. Percent-encode username and password according to RFC 3986
      • Incorrect URI escapes in username. Percent-encode username and password according to RFC 3986

      libmongoc does seem to implement corresponding tests that set these usernames and password via setters (see https://github.com/mongodb/mongo-c-driver/blob/116cde0c2ff07f59ee0afa7831577700d4beb026/src/libmongoc/tests/test-mongoc-scram.c#L515) but I cannot find tests setting them via the connection string.

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            kaitlin.mahar@mongodb.com Kaitlin Mahar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: