Skip to content

Commit 3df5fdc

Browse files
ddb4githubJing Chen
andauthored
Fixed: Update more lines to resolve XSS exposure (CVE-2020-7106) (#122)
* Fixed: Update more lines to apply Cacti #3191 security solution(CVE-2020-7106) * Update changelog in README.md for #122 Co-authored-by: Jing Chen <three_chenjing@sohu.com>
1 parent 3dd9675 commit 3df5fdc

5 files changed

Lines changed: 20 additions & 16 deletions

File tree

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,20 +155,24 @@ that.
155155

156156
## ChangeLog
157157

158+
--- develop ---
159+
160+
* issue#122: Apply Cacti#3191 for XSS exposure (CVE-2020-7106)
161+
158162
--- 2.9 ---
159163

160164
* issue#120: SQL syntax error for syslog when click browser back button
161165

162-
* issue: Syslog stats not reporting properly
163-
166+
* issue: Syslog stats not reporting properly
167+
164168
* issue: Internationalization issues on console
165169

166170
--- 2.8 ---
167171

168172
* issue#115: Some field where not corrected following the version change
169173

170-
* issue#116: Background process fail to operate syslog_coming table; syslog_process.php fail if current workdir is not CACTI_TOP
171-
174+
* issue#116: Background process fail to operate syslog_coming table; syslog_process.php fail if current workdir is not CACTI_TOP
175+
172176
* issue#117: Export of rules does not work when using db other than Cacti
173177

174178
--- 2.7 ---

syslog_alerts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -930,9 +930,9 @@ function alert_import() {
930930
$id = sql_save($save, 'syslog_alert');
931931

932932
if ($id) {
933-
raise_message('syslog_info' . $id, __('NOTE: Alert \'%s\' %s!', $tname, ($save['id'] > 0 ? __('Updated', 'syslog'):__('Imported', 'syslog')), 'syslog'), MESSAGE_LEVEL_INFO);
933+
raise_message('syslog_info' . $id, __esc('NOTE: Alert \'%s\' %s!', $tname, ($save['id'] > 0 ? __('Updated', 'syslog'):__('Imported', 'syslog')), 'syslog'), MESSAGE_LEVEL_INFO);
934934
} else {
935-
raise_message('syslog_info' . $id, __('ERROR: Alert \'%s\' %s Failed!', $tname, ($save['id'] > 0 ? __('Update', 'syslog'):__('Import', 'syslog')), 'syslog'), MESSAGE_LEVEL_ERROR);
935+
raise_message('syslog_info' . $id, __esc('ERROR: Alert \'%s\' %s Failed!', $tname, ($save['id'] > 0 ? __('Update', 'syslog'):__('Import', 'syslog')), 'syslog'), MESSAGE_LEVEL_ERROR);
936936
}
937937
}
938938
}

syslog_process.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@
363363
$alertm .= __('Count:', 'syslog') . ' ' . sizeof($at) . "\n";
364364
$alertm .= __('Message String:', 'syslog') . ' ' . html_escape($alert['message']) . "\n";
365365

366-
$htmlm .= '<body><h1>' . __('Cacti Syslog Plugin Threshold Alert \'%s\'', $alert['name'], 'syslog') . '</h1>';
366+
$htmlm .= '<body><h1>' . __esc('Cacti Syslog Plugin Threshold Alert \'%s\'', $alert['name'], 'syslog') . '</h1>';
367367
$htmlm .= '<table cellspacing="0" cellpadding="3" border="1">';
368368
$htmlm .= '<tr><th>' . __('Alert Name', 'syslog') . '</th><th>' . __('Severity', 'syslog') . '</th><th>' . __('Threshold', 'syslog') . '</th><th>' . __('Count', 'syslog') . '</th><th>' . __('Match String', 'syslog') . '</th></tr>';
369369
$htmlm .= '<tr><td>' . html_escape($alert['name']) . '</td>';
@@ -372,7 +372,7 @@
372372
$htmlm .= '<td>' . sizeof($at) . '</td>';
373373
$htmlm .= '<td>' . html_escape($alert['message']) . '</td></tr></table><br>';
374374
}else{
375-
$htmlm .= '<body><h1>' . __('Cacti Syslog Plugin Alert \'%s\'', $alert['name'], 'syslog') . '</h1>';
375+
$htmlm .= '<body><h1>' . __esc('Cacti Syslog Plugin Alert \'%s\'', $alert['name'], 'syslog') . '</h1>';
376376
}
377377

378378
$htmlm .= '<table>';
@@ -423,7 +423,7 @@
423423
$sequence = syslog_log_alert($alert['id'], $alert['name'], $alert['severity'], $a, 1, $htmlm);
424424
$smsalert = __('Sev:', 'syslog') . $severities[$alert['severity']] . __(', Host:', 'syslog') . $a['host'] . __(', URL:', 'syslog') . read_config_option('base_url', true) . '/plugins/syslog/syslog.php?tab=current&id=' . $sequence;
425425

426-
syslog_sendemail(trim($alert['email']), $from, __('Event Alert - %s', $alert['name'], 'syslog'), ($html ? $htmlm:$alertm), $smsalert);
426+
syslog_sendemail(trim($alert['email']), $from, __esc('Event Alert - %s', $alert['name'], 'syslog'), ($html ? $htmlm:$alertm), $smsalert);
427427

428428
if ($alert['open_ticket'] == 'on' && strlen(read_config_option('syslog_ticket_command'))) {
429429
if (is_executable(read_config_option('syslog_ticket_command'))) {
@@ -472,7 +472,7 @@
472472
}
473473

474474
if ($resend) {
475-
syslog_sendemail(trim($alert['email']), $from, __('Event Alert - %s', $alert['name'], 'syslog'), ($html ? $htmlm:$alertm), $smsalert);
475+
syslog_sendemail(trim($alert['email']), $from, __esc('Event Alert - %s', $alert['name'], 'syslog'), ($html ? $htmlm:$alertm), $smsalert);
476476

477477
if ($alert['open_ticket'] == 'on' && strlen(read_config_option('syslog_ticket_command'))) {
478478
if (is_executable(read_config_option('syslog_ticket_command'))) {
@@ -699,7 +699,7 @@
699699

700700
$smsalert = '';
701701

702-
syslog_sendemail($syslog_report['email'], $from, __('Event Report - %s', $syslog_report['name'], 'syslog'), $headtext, $smsalert);
702+
syslog_sendemail($syslog_report['email'], $from, __esc('Event Report - %s', $syslog_report['name'], 'syslog'), $headtext, $smsalert);
703703
}
704704
}
705705
} else {

syslog_removal.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ function api_syslog_removal_reprocess($id) {
341341
WHERE id = ?',
342342
array($id));
343343

344-
raise_message('syslog_info' . $id, __('Rule \'%s\' resulted in %s/%s messages removed/transferred', $name, $syslog_removed, $syslog_xferred, 'syslog'), MESSAGE_LEVEL_INFO);
344+
raise_message('syslog_info' . $id, __esc('Rule \'%s\' resulted in %s/%s messages removed/transferred', $name, $syslog_removed, $syslog_xferred, 'syslog'), MESSAGE_LEVEL_INFO);
345345
}
346346

347347
/* ---------------------
@@ -839,9 +839,9 @@ function removal_import() {
839839
$id = sql_save($save, 'syslog_remove');
840840

841841
if ($id) {
842-
raise_message('syslog_info' . $id, __('NOTE: Removal Rule \'%s\' %s!', $tname, ($save['id'] > 0 ? __('Updated', 'syslog'):__('Imported', 'syslog')), 'syslog'), MESSAGE_LEVEL_INFO);
842+
raise_message('syslog_info' . $id, __esc('NOTE: Removal Rule \'%s\' %s!', $tname, ($save['id'] > 0 ? __('Updated', 'syslog'):__('Imported', 'syslog')), 'syslog'), MESSAGE_LEVEL_INFO);
843843
} else {
844-
raise_message('syslog_info' . $id, __('ERROR: Removal Rule \'%s\' %s Failed!', $tname, ($save['id'] > 0 ? __('Update', 'syslog'):__('Import', 'syslog')), 'syslog'), MESSAGE_LEVEL_ERROR);
844+
raise_message('syslog_info' . $id, __esc('ERROR: Removal Rule \'%s\' %s Failed!', $tname, ($save['id'] > 0 ? __('Update', 'syslog'):__('Import', 'syslog')), 'syslog'), MESSAGE_LEVEL_ERROR);
845845
}
846846
}
847847
}

syslog_reports.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,9 +822,9 @@ function report_import() {
822822
$id = sql_save($save, 'syslog_reports');
823823

824824
if ($id) {
825-
raise_message('syslog_info' . $id, __('NOTE: Report Rule \'%s\' %s!', $tname, ($save['id'] > 0 ? __('Updated', 'syslog'):__('Imported', 'syslog')), 'syslog'), MESSAGE_LEVEL_INFO);
825+
raise_message('syslog_info' . $id, __esc('NOTE: Report Rule \'%s\' %s!', $tname, ($save['id'] > 0 ? __('Updated', 'syslog'):__('Imported', 'syslog')), 'syslog'), MESSAGE_LEVEL_INFO);
826826
} else {
827-
raise_message('syslog_info' . $id, __('ERROR: Report Rule \'%s\' %s Failed!', $tname, ($save['id'] > 0 ? __('Update', 'syslog'):__('Import', 'syslog')), 'syslog'), MESSAGE_LEVEL_ERROR);
827+
raise_message('syslog_info' . $id, __esc('ERROR: Report Rule \'%s\' %s Failed!', $tname, ($save['id'] > 0 ? __('Update', 'syslog'):__('Import', 'syslog')), 'syslog'), MESSAGE_LEVEL_ERROR);
828828
}
829829
}
830830
}

0 commit comments

Comments
 (0)