Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-25059

URL support needs to support percent-encoding (escape sequences)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.3.9
    • Fix Version/s: 3.5.12
    • Component/s: Shell
    • Labels:
      None

      Description

      mongo --authenticationDatabase admin -u MrAt -p @
      MongoDB shell version: 3.3.9
      connecting to: 127.0.0.1:27017/test
      MongoDB server version: 3.2.6
      WARNING: shell and server versions do not match
      ...
      

      Cool.

      mongo mongodb://MrAt:@@localhost/admin
      FailedToParse: Bad digit "@" while parsing @@localhost
      ...
      

      Yeah, fair enough.

      mongo mongodb://MrAt:%40@localhost/admin
      MongoDB shell version: 3.3.9
      connecting to: mongodb://MrAt:%40@localhost/admin
      2016-07-14T16:32:13.168+1000 E QUERY    [thread1] Error: Authentication failed. :
      connect@src/mongo/shell/mongo.js:221:14
      @(connect):1:6
       
      exception: connect failed
      

      Poor MrAt.

      mongo mongodb://MrPercent:%@localhost/admin
      MongoDB shell version: 3.3.9
      connecting to: mongodb://MrPercent:%@localhost/admin
      MongoDB server version: 3.2.6
      WARNING: shell and server versions do not match
      16:29:32@admin>^C
      bye
      

      MrPercent is a happy camper. Although he shouldn't be.

      According to the specification this is the wrong way around. The escaped passwords should work, and the unescaped versions should fail.

      URL option needs to support escape sequences.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                3 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: