Commit 19b51489 authored by Reed Loden's avatar Reed Loden

Bug 754673 - CSRF vulnerability in query.cgi allows possible unauthorized use of…

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]
parent a196f9ce
......@@ -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));
......
......@@ -62,7 +62,8 @@
[% IF userdefaultquery %]
<p>
<a href="query.cgi?nukedefaultquery=1">
<a href="query.cgi?nukedefaultquery=1&amp;token=
[%- issue_hash_token(['nukedefaultquery']) FILTER uri %]">
Set my default search back to the system default</a>.
</p>
[% END %]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment