Fix some reflected XSS bugs

fixes #4979
This commit is contained in:
Johannes Meyer 2023-01-11 15:30:03 +01:00
parent 8837fea7a4
commit e542982de0
5 changed files with 31 additions and 21 deletions

View File

@ -1,4 +1,14 @@
<form id="<?= $form->getId() ?>" name="<?= $form->getName() ?>" enctype="<?= $form->getEncType() ?>" method="<?= $form->getMethod() ?>" action="<?= $form->getAction() ?>">
<form id="<?=
$this->escape($form->getId())
?>" name="<?=
$this->escape($form->getName())
?>" enctype="<?=
$this->escape($form->getEncType())
?>" method="<?=
$this->escape($form->getMethod())
?>" action="<?=
$this->escape($form->getAction())
?>">
<table class="table-row-selectable common-table" data-base-target="_next">
<thead>
<th><?= $this->translate('Backend') ?></th>

View File

@ -3,15 +3,15 @@
/** @var \Icinga\Module\Monitoring\Forms\Config\TransportReorderForm $form */
?>
<form id="<?=
$form->getId()
$this->escape($form->getId())
?>" name="<?=
$form->getName()
$this->escape($form->getName())
?>" enctype="<?=
$form->getEncType()
$this->escape($form->getEncType())
?>" method="<?=
$form->getMethod()
$this->escape($form->getMethod())
?>" action="<?=
$form->getAction()
$this->escape($form->getAction())
?>">
<table class="table-row-selectable common-table" data-base-target="_next">
<thead>

View File

@ -4,11 +4,11 @@ use Icinga\Web\Wizard;
?>
<form
id="<?= $form->getName(); ?>"
name="<?= $form->getName(); ?>"
enctype="<?= $form->getEncType(); ?>"
method="<?= $form->getMethod(); ?>"
action="<?= $form->getAction(); ?>"
id="<?= $this->escape($form->getName()); ?>"
name="<?= $this->escape($form->getName()); ?>"
enctype="<?= $this->escape($form->getEncType()); ?>"
method="<?= $this->escape($form->getMethod()); ?>"
action="<?= $this->escape($form->getAction()); ?>"
class="icinga-controls"
data-progress-element="<?= Wizard::PROGRESS_ELEMENT; ?>"
>

View File

@ -14,11 +14,11 @@ if (! $form->getWizard()->getRequirements()->fulfilled()) {
<?= $wizard->getRequirements(); ?>
<?php endforeach ?>
<form
id="<?= $form->getName(); ?>"
name="<?= $form->getName(); ?>"
enctype="<?= $form->getEncType(); ?>"
method="<?= $form->getMethod(); ?>"
action="<?= $form->getAction(); ?>"
id="<?= $this->escape($form->getName()); ?>"
name="<?= $this->escape($form->getName()); ?>"
enctype="<?= $this->escape($form->getEncType()); ?>"
method="<?= $this->escape($form->getMethod()); ?>"
action="<?= $this->escape($form->getAction()); ?>"
data-progress-element="<?= Wizard::PROGRESS_ELEMENT; ?>"
>
<?= $form->getElement($form->getTokenElementName()); ?>

View File

@ -26,11 +26,11 @@ $form->getElement(Wizard::BTN_NEXT)->setAttrib(
<?php endforeach ?>
</div>
<form
id="<?= $form->getName(); ?>"
name="<?= $form->getName(); ?>"
enctype="<?= $form->getEncType(); ?>"
method="<?= $form->getMethod(); ?>"
action="<?= $form->getAction(); ?>"
id="<?= $this->escape($form->getName()); ?>"
name="<?= $this->escape($form->getName()); ?>"
enctype="<?= $this->escape($form->getEncType()); ?>"
method="<?= $this->escape($form->getMethod()); ?>"
action="<?= $this->escape($form->getAction()); ?>"
data-progress-element="<?= Wizard::PROGRESS_ELEMENT; ?>"
class="summary"
>