patch XSS vulnerability (#358)

the powergamers page was vulnerable to XSS/javascript injection, this should fix it.

XSS screenshot: https://i.imgur.com/4rJuWqY.png
XSS POC:

<form action="https://<censored>/powergamers.php" method="POST">
<input type="hidden" name="days[]" value="3" />
<input type="hidden" name="days[]" value="1&lt;script&gt;alert(&quot;XSS running!&quot;);&lt;/script&gt;" />
<input type="submit" value="click here to start xss" />
</form>
This commit is contained in:
divinity76 2019-04-19 21:23:57 +02:00 committed by Stefan A. Brannfjell
parent c0fe9e5d85
commit d9cd81508b

View File

@ -15,8 +15,8 @@ include 'layout/overall/footer.php';
$today = true;
if ($days) {
$selected = ($_POST['days']);
$days = $selected[1];
$vocation = $selected[0];
$days = (int) $selected[1];
$vocation = (int) $selected[0];
if ($days > 0)
$today = false;
} else {