Skip to content

Commit 5008d8c

Browse files
author
Marius Burkard
committed
- further XSS fixes for #4902 (reflected XSS)
1 parent e42cd41 commit 5008d8c

File tree

12 files changed

+30
-30
lines changed

12 files changed

+30
-30
lines changed

interface/lib/app.inc.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,14 @@ public function tpl_defaults() {
298298

299299
$this->tpl->setVar('phpsessid', session_id());
300300

301-
$this->tpl->setVar('theme', $_SESSION['s']['theme']);
301+
$this->tpl->setVar('theme', $_SESSION['s']['theme'], true);
302302
$this->tpl->setVar('html_content_encoding', $this->_conf['html_content_encoding']);
303303

304304
$this->tpl->setVar('delete_confirmation', $this->lng('delete_confirmation'));
305305
//print_r($_SESSION);
306306
if(isset($_SESSION['s']['module']['name'])) {
307-
$this->tpl->setVar('app_module', $_SESSION['s']['module']['name']);
308-
$this->tpl->setVar('session_module', $_SESSION['s']['module']['name']);
307+
$this->tpl->setVar('app_module', $_SESSION['s']['module']['name'], true);
308+
$this->tpl->setVar('session_module', $_SESSION['s']['module']['name'], true);
309309
}
310310
if(isset($_SESSION['s']['user']) && $_SESSION['s']['user']['typ'] == 'admin') {
311311
$this->tpl->setVar('is_admin', 1);
@@ -315,7 +315,7 @@ public function tpl_defaults() {
315315
}
316316
/* Show username */
317317
if(isset($_SESSION['s']['user'])) {
318-
$this->tpl->setVar('cpuser', $_SESSION['s']['user']['username']);
318+
$this->tpl->setVar('cpuser', $_SESSION['s']['user']['username'], true);
319319
$this->tpl->setVar('logout_txt', $this->lng('logout_txt'));
320320
/* Show search field only for normal users, not mail users */
321321
if(stristr($_SESSION['s']['user']['username'], '@')){

interface/lib/classes/plugin_listview.inc.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function onShow() {
5656
// $app->listform->listDef["page_params"] = "&id=".$app->tform_actions->id."&next_tab=".$_SESSION["s"]["form"]["tab"];
5757
$app->listform->listDef["page_params"] = "&id=".$this->form->id."&next_tab=".$_SESSION["s"]["form"]["tab"];
5858
$listTpl->setVar('parent_id', $this->form->id);
59-
$listTpl->setVar('theme', $_SESSION['s']['theme']);
59+
$listTpl->setVar('theme', $_SESSION['s']['theme'], true);
6060

6161
// Generate the SQL for searching
6262
$sql_where = "";
@@ -193,13 +193,13 @@ function onShow() {
193193

194194
$listTpl->setVar('phpsessid', session_id());
195195

196-
$listTpl->setVar('theme', $_SESSION['s']['theme']);
196+
$listTpl->setVar('theme', $_SESSION['s']['theme'], true);
197197
$listTpl->setVar('html_content_encoding', $app->_conf['html_content_encoding']);
198198

199199
$listTpl->setVar('delete_confirmation', $app->lng('delete_confirmation'));
200200
//print_r($_SESSION);
201201
if(isset($_SESSION['s']['module']['name'])) {
202-
$listTpl->setVar('app_module', $_SESSION['s']['module']['name']);
202+
$listTpl->setVar('app_module', $_SESSION['s']['module']['name'], true);
203203
}
204204
if(isset($_SESSION['s']['user']) && $_SESSION['s']['user']['typ'] == 'admin') {
205205
$listTpl->setVar('is_admin', 1);
@@ -209,7 +209,7 @@ function onShow() {
209209
}
210210
/* Show username */
211211
if(isset($_SESSION['s']['user'])) {
212-
$listTpl->setVar('cpuser', $_SESSION['s']['user']['username']);
212+
$listTpl->setVar('cpuser', $_SESSION['s']['user']['username'], true);
213213
$listTpl->setVar('logout_txt', $app->lng('logout_txt'));
214214
/* Show search field only for normal users, not mail users */
215215
if(stristr($_SESSION['s']['user']['username'], '@')){

interface/web/client/client_message.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@
114114
}
115115

116116
} else {
117-
$app->tpl->setVar('sender', $_POST['sender']);
118-
$app->tpl->setVar('subject', $_POST['subject']);
119-
$app->tpl->setVar('message', $_POST['message']);
117+
$app->tpl->setVar('sender', $_POST['sender'], true);
118+
$app->tpl->setVar('subject', $_POST['subject'], true);
119+
$app->tpl->setVar('message', $_POST['message'], true);
120120
}
121121
} else {
122122
// pre-fill Sender field with reseller's email address

interface/web/dns/dns_wizard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183
} else {
184184
$app->tpl->setVar($field."_VISIBLE", 1);
185185
$field = strtolower($field);
186-
$app->tpl->setVar($field, $_POST[$field]);
186+
$app->tpl->setVar($field, $_POST[$field], true);
187187
}
188188
}
189189
}

interface/web/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
$app->uses('tpl');
4343
$app->tpl->newTemplate('main.tpl.htm');
44-
$app->tpl->setVar('startpage', isset($_SESSION['s']['module']['startpage']) ? $_SESSION['s']['module']['startpage'] : '');
44+
$app->tpl->setVar('startpage', isset($_SESSION['s']['module']['startpage']) ? $_SESSION['s']['module']['startpage'] : '', true);
4545
$app->tpl->setVar('logged_in', ($_SESSION['s']['user']['active'] != 1 ? 'n' : 'y'));
4646

4747
// tab change warning?
@@ -93,7 +93,7 @@
9393
if (!empty($js_d_files)) $app->tpl->setLoop('js_d_includes', $js_d_files);
9494
unset($js_d_files);
9595

96-
$app->tpl->setVar('current_theme', isset($_SESSION['s']['theme']) ? $_SESSION['s']['theme'] : 'default');
96+
$app->tpl->setVar('current_theme', isset($_SESSION['s']['theme']) ? $_SESSION['s']['theme'] : 'default', true);
9797

9898
// Logo
9999
$logo = $app->db->queryOneRecord("SELECT * FROM sys_ini WHERE sysini_id = 1");

interface/web/login/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@
340340
$app->tpl->setVar('session_timeout', $server_config_array['session_timeout']);
341341
$app->tpl->setVar('session_allow_endless', $server_config_array['session_allow_endless']);
342342
//$app->tpl->setInclude('content_tpl', 'login/templates/index.htm');
343-
$app->tpl->setVar('current_theme', isset($_SESSION['s']['theme']) ? $_SESSION['s']['theme'] : 'default');
343+
$app->tpl->setVar('current_theme', isset($_SESSION['s']['theme']) ? $_SESSION['s']['theme'] : 'default', true);
344344
//die(isset($_SESSION['s']['theme']) ? $_SESSION['s']['theme'] : 'default');
345345

346346
// Logo

interface/web/login/password_reset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
if(isset($_POST) && count($_POST) > 0) $app->tpl->setVar("msg", $wb['pw_error_noinput']);
157157
}
158158

159-
$app->tpl->setVar('current_theme', isset($_SESSION['s']['theme']) ? $_SESSION['s']['theme'] : 'default');
159+
$app->tpl->setVar('current_theme', isset($_SESSION['s']['theme']) ? $_SESSION['s']['theme'] : 'default', true);
160160

161161
// Logo
162162
$logo = $app->db->queryOneRecord("SELECT * FROM sys_ini WHERE sysini_id = 1");

interface/web/sites/web_childdomain_list.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
class list_action extends listform_actions {
5757
function onShow() {
5858
global $app;
59-
$app->tpl->setVar('childdomain_type', $_SESSION['s']['var']['childdomain_type']);
59+
$app->tpl->setVar('childdomain_type', $_SESSION['s']['var']['childdomain_type'], true);
6060

6161
parent::onShow();
6262
}

interface/web/sites/web_vhost_domain_list.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
class list_action extends listform_actions {
6969
function onShow() {
7070
global $app;
71-
$app->tpl->setVar('vhostdomain_type', $_SESSION['s']['var']['vhostdomain_type']);
71+
$app->tpl->setVar('vhostdomain_type', $_SESSION['s']['var']['vhostdomain_type'], true);
7272

7373
parent::onShow();
7474
}

interface/web/tools/dns_import_tupa.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@
5050
$app->auth->csrf_token_check();
5151

5252
//* Set variable sin template
53-
$app->tpl->setVar('dbhost', $_POST['dbhost']);
54-
$app->tpl->setVar('dbname', $_POST['dbname']);
55-
$app->tpl->setVar('dbuser', $_POST['dbuser']);
56-
$app->tpl->setVar('dbpassword', $_POST['dbpassword']);
53+
$app->tpl->setVar('dbhost', $_POST['dbhost'], true);
54+
$app->tpl->setVar('dbname', $_POST['dbname'], true);
55+
$app->tpl->setVar('dbuser', $_POST['dbuser'], true);
56+
$app->tpl->setVar('dbpassword', $_POST['dbpassword'], true);
5757

5858
//* Establish connection to external database
5959
$msg .= 'Connecting to external database...<br />';

0 commit comments

Comments
 (0)