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.
This commit is contained in:
Johannes Meyer 2025-03-20 16:20:21 +01:00 committed by GitHub
commit acfad5ae52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@
<?= $this->tabs->render($this); ?>
<br/>
<div>
<h1>Could not <?= $action; ?> module "<?= $moduleName; ?>"</h1>
<h1>Could not <?= $action; ?> module "<?= $this->escape($moduleName); ?>"</h1>
<p>
While operation the following error occurred:
<br />

View File

@ -227,7 +227,7 @@ class BackendConfigForm extends ConfigForm
'autosubmit' => true
)
);
$resourceName = isset($formData['resource']) ? $formData['resource'] : $this->getValue('resource');
$resourceName = $this->getView()->escape($formData['resource'] ?? $this->getValue('resource'));
$this->addElement(
'note',
'resource_note',