[SERVER-25059] URL support needs to support percent-encoding (escape sequences) Created: 14/Jul/16  Updated: 28/Aug/17  Resolved: 10/Aug/17

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 3.3.9
Fix Version/s: 3.5.12

Type: Bug Priority: Major - P3
Reporter: Andrew Ryder (Inactive) Assignee: Tyler Kaye
Resolution: Done Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-27997 mongo connection URI cannot connect w... Closed
Related
is related to DOCS-8333 Escape "%", "@", ":", and "/" in user... Closed
Operating System: ALL
Sprint: Platforms 2017-08-21
Participants:

 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.



 Comments   
Comment by Tyler Kaye [ 10/Aug/17 ]

The patch has been pushed to Master in response to SERVER-29921

This should fix the issue

Author:

{'username': 'tkaye407', 'email': 'tyler.kaye@mongodb.com', 'name': 'Tyler Kaye'}

Message: SERVER-29923 Re-write the Mongo Server's URI parser and Testing Suite
Branch: master
https://github.com/mongodb/mongo/commit/880e3c102363611ef09b451737276c0ad9400d11

Generated at Thu Feb 08 04:08:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.