Skip to content

Commit 244adf6

Browse files
committed
Fix unescaped error messages (#5329)
In both cases the input, which wasn't escaped before, comes from a form element that doesn't allow any user to change its content. An ordinary user would need to access the DOM in order to do that. Both forms are protected by CSRF, so this mitigates any potential exploit as well. (cherry picked from commit acfad5a)
1 parent 64dcc33 commit 244adf6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

application/views/scripts/config/module-configuration-error.phtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<?= $this->tabs->render($this); ?>
77
<br/>
88
<div>
9-
<h1>Could not <?= $action; ?> module "<?= $moduleName; ?>"</h1>
9+
<h1>Could not <?= $action; ?> module "<?= $this->escape($moduleName); ?>"</h1>
1010
<p>
1111
While operation the following error occurred:
1212
<br />

modules/monitoring/application/forms/Config/BackendConfigForm.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public function createElements(array $formData)
227227
'autosubmit' => true
228228
)
229229
);
230-
$resourceName = isset($formData['resource']) ? $formData['resource'] : $this->getValue('resource');
230+
$resourceName = $this->getView()->escape($formData['resource'] ?? $this->getValue('resource'));
231231
$this->addElement(
232232
'note',
233233
'resource_note',

0 commit comments

Comments
 (0)