summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_testport.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2014-08-04 15:23:51 -0400
committerjim-p <jimp@pfsense.org>2014-08-04 15:23:51 -0400
commit46d3f6a6362e15e188b77d9992f59a9ff3afe781 (patch)
tree27ca4e4c15d411111c7422d88b9fad95d3c3c1e9 /usr/local/www/diag_testport.php
parentaeb44799f3693c198c48926c85b4468a6dccb9f9 (diff)
downloadpfsense-46d3f6a6362e15e188b77d9992f59a9ff3afe781.zip
pfsense-46d3f6a6362e15e188b77d9992f59a9ff3afe781.tar.gz
Fix input validation logic on diag_testport.php, escape more shell arguments for good measure
Diffstat (limited to 'usr/local/www/diag_testport.php')
-rw-r--r--usr/local/www/diag_testport.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr/local/www/diag_testport.php b/usr/local/www/diag_testport.php
index bfc0a59..b04a9d7 100644
--- a/usr/local/www/diag_testport.php
+++ b/usr/local/www/diag_testport.php
@@ -68,7 +68,7 @@ if ($_POST || $_REQUEST['host']) {
$input_errors[] = gettext("Please enter a valid port number.");
}
- if (is_numeric($_REQUEST['srcport']) && !is_port($_REQUEST['srcport'])) {
+ if (!is_numeric($_REQUEST['srcport']) || !is_port($_REQUEST['srcport'])) {
$input_errors[] = gettext("Please enter a valid source port number, or leave the field blank.");
}
@@ -198,11 +198,11 @@ include("head.inc"); ?>
echo "<textarea id=\"testportCaptured\" style=\"width:98%\" name=\"code\" rows=\"15\" cols=\"66\" readonly=\"readonly\">";
$result = "";
$nc_base_cmd = "/usr/bin/nc";
- $nc_args = "-w {$timeout}";
+ $nc_args = "-w " . escapeshellarg($timeout);
if (!$showtext)
$nc_args .= " -z ";
if (!empty($srcport))
- $nc_args .= " -p {$srcport} ";
+ $nc_args .= " -p " . escapeshellarg($srcport) . " ";
/* Attempt to determine the interface address, if possible. Else try both. */
if (is_ipaddrv4($host)) {
OpenPOWER on IntegriCloud