From: lpsolit%gmail.com <> Date: Mon, 2 Feb 2009 19:24:28 +0000 (+0000) Subject: Bug 472362: [SECURITY] Malicious attachments can change your user settings (user... X-Git-Tag: bugzilla-3.0.7~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ff0436194004b379ea76699827cc809076e3e5b;p=thirdparty%2Fbugzilla.git Bug 472362: [SECURITY] Malicious attachments can change your user settings (user + email prefs, shared searches) - Patch by Frédéric Buclin r=wicked a=LpSolit --- diff --git a/template/en/default/account/prefs/prefs.html.tmpl b/template/en/default/account/prefs/prefs.html.tmpl index da1b489e81..3b49683d0c 100644 --- a/template/en/default/account/prefs/prefs.html.tmpl +++ b/template/en/default/account/prefs/prefs.html.tmpl @@ -84,6 +84,7 @@ [% IF current_tab.saveable %]
+ [% END %] [% PROCESS "account/prefs/${current_tab.name}.html.tmpl" diff --git a/userprefs.cgi b/userprefs.cgi index b968758fcc..fe2fba83d8 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -520,6 +520,9 @@ trick_taint($current_tab_name); $vars->{'current_tab_name'} = $current_tab_name; +my $token = $cgi->param('token'); +check_token_data($token, 'edit_user_prefs') if $cgi->param('dosave'); + # Do any saving, and then display the current tab. SWITCH: for ($current_tab_name) { /^account$/ && do { @@ -550,6 +553,11 @@ SWITCH: for ($current_tab_name) { { current_tab_name => $current_tab_name }); } +delete_token($token) if $cgi->param('dosave'); +if ($current_tab_name ne 'permissions') { + $vars->{'token'} = issue_session_token('edit_user_prefs'); +} + # Generate and return the UI (HTML page) from the appropriate template. print $cgi->header(); $template->process("account/prefs/prefs.html.tmpl", $vars)