-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
"Fatal error: Uncaught exception 'PDOException' "- password issue #2337
Comments
Hello, This is because you have We can't do anything about this. |
What if I do not have the possibility to change these parameters? According to me, the code should be immune to this problem. |
You shouldn't display technical-layer exceptions to the end user anyway. These parameters are displayed because XDebug is installed in your production system (first problem), because it collects parameters by default (second problem) and because you are displaying exceptions in a user-facing application (third problem). These are all well known security-affecting mis-configurations. If you do not have access to your production environment, then please contact who has access to it IMMEDIATELY. |
What about Apache error_log?:
|
Same thing: traces should not collect parameters. Fix that xdebug config ;-) |
This is not the fault of the xdebug settings because I do not have that module installed in the system. |
Ah yes, I see that indeed the defaults of PHP are to show the trace parameters: https://3v4l.org/ms3TK Sorry, I was looking at the wrong traces (HHVM). There is no way to prevent that from happening: the methods need to be called with that information, and |
The solution is to patch the file "PDOMySql\driver.php" and similar as I described in the first post. |
That would be exception suppressing, leading to a crash later on (connection is null), which is likely going to contain a similar trace anywhere. Even if you have something referencing your config and throwing an exception you will have the same issues. |
It will trace but not the lines containing functions with password and username as arguments. A problem is precisely their display. |
Right, and that will happen for DB passwords, API keys, SMTP credentials, etc etc. This is not to be fixed by the library itself: we are supposed to give a clear statement of what is going on to the developer. |
OK I understand. Thanks for the clarification. |
However, the problem exists and the current code is not safe :( |
Then any code producing a stack trace is affected (PHP itself). The issue here (in first place) is caused by producing output of technical-layer-level exceptions, which is a no-go for production environments. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
When a password error when connecting an error is displayed (in the browser or Apache error log)
with unencrypted password and username:
Fix e.g. PDOMySql\driver.php line 34:
The text was updated successfully, but these errors were encountered: