[SERVER-10979] MONGODB-X509 authentication fails against Windows build Created: 30/Sep/13 Updated: 11/Jul/16 Resolved: 03/Oct/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.3 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Bernie Hackett | Assignee: | Bernie Hackett |
| Resolution: | Done | Votes: | 0 |
| Labels: | 26qa, stringdata-use-after-free | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Operating System: | ALL | ||||
| Participants: | |||||
| Description |
|
Tested on Windows 7 with OpenSSL 101e Server:
Client:
Server log:
A Windows client can authenticate to a Linux server, but not a Windows server. A Linux client also can not authenticate to a Windows server. |
| Comments |
| Comment by auto [ 03/Oct/13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'behackett', u'name': u'behackett', u'email': u'bernie@10gen.com'}Message: StringData isn't the right type in this context. Use | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bernie Hackett [ 03/Oct/13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andreas Nilsson [ 02/Oct/13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
milkie Ideally we'd need one from the last few days | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bernie Hackett [ 02/Oct/13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Weirdness continues. From the shell (after rebuilding with a new patch from andreas.nilsson@10gen.com):
Notice I mistyped the user once there. I had previously been copy/pasting the usrename into the shell and wanted to make sure something strange wasn't happening with powershell. Log output:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bernie Hackett [ 02/Oct/13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
sridhar or milkie would know where the Enterprise builds live. I haven't used them yet. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andreas Nilsson [ 02/Oct/13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I need to use a recent version of the Enterprise build then, do you know where I can find it? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bernie Hackett [ 02/Oct/13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Well, I'm running on Windows 7. I also built mongo essentially using the Enterprise Edition build instructions. Maybe there is some incompatibility there? Can you try with the Enterprise Edition builds? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andreas Nilsson [ 02/Oct/13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
behackett I actually can't reproduce this. It works fine for me. Environment info: OS: Windows Server 2012 Standard We need to compare our environments to see what is different. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bernie Hackett [ 01/Oct/13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Done. This is...weird...
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andreas Nilsson [ 01/Oct/13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I still haven't gotten to open my Windows VM yet, behackett would you mind adding the following debug line to line 264 in db/commands/authentication_commands.cpp to check why the comparison fails.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bernie Hackett [ 01/Oct/13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Also, the Windows and Linux builds appear to log different things by default (or possibly have different verbose levels). The build I'm using in both operating systems is the same git hash. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bernie Hackett [ 01/Oct/13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
That message appears to be the shell automatically trying to query a collection it no longer has permissions to access once the first user is added. The thing I find strange is this:
And
Right now I'm just testing against a stand alone mongod. It's weird that the shell is using w: "majority" and trying to automatically call replSetGetStatus in the background. spencer, why is that? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andreas Nilsson [ 01/Oct/13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sorry, pasted the wrong log line:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Spencer Brody (Inactive) [ 01/Oct/13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
That's not an error message, that's just the command being logged - probably because it took >100ms to run. All commands (and CRUD operations) that take longer than the slow query threshold (defaults to 100ms) get logged. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andreas Nilsson [ 01/Oct/13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The problem is that the server cannot match the subject name from the certificate with the subject name provided by the client. On a first glance it looks like an encoding mismatch. I will spin up a Windows VM during the day and check it out. The authorization failure log entry concerns me a little bit
From the timing it looks like it belongs to the auth() call. spencer do you have any idea why this might happen? Also behackett did you see this particular error during successful auth on Linux (I didn't). |