[SERVER-13753] mongod may terminate if x.509 authentication certificate is invalid Created: 27/Apr/14  Updated: 07/Jun/17  Resolved: 29/Apr/14

Status: Closed
Project: Core Server
Component/s: Security
Affects Version/s: None
Fix Version/s: 2.6.2, 2.7.0

Type: Bug Priority: Critical - P2
Reporter: David Hows Assignee: Andreas Nilsson
Resolution: Done Votes: 0
Labels: asp, asp-cve, asp-sdl-reported, asp-vuln-dos
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
Operating System: ALL
Backport Completed:
Participants:

 Description   
Issue Status as of May 29, 2014

ISSUE SUMMARY
mongod terminates when certain types of invalid x.509 certificates are provided for client authentication, printing a brief error message in the log:

2014-04-26T19:05:18.243-0400 [conn2] ERROR: Uncaught std::exception: basic_string::substr, terminating

USER IMPACT
Anyone able to establish a connection with the server can crash it by using an invalid or malformed certificate and x.509 authentication. Only mongod servers compiled with SSL and with x.509 authentication enabled are affected by this issue.

WORKAROUNDS
Disable x.509 authentication or use a version of the server without SSL support.

AFFECTED VERSIONS
MongoDB production releases 2.6.0 and 2.6.1 are affected by this issue.

FIX VERSION
The fix is included in the 2.6.2 production release.

RESOLUTION DETAILS
Check for malformed and invalid certificates in the x.509 authentication circuitry.

Original description

mongod may terminate if x.509 authentication certificate is invalid. The only error reported is the following, just after a client attempts to authenticate

2014-04-26T19:05:18.243-0400 [conn2] ERROR: Uncaught std::exception: basic_string::substr, terminating

Line of code in question is likely:
https://github.com/mongodb/mongo/blob/1249034444dc146eb6177fbe4845e593b807f84d/src/mongo/db/commands/authentication_commands.cpp#L306



 Comments   
Comment by Benety Goh [ 18/Feb/15 ]

Author:

{u'username': u'agralius', u'name': u'Andreas Nilsson', u'email': u'andreas.nilsson@10gen.com'}

Message: SERVER-13573 Fix x.509 auth exception
(cherry picked from commit c151e0660b9736fe66b224f1129a16871165251b)
Branch: v2.6
https://github.com/mongodb/mongo/commit/c22fbc9bc636c4c730569c741a2fb6c46193bf5f

Generated at Thu Feb 08 03:32:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.