From 89b1c40c41ea16d0beac1ffbde9334f657e66e5c Mon Sep 17 00:00:00 2001 From: Michael Newton Date: Tue, 12 Feb 2013 11:11:56 -0800 Subject: [PATCH] add input validation for NAS-Identifier --- usr/local/www/services_captiveportal.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php index 35616a29bb..b465baacc4 100755 --- a/usr/local/www/services_captiveportal.php +++ b/usr/local/www/services_captiveportal.php @@ -224,6 +224,9 @@ if ($_POST) { if ($_POST['maxproc'] && (!is_numeric($_POST['maxproc']) || ($_POST['maxproc'] < 4) || ($_POST['maxproc'] > 100))) { $input_errors[] = gettext("The maximum number of concurrent connections per client IP address may not be larger than the global maximum."); } + if (trim($_POST['radiusnasid']) !== "" && !preg_match("/^[\x21-\x7e]{3,253}$/i", trim($_POST['radiusnasid']))) { + $input_errors[] = gettext("The NAS-Identifier must be 3-253 characters long and should only contain ASCII characters."); + } if (!$input_errors) { $newcp =& $a_cp[$cpzone]; @@ -827,8 +830,8 @@ function enable_change(enable_change) { -
- +
+