#34628 [Opn->Bgs]: Showing database's pass in PDOException

From: Date: Sat, 24 Sep 2005 13:26:47 +0000
Subject: #34628 [Opn->Bgs]: Showing database's pass in PDOException
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85535@lists.php.net to get a copy of this message
ID: 34628 Updated by: tony2001@php.net Reported By: darkspirit at strefaphp dot net -Status: Open +Status: Bogus Bug Type: PDO related Operating System: WindowsXp Home SP2 PHP Version: 5.1.0RC1 New Comment: The trace should be used for debugging purposes only. Password or any other valuable data (like credit card number or SIN) will appear in trace and that's expected since PHP can't guess if a data is valuable or not and considers all the arguments as only arguments. Previous Comments: ------------------------------------------------------------------------ [2005-09-24 14:46:23] darkspirit at strefaphp dot net Description: ------------ While constructing PDO object and trying to connect with database, in case something goes wrong, an exception is reportted. Everything is ok unless you want to display trace of exception or exception's object. In this case all required information for connecting with database are displayed. Reproduce code: --------------- catch (PDOException $e) { echo $e -> getTrace(); echo $e; } Expected result: ---------------- exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user: 'root@localhost' (Using password: YES)' in c:\htdocs\opb\opb\includes\main.php:146 Stack trace: #0 c:\htdocs\opb\opb\includes\main.php(146): PDO->__construct('mysql:dbname=op...', 'root', 'password') #1 c:\htdocs\opb\opb\index.php5(30): OPB->execute('index') #2 {main} ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34628&edit=1

« previous php.bugs (#85535) next »