summaryrefslogtreecommitdiffstats
path: root/usr/local/www/vpn_ipsec_phase2.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/vpn_ipsec_phase2.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/vpn_ipsec_phase2.php')
-rw-r--r--usr/local/www/vpn_ipsec_phase2.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr/local/www/vpn_ipsec_phase2.php b/usr/local/www/vpn_ipsec_phase2.php
index 9254b6b..79c7ae2 100644
--- a/usr/local/www/vpn_ipsec_phase2.php
+++ b/usr/local/www/vpn_ipsec_phase2.php
@@ -51,11 +51,12 @@ if (!is_array($config['ipsec']['phase2']))
$a_phase2 = &$config['ipsec']['phase2'];
-$p2index = $_GET['p2index'];
-if (isset($_POST['p2index']))
+if (is_numericint($_GET['p2index']))
+ $p2index = $_GET['p2index'];
+if (isset($_POST['p2index']) && is_numericint($_GET['p2index']))
$p2index = $_POST['p2index'];
-if (isset($_GET['dup']))
+if (isset($_GET['dup']) && is_numericint($_GET['dup']))
$p2index = $_GET['dup'];
if (isset($p2index) && $a_phase2[$p2index])
@@ -99,7 +100,7 @@ else
$pconfig['mobile']=true;
}
-if (isset($_GET['dup']))
+if (isset($_GET['dup']) && is_numericint($_GET['dup']))
unset($p2index);
if ($_POST) {
@@ -781,7 +782,7 @@ function change_protocol() {
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<?php if (isset($p2index) && $a_phase2[$p2index]): ?>
- <input name="p2index" type="hidden" value="<?=$p2index;?>">
+ <input name="p2index" type="hidden" value="<?=htmlspecialchars($p2index);?>">
<?php endif; ?>
<?php if ($pconfig['mobile']): ?>
<input name="mobile" type="hidden" value="true">
OpenPOWER on IntegriCloud