diff --git a/src/www/services_dnsmasq.php b/src/www/services_dnsmasq.php
index 0d8a51ff9..a833c57de 100644
--- a/src/www/services_dnsmasq.php
+++ b/src/www/services_dnsmasq.php
@@ -70,7 +70,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$input_errors[] = gettext('Unbound is still active on the same port. Disable it before enabling Dnsmasq.');
}
- if (!empty($pconfig['custom_options'])) {
+ $prev_opt = !empty($config['dnsmasq']['custom_options']) ? $config['dnsmasq']['custom_options'] : "";
+ if ($prev_opt != str_replace("\r\n", "\n", $pconfig['custom_options']) && !userIsAdmin($_SESSION['Username'])) {
+ $input_errors[] = gettext("Advanced options may only be edited by admins (role page-all), due to the increased possibility of privilege escalation.");
+ }
+ if (!empty($pconfig['custom_options']) && userIsAdmin($_SESSION['Username'])) {
$args = '';
foreach (preg_split('/\s+/', str_replace("\r\n", "\n", $pconfig['custom_options'])) as $c) {
if (!empty($c)) {
@@ -386,6 +390,7 @@ $( document ).ready(function() {
=gettext("Enter any additional options you would like to add to the Dnsmasq configuration here, separated by a space or newline"); ?>
diff --git a/src/www/services_ntpd.php b/src/www/services_ntpd.php
index 6ffc6cc35..28b0de86c 100644
--- a/src/www/services_ntpd.php
+++ b/src/www/services_ntpd.php
@@ -72,6 +72,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (!empty($pconfig['orphan']) && ($pconfig['orphan'] < 0 || $pconfig['orphan'] > 15 || !is_numeric($pconfig['orphan']))) {
$input_errors[] = gettext("Orphan mode must be a value between 0..15");
}
+ $prev_opt = !empty($a_ntpd['custom_options']) ? $a_ntpd['custom_options'] : "";
+ if ($prev_opt != str_replace("\r\n", "\n", $pconfig['custom_options']) && !userIsAdmin($_SESSION['Username'])) {
+ $input_errors[] = gettext("Advanced options may only be edited by admins (role page-all), due to the increased possibility of privilege escalation.");
+ }
// swap fields, really stupid field usage which we are not going to change now....
foreach (array('kod', 'nomodify', 'nopeer', 'notrap') as $fieldname) {
@@ -411,6 +415,7 @@ include("head.inc");
>
=gettext("Advanced");?>
+ =gettext("This option will be removed in the future due to being insecure by nature. In the mean time only full administrators are allowed to change this setting.");?>
= gettext('Enter any additional options you would like to add to the network time configuration here, separated by a space or newline.') ?>
diff --git a/src/www/services_unbound.php b/src/www/services_unbound.php
index e8d54ad3e..9ad7f7920 100644
--- a/src/www/services_unbound.php
+++ b/src/www/services_unbound.php
@@ -83,6 +83,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (!empty($pconfig['local_zone_type']) && !array_key_exists($pconfig['local_zone_type'], unbound_local_zone_types())) {
$input_errors[] = sprintf(gettext('Local zone type "%s" is not known.'), $pconfig['local_zone_type']);
}
+ $prev_opt = !empty($a_unboundcfg['custom_options']) ? $a_unboundcfg['custom_options'] : "";
+ if ($prev_opt != str_replace("\r\n", "\n", $pconfig['custom_options']) && !userIsAdmin($_SESSION['Username'])) {
+ $input_errors[] = gettext("Advanced options may only be edited by admins (role page-all), due to the increased possibility of privilege escalation.");
+ }
if (count($input_errors) == 0) {
// text types
@@ -318,6 +322,7 @@ include_once("head.inc");
= gettext('Custom options') ?> |
+ =gettext("This option will be removed in the future due to being insecure by nature. In the mean time only full administrators are allowed to change this setting.");?>
=gettext("Enter any additional options you would like to add to the Unbound configuration here."); ?>
diff --git a/src/www/vpn_openvpn_client.php b/src/www/vpn_openvpn_client.php
index bb41f7a05..2a26a4574 100644
--- a/src/www/vpn_openvpn_client.php
+++ b/src/www/vpn_openvpn_client.php
@@ -294,6 +294,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (($pconfig['mode'] != "p2p_shared_key") && empty($pconfig['certref']) && empty($pconfig['auth_user']) && empty($pconfig['auth_pass'])) {
$input_errors[] = gettext("If no Client Certificate is selected, a username and password must be entered.");
}
+ $prev_opt = (isset($id) && !empty($a_client[$id])) ? $a_client[$id]['custom_options'] : "";
+ if ($prev_opt != str_replace("\r\n", "\n", $pconfig['custom_options']) && !userIsAdmin($_SESSION['Username'])) {
+ $input_errors[] = gettext("Advanced options may only be edited by admins (role page-all), due to the increased possibility of privilege escalation.");
+ }
if (count($input_errors) == 0) {
// save data
@@ -1101,6 +1105,7 @@ $( document ).ready(function() {
| =gettext("Advanced"); ?> |
+ =gettext("This option will be removed in the future due to being insecure by nature. In the mean time only full administrators are allowed to change this setting.");?>
=gettext("Enter any additional options you would like to add to the configuration file here."); ?>
diff --git a/src/www/vpn_openvpn_csc.php b/src/www/vpn_openvpn_csc.php
index 7492ca4d6..26095db55 100644
--- a/src/www/vpn_openvpn_csc.php
+++ b/src/www/vpn_openvpn_csc.php
@@ -177,6 +177,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
}
}
+ $prev_opt = (isset($id) && !empty($a_csc[$id])) ? $a_csc[$id]['custom_options'] : "";
+ if ($prev_opt != str_replace("\r\n", "\n", $pconfig['custom_options']) && !userIsAdmin($_SESSION['Username'])) {
+ $input_errors[] = gettext("Advanced options may only be edited by admins (role page-all), due to the increased possibility of privilege escalation.");
+ }
+
$reqdfields[] = 'common_name';
$reqdfieldsn[] = 'Common name';
@@ -655,6 +660,7 @@ if ($act!="new" && $act!="edit") {
| =gettext("Advanced"); ?> |
+ =gettext("This option will be removed in the future due to being insecure by nature. In the mean time only full administrators are allowed to change this setting.");?>
=gettext("Enter any additional options you would like to add for this client specific override, separated by a semicolon"); ?>
=gettext("EXAMPLE: push \"route 10.0.0.0 255.255.255.0\""); ?>;
diff --git a/src/www/vpn_openvpn_server.php b/src/www/vpn_openvpn_server.php
index 333b7522f..23dacf929 100644
--- a/src/www/vpn_openvpn_server.php
+++ b/src/www/vpn_openvpn_server.php
@@ -341,6 +341,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
}
}
+ $prev_opt = (isset($id) && !empty($a_server[$id])) ? $a_server[$id]['custom_options'] : "";
+ if ($prev_opt != str_replace("\r\n", "\n", $pconfig['custom_options']) && !userIsAdmin($_SESSION['Username'])) {
+ $input_errors[] = gettext("Advanced options may only be edited by admins (role page-all), due to the increased possibility of privilege escalation.");
+ }
do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors);
@@ -1547,6 +1551,7 @@ endif; ?>
=gettext("Advanced"); ?> |
+ =gettext("This option will be removed in the future due to being insecure by nature. In the mean time only full administrators are allowed to change this setting.");?>
=gettext("Enter any additional options you would like to add to the configuration file here."); ?>
| |