From: Reed Loden Date: Tue, 29 May 2012 14:52:31 +0000 (-0700) Subject: Bug 754673 - CSRF vulnerability in query.cgi allows possible unauthorized use of... X-Git-Tag: bugzilla-4.2.2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3004a5e322c3a95c7e51978b917f1547c382bac9;p=thirdparty%2Fbugzilla.git Bug 754673 - CSRF vulnerability in query.cgi allows possible unauthorized use of "Set my default search back to the system default" [r=LpSolit a=LpSolit] --- diff --git a/query.cgi b/query.cgi index b3b9aa443e..bfb79e52c9 100755 --- a/query.cgi +++ b/query.cgi @@ -39,6 +39,7 @@ use Bugzilla::Product; use Bugzilla::Keyword; use Bugzilla::Field; use Bugzilla::Install::Util qw(vers_cmp); +use Bugzilla::Token; my $cgi = Bugzilla->cgi; my $dbh = Bugzilla->dbh; @@ -51,6 +52,8 @@ my $userid = $user->id; if ($cgi->param('nukedefaultquery')) { if ($userid) { + my $token = $cgi->param('token'); + check_hash_token($token, ['nukedefaultquery']); $dbh->do("DELETE FROM namedqueries" . " WHERE userid = ? AND name = ?", undef, ($userid, DEFAULT_QUERY_NAME)); diff --git a/template/en/default/search/knob.html.tmpl b/template/en/default/search/knob.html.tmpl index 17ff63a104..a50f6bd326 100644 --- a/template/en/default/search/knob.html.tmpl +++ b/template/en/default/search/knob.html.tmpl @@ -79,7 +79,8 @@ [% IF userdefaultquery %]

- + Set my default search back to the system default.

[% END %]