aws / aws/amazon-documentdb-odbc-driver

Password with symbols/punctuation causes authentication failure

Open
#193 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
6
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Hello,

I've noticed that the appearance of symbols/punctuation in the DocumentDB master password field often results in an authentication failure to the database. I have a CloudFormation template which generates the cluster and its master credentials via Secrets Manager. When excluding some illegal characters in the 99-character password using `ExcludeCharacters: '"@/#%:='` under `GenerateSecretString`, I get the bellow errors as seen in ODBC Data Sources when clicking "Test" and in DocumentDB audit logs in CloudWatch respectively.

![Failure 01](https://github.com/aws/amazon-documentdb-odbc-driver/assets/68220964/d067ace8-16cf-4e63-aeae-47d40adf9628)

![Failure 02](https://github.com/aws/amazon-documentdb-odbc-driver/assets/68220964/9ebc0718-26a8-43b0-9b2e-2f0f465eb33f)

However when I use `ExcludePunctuation: true` to remove all symbols instead of only those specified above, generating a password of only letters and numbers, I get no error and receive the expected response and log shown below.

![Success 01](https://github.com/aws/amazon-documentdb-odbc-driver/assets/68220964/e49b48b2-23fe-470f-bf79-12d4c4a82b23)

![Success 02](https://github.com/aws/amazon-documentdb-odbc-driver/assets/68220964/736616f0-539f-487b-a0c5-052928e6f1bd)

For some reason, the "user" field is blank in the error 18 log shown for the failed authentication, even though the user field is populated when establishing the connection through ODBC Data Sources when using this driver. This appears to be caused by some symbol(s) being present in the password, as the error only occurs when symbols are permitted and does not occur when they are all excluded, but it is unclear which symbol(s) is causing this.

Something to note is that I have a Lambda function which is able to successfully connect to and interact with the database using the connection string and pymongo library, even when the majority of symbols are allowed by using `ExcludeCharacters: '"@/#%:='` instead of `ExcludePunctuation: true`. It is only the ODBC driver which appears to have the issue. The Python Lambda function properly encodes the password before transmitting it in the connection string, using the `urllib.parse.quote()` function.

Does the driver appropriately encode the database password field before attempting to establishing a connection? I also noticed the ODBC driver misinterpreting the password when the "=" symbol is used, also leading me to believe the issue may be related to character escapement.

Thank you.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure through ODBC Data Sources with passwords containing the reported punctuation, especially “=”, and compare it with the working Python Lambda connection that uses urllib.parse.quote(). Trace how the ODBC driver receives and transmits the password, then verify that punctuation is handled correctly without breaking the connection string or authentication.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, cpp, python
Domain
authentication, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.