#21113 [NEW]: Auth bug
| From: | entis at poczta dot fm | Date: | Fri, 20 Dec 2002 14:20:59 +0000 |
| Subject: | #21113 [NEW]: Auth bug | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-11777@lists.php.net to get a copy of this message | ||
From: entis@poczta.fm
Operating system: winxp
PHP version: 4.2.3
PHP Bug Type: PEAR related
Bug description: Auth bug
there is dangerous bug in Auth package !
In file \Auth\Container\DB.php
In method Auth_Container_DB::fetchData
In lines :
...
$res = $this->query($query);
if (DB::isError($res)) {
return PEAR::raiseError($res->code, PEAR_ERROR_DIE);
} else {
...
compare raiseError definition :
function &raiseError($message = null,
$code = null,
$mode = null,
$options = null,
$userinfo = null,
$error_class = null,
$skipmsg = false)
code should be second parameter and mode should be third parameter.
I check if something go wrong in fetching data from database, this code
don't stop program (PEAR_ERROR_DIE isn't in correct place) and user can
gain unauthorized access. Solution is very simple :
...
$res = $this->query($query);
if (DB::isError($res)) {
return PEAR::raiseError('',$res->code, PEAR_ERROR_DIE);
} else {
...
i have also proposition for Auth::login method :
replace this line :
$login_ok = $this->storage->fetchData($this->username, $this->password);
with this line :
$login_ok = ($this->storage->fetchData($this->username, $this->password)
=== TRUE);
--
Edit bug report at http://bugs.php.net/?id=21113&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=21113&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=21113&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=21113&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=21113&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=21113&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=21113&r=support
Expected behavior: http://bugs.php.net/fix.php?id=21113&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=21113&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=21113&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=21113&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21113&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=21113&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=21113&r=isapi