[SERVER-34495] MongoDB Shell does not validate URI for replicaSet option Created: 16/Apr/18 Updated: 31/Jan/19 Resolved: 31/Jan/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 3.6.3, 3.6.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Arnie Listhaus | Assignee: | Alyson Cabral (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Steps To Reproduce: | Specify a mongodb uri without using the replicaSet option on a replica set whose first member listed is not the primary |
||||||||||||||||
| Sprint: | Security 2018-11-19, Service Arch 2019-02-11 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
The 3.6 version of the MongoDB Shell does not error if the replicaSet option is missing. When missing, connection appears to be to first node in the URI list. In example below, I have used replicaset as the option without an upper case 'S' ie replicaset vs replicaSet.
The same is true if no options or any invalid options are passed. In 3.4, the URI was validated e.g.:
|
| Comments |
| Comment by Alyson Cabral (Inactive) [ 31/Jan/19 ] |
|
I'm going to close this ticket as won't fix, because we will not be going back to requiring you to specify the replica set name (so that you can connect to multiple mongos routers). I believe the 3 linked tickets will mitigate the negative impact of this behavior change. |
| Comment by Alyson Cabral (Inactive) [ 31/Jan/19 ] |
|
OK, great there are 3 tickets I created based on your test cases: (1) (2) (3)
cc: behackett
|
| Comment by Alexey Menshikov [ 31/Jan/19 ] |
|
No. There's only one replica set with name "replset". "replset45" is just a random name of non-existing replica set. |
| Comment by Alyson Cabral (Inactive) [ 31/Jan/19 ] |
|
alexey.menshikov in your test cases is replica45 a real replica set? |
| Comment by Alexey Menshikov [ 30/Jan/19 ] |
|
The issue is confirmed for 3.6 and 4.0. mongoshell ignores low case parameter and able to connect without any replica set name specified or wrong replicaset specified in low case parameter. Test cases: 1. mongo "mongodb://localhost:27017,localhost:27018,localhost:27019/?replicaSet=replset" 2. mongo "mongodb://localhost:27017,localhost:27018,localhost:27019/?replicaSet=replset45" 3. mongo "mongodb://localhost:27017,localhost:27018,localhost:27019/?replicaset=replset45" 4. mongo "mongodb://localhost:27017,localhost:27018,localhost:27019/" 5. mongo "mongodb://localhost:27017,localhost:27018,localhost:27019/?replicaset1kjlh=rlknjasklfnkladsn5" |
| Comment by Daniel Pasette (Inactive) [ 16/Apr/18 ] |
|
This was changed in |