summaryrefslogtreecommitdiffstats
path: root/usr/local/www/vpn_ipsec_phase1.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:32 -0300
commit0e6cf71b17cc57c40aebc64359c1a27e2515b7b7 (patch)
tree8e409a77838a21da4644e4d3f39d05acf17a4952 /usr/local/www/vpn_ipsec_phase1.php
parent3b77ba4a2a96a388682d564c3b9b7517bbbfdb21 (diff)
downloadpfsense-0e6cf71b17cc57c40aebc64359c1a27e2515b7b7.zip
pfsense-0e6cf71b17cc57c40aebc64359c1a27e2515b7b7.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_phase1.php')
-rw-r--r--usr/local/www/vpn_ipsec_phase1.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr/local/www/vpn_ipsec_phase1.php b/usr/local/www/vpn_ipsec_phase1.php
index 9d850df..f69cfd3 100644
--- a/usr/local/www/vpn_ipsec_phase1.php
+++ b/usr/local/www/vpn_ipsec_phase1.php
@@ -50,17 +50,17 @@ if (!is_array($config['ipsec']['phase2']))
$a_phase1 = &$config['ipsec']['phase1'];
$a_phase2 = &$config['ipsec']['phase2'];
-$p1index = $_GET['p1index'];
-if (isset($_POST['p1index']))
+if (is_numericint($_GET['p1index']))
+ $p1index = $_GET['p1index'];
+if (isset($_POST['p1index']) && is_numericint($_GET['p1index']))
$p1index = $_POST['p1index'];
-if (isset($_GET['dup'])) {
+if (isset($_GET['dup']) && is_numericint($_GET['dup']))
$p1index = $_GET['dup'];
-}
if (isset($p1index) && $a_phase1[$p1index]) {
// don't copy the ikeid on dup
- if (!isset($_GET['dup']))
+ if (!isset($_GET['dup']) || !is_numericint($_GET['dup']))
$pconfig['ikeid'] = $a_phase1[$p1index]['ikeid'];
$old_ph1ent = $a_phase1[$p1index];
@@ -132,7 +132,7 @@ if (isset($p1index) && $a_phase1[$p1index]) {
$pconfig['mobile']=true;
}
-if (isset($_GET['dup']))
+if (isset($_GET['dup']) && is_numericint($_GET['dup']))
unset($p1index);
if ($_POST) {
@@ -892,7 +892,7 @@ function dpdchkbox_change() {
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<?php if (isset($p1index) && $a_phase1[$p1index]): ?>
- <input name="p1index" type="hidden" value="<?=$p1index;?>"/>
+ <input name="p1index" type="hidden" value="<?=htmlspecialchars($p1index);?>"/>
<?php endif; ?>
<?php if ($pconfig['mobile']): ?>
<input name="mobile" type="hidden" value="true"/>
OpenPOWER on IntegriCloud