]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 621090 - [SECURITY] Adding saved searches lacks CSRF protection
authorDavid Lawrence <dlawrence@mozilla.com>
Fri, 7 Jan 2011 04:02:28 +0000 (23:02 -0500)
committerDavid Lawrence <dlawrence@mozilla.com>
Fri, 7 Jan 2011 04:02:28 +0000 (23:02 -0500)
r/a=mkanat

buglist.cgi
template/en/default/global/per-bug-queries.html.tmpl
template/en/default/list/list.html.tmpl

index bd285ebc099cf8869196143fa053c2f6ea465f97..ebce66532084839502c78d05f2f944f4b418aafb 100755 (executable)
@@ -504,6 +504,8 @@ elsif (($cmdtype eq "doit") && defined $cgi->param('remtype')) {
         my $query_name = $cgi->param('newqueryname');
         my $new_query = $cgi->param('newquery');
         my $query_type = QUERY_LIST;
+        my $token = $cgi->param('token');
+        check_hash_token($token, ['savedsearch']);
         # If list_of_bugs is true, we are adding/removing individual bugs
         # to a saved search. We get the existing list of bug IDs (if any)
         # and add/remove the passed ones.
index 3c62e35f547cf5a9ec981446e811c2941ee41bd5..a7c073ba1ff12ca77d439929ec2d008c9d9ed9a8 100644 (file)
@@ -63,6 +63,7 @@
         <input type="hidden" name="cmdtype" value="doit">
         <input type="hidden" name="remtype" value="asnamed">
         <input type="hidden" name="list_of_bugs" value="1">
+        <input type="hidden" name="token" value="[% issue_hash_token(['savedsearch']) FILTER html %]">
         <select id="lob_action" name="action" onchange="update_text();">
           <option value="add">Add</option>
           [% IF lists_of_bugs.size %]
index 4ebc7194cc6fa9d788e7b01dc3babddfbd3d212b..924ce23dcfd0f64fc54ca2cefc0085c24c62dcb0 100644 (file)
                  value="[% urlquerypart FILTER html %][% "&order=$qorder" FILTER html IF order %]">
           <input type="hidden" name="cmdtype" value="doit">
           <input type="hidden" name="remtype" value="asnamed">
+          <input type="hidden" name="token" value="[% issue_hash_token(['savedsearch']) FILTER html %]">
           <input type="text" id="save_newqueryname" name="newqueryname" size="20"
                  value="[% defaultsavename FILTER html %]"> 
         </form>