summaryrefslogtreecommitdiffstats
path: root/usr/local/www/firewall_nat_out_edit.php
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-03-12 11:35:57 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-03-12 11:42:49 -0300
commite41ec5848f21015068255c1d61d01edf442e8e7e (patch)
tree45c3214c1e3d638dbacb217cd3de95fb4aa6e770 /usr/local/www/firewall_nat_out_edit.php
parent49f3f28fea92114b09d3b2d8103398c4adcb3635 (diff)
downloadpfsense-e41ec5848f21015068255c1d61d01edf442e8e7e.zip
pfsense-e41ec5848f21015068255c1d61d01edf442e8e7e.tar.gz
Improve checks for params 'id', 'dup' and other similar ones to make sure they are numeric integer, also, pass them through htmlspecialchars() before print
Diffstat (limited to 'usr/local/www/firewall_nat_out_edit.php')
-rwxr-xr-xusr/local/www/firewall_nat_out_edit.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php
index 5e113a5..1d2e79d 100755
--- a/usr/local/www/firewall_nat_out_edit.php
+++ b/usr/local/www/firewall_nat_out_edit.php
@@ -58,19 +58,19 @@ if (!is_array($config['aliases']['alias']))
$config['aliases']['alias'] = array();
$a_aliases = &$config['aliases']['alias'];
-$id = $_GET['id'];
-if (isset($_POST['id'])) {
+if (is_numericint($_GET['id']))
+ $id = $_GET['id'];
+if (isset($_POST['id']) && is_numericint($_POST['id']))
$id = $_POST['id'];
-}
-
-$after = $_GET['after'];
-if (isset($_POST['after']))
+if (is_numericint($_GET['after']))
+ $after = $_GET['after'];
+if (isset($_POST['after']) && is_numericint($_GET['after']))
$after = $_POST['after'];
-if (isset($_GET['dup'])) {
- $id = $_GET['dup'];
- $after = $_GET['dup'];
+if (isset($_GET['dup']) && is_numericint($_GET['dup'])) {
+ $id = $_GET['dup'];
+ $after = $_GET['dup'];
}
if (isset($id) && $a_out[$id]) {
@@ -110,9 +110,8 @@ if (isset($id) && $a_out[$id]) {
$pconfig['interface'] = "wan";
}
-if (isset($_GET['dup'])) {
+if (isset($_GET['dup']) && is_numericint($_GET['dup']))
unset($id);
-}
if ($_POST) {
if ($_POST['destination_type'] == "any") {
OpenPOWER on IntegriCloud