From: Reed Loden Date: Tue, 29 May 2012 14:50:08 +0000 (-0700) Subject: Bug 754673 - CSRF vulnerability in query.cgi allows possible unauthorized use of... X-Git-Tag: bugzilla-4.3.2~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19b514899d02fde1c53916fe0c0a364548c6ab8d;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 47be93125e..df3d9cadf5 100755 --- a/query.cgi +++ b/query.cgi @@ -20,6 +20,7 @@ use Bugzilla::Product; use Bugzilla::Keyword; use Bugzilla::Field; use Bugzilla::Install::Util qw(vers_cmp); +use Bugzilla::Token; ############### # Subroutines # @@ -72,6 +73,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 78479e7bfe..723825a3c2 100644 --- a/template/en/default/search/knob.html.tmpl +++ b/template/en/default/search/knob.html.tmpl @@ -62,7 +62,8 @@ [% IF userdefaultquery %]

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

[% END %]