Commit 9b9769e8 authored by Leigh Stoller's avatar Leigh Stoller

Patch a couple XSS bugs reported by the Sanda Red Team. Keep up the

good work Red Team!
parent 4968c560
......@@ -247,7 +247,8 @@ function FORMERROR($field) {
# A page argument error.
#
function PAGEARGERROR($msg = 0) {
$default = "Invalid page arguments: " . $_SERVER['REQUEST_URI'];
$default = "Invalid page arguments: " .
htmlspecialchars($_SERVER['REQUEST_URI']);
if ($msg) {
$default = "$default<br><br>$msg";
......
......@@ -608,6 +608,7 @@ function VerifyPageArguments($argspec, $required)
# Pages never get arguments with special chars. Check.
if (preg_match("/[\'\"]/", $object)) {
$object = htmlspecialchars($object);
PAGEARGERROR("Invalid characters in '$name': $object");
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment