Got a Sitelock warning about
"Cross site scripting vulnerability found in args:back,fwd,maxpage,page"
This is a very simple page that allows you to click on a back or forward button and scroll between a set of pictures.
Eg forward button code:
if (isset($_POST['fwd']))
{
$page = $_POST['page'];
$maxpage = $_POST['maxpage'];
$page++;
if ($page>$maxpage)
{
$page = 1;
}
else
{
$fwd = "visible";
}
$back = "visible";
}
HTML stuff here
<?php
echo "<img src='month$page.jpg' width='950' alt='$page'>";
?>
more HTML
<form name="page" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
<?php
echo <<<END
<div class="content-back"><input style="visibility:$back" type="submit" name="back" value=""></div>
<div class="content-fwd"><input style="visibility:$fwd" type="submit" name="fwd" value=""></div>
<input type='hidden' name='page' value='$page'>
<input type='hidden' name='maxpage' value='$maxpage'>
END;
Any ideas why that would be vulnerable? Cheers.
"Cross site scripting vulnerability found in args:back,fwd,maxpage,page"
This is a very simple page that allows you to click on a back or forward button and scroll between a set of pictures.
Eg forward button code:
if (isset($_POST['fwd']))
{
$page = $_POST['page'];
$maxpage = $_POST['maxpage'];
$page++;
if ($page>$maxpage)
{
$page = 1;
}
else
{
$fwd = "visible";
}
$back = "visible";
}
HTML stuff here
<?php
echo "<img src='month$page.jpg' width='950' alt='$page'>";
?>
more HTML
<form name="page" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
<?php
echo <<<END
<div class="content-back"><input style="visibility:$back" type="submit" name="back" value=""></div>
<div class="content-fwd"><input style="visibility:$fwd" type="submit" name="fwd" value=""></div>
<input type='hidden' name='page' value='$page'>
<input type='hidden' name='maxpage' value='$maxpage'>
END;
Any ideas why that would be vulnerable? Cheers.
Comment