From: mkanat%kerio.com <> Date: Sun, 27 Feb 2005 09:08:12 +0000 (+0000) Subject: Bug 283562: Insecure dependency in parameter 3 of DBI::db (login_to_id forgets a... X-Git-Tag: bugzilla-2.19.3~237 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1355d45bdaf91cb4aa506166eb619c2729997bd6;p=thirdparty%2Fbugzilla.git Bug 283562: Insecure dependency in parameter 3 of DBI::db (login_to_id forgets a trick_taint) Patch By Max Kanat-Alexander r=wurblzap, r=joel, a=justdave --- diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 4d4787525d..f87f021b90 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -1013,10 +1013,11 @@ sub is_available_username ($;$) { sub login_to_id ($) { my ($login) = (@_); my $dbh = Bugzilla->dbh; + # $login will only be used by the following SELECT statement, so it's safe. + trick_taint($login); my $user_id = $dbh->selectrow_array( "SELECT userid FROM profiles WHERE login_name = ?", undef, $login); - # $user_id should be a positive integer, this makes Taint mode happy - if (defined $user_id && detaint_natural($user_id)) { + if ($user_id) { return $user_id; } else { return 0;