-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Password displayed in cleartext on Result instance #1049
Comments
Follow-up question- would y'all accept a PR which overrides the
This issue actually came up in our production codebase recently, where an engineer copy/pasted a Result object from the prod database into a GitHub comment without realizing that it contained the cleartext password. This in turn triggered emails which included the comment (and therefore the cleartext prod DB password) to be sent to multiple people watching the GH repo. I could also see this issue coming up if someone's repo is outputting these two classes to a logfile or 3rd-party logging service somewhere. Assuming there are no dependencies on the string-ified classes containing the password (and I can't imagine there would be), it seems like a PR to address this would be low-hanging fruit. |
Aha, great explanation of the problem. Changing a password is not useful after the initial connection. I think the sensible thing to do is have the C code internalize the password, or even remove it from memory entirely, once it's part of the MySQL connection structure. Rather than overriding |
I'm not a C engineer so I don't have context on the time it would take to accomplish this. Is this issue time sensitive, given its security implications? And if so, would overriding |
Also, in retrospect- I feel I should have submitted this issue as a private message or otherwise followed Responsible Disclosure guidelines. My apologies if that's the preferred path for issues like this. Would emailing you directly on the email on your GH profile have been appropriate in this case? |
Not hard.
No.
In this case no. The password is not leaked externally, and not based on input from an external user. This is in the realm of user error. That said, I consider this user error to be due to a "sharp edge" on this tool, and will be glad to prioritize filing off this sharp edge. |
to avoid leaking credentials in exceptions via #inspect Closes brianmario#1049
Hey there, question for the maintainers. I recently used the Mysql2::Client class to fetch some results from my app's database, and I discovered that the database password is displayed in cleartext in the Mysql2::Result instance's
query_options
instance variable. I reproduced the issue with a throwaway Rails app below:I'm curious as to why this parameter is displayed in cleartext, as opposed to obfuscated when output to the Rails console.
Related question- it makes sense why it's listed among the
@query_options
of the Client class, but I'm curious why it's also listed on the Result class.I trust there's a valid reason, and as a journeyman engineer I'm seeking to learn what that is, to better understand how this gem works. Thanks for building and maintaining this gem, I can only imagine how work it is to manage an open-source project of this scale.
The text was updated successfully, but these errors were encountered: