I use Zend_Db_Table to manage my MySQL connections. They works great, but there's just one HUGE security problem.
If there's an error, like MySQL is down, ZF throws an exception with the db connection username and password.
Here for example, I've set a wrong db password in my configuration. This is the exception thrown.
exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES)' in /Users/claudiocanino/Dev/htdocs/include/Zend/Db/Adapter/Pdo/Abstract.php:129
Stack trace:
#0 /Users/claudiocanino/Dev/htdocs/include/Zend/Db/Adapter/Pdo/Abstract.php(129): PDO->__construct('mysql:dbname=ci...', 'root', 'rootads', Array)
#1 /Users/claudiocanino/Dev/htdocs/include/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
#2 /Users/claudiocanino/Dev/htdocs/include/Zend/Db/Adapter/Abstract.php(459): Zend_Db_Adapter_Pdo_Mysql->_connect()
...
And here it is the username and password in clear. How can I modify the Zend_Db_Table class so it don't show sensible informations into its exceptions?
Thanks
productionenvironment, there is no stack trace shown. In fact, there is no exception shown at all, just what you define in yourErrorController/view.resources.frontController.params.displayExceptionssetting in your php.ini. If it is1(or non-zero) then the exception is shown regardless of the environment.