From bf0a0aa0d2107150dab8d36aeb8a9189234a243c Mon Sep 17 00:00:00 2001 From: AlexanderDCrane <40072887+AlexanderDCrane@users.noreply.github.com> Date: Fri, 8 Jun 2018 14:44:21 -0600 Subject: [PATCH] Escape user data (#3088) * Escape user data on extension_edit.php * Escape user data on gateway_edit.php * Escape user data on user_edit.php --- app/extensions/extension_edit.php | 76 +++++++++++++++---------------- app/gateways/gateway_edit.php | 52 ++++++++++----------- 2 files changed, 64 insertions(+), 64 deletions(-) diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index b47108f0e4..2efbdd90ef 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -770,13 +770,13 @@ echo " var new_ext = prompt('".$text['message-extension']."');\n"; echo " if (new_ext != null) {\n"; echo " if (!isNaN(new_ext)) {\n"; - echo " document.location.href='extension_copy.php?id=".$extension_uuid."&ext=' + new_ext;\n"; + echo " document.location.href='extension_copy.php?id=".escape($extension_uuid)."&ext=' + new_ext;\n"; echo " }\n"; echo " else {\n"; echo " var new_number_alias = prompt('".$text['message-number_alias']."');\n"; echo " if (new_number_alias != null) {\n"; echo " if (!isNaN(new_number_alias)) {\n"; - echo " document.location.href='extension_copy.php?id=".$extension_uuid."&ext=' + new_ext + '&alias=' + new_number_alias;\n"; + echo " document.location.href='extension_copy.php?id=".escape($extension_uuid)."&ext=' + new_ext + '&alias=' + new_number_alias;\n"; echo " }\n"; echo " }\n"; echo " }\n"; @@ -811,7 +811,7 @@ echo " ".$text['label-extension']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-extension']."\n"; echo "\n"; @@ -823,7 +823,7 @@ echo " ".$text['label-number_alias']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-number_alias']."\n"; echo "\n"; @@ -836,7 +836,7 @@ echo " ".$text['label-password']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo " ".$text['description-password']."\n"; echo "\n"; @@ -927,7 +927,7 @@ echo " ".$text['label-voicemail_password']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo " ".$text['description-voicemail_password']."\n"; echo "\n"; @@ -940,7 +940,7 @@ echo " ".$text['label-accountcode']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo " ".$text['description-accountcode']."\n"; echo "\n"; @@ -981,18 +981,18 @@ $device_mac_address = substr($device_mac_address, 0,2).'-'.substr($device_mac_address, 2,2).'-'.substr($device_mac_address, 4,2).'-'.substr($device_mac_address, 6,2).'-'.substr($device_mac_address, 8,2).'-'.substr($device_mac_address, 10,2); echo " \n"; echo " ".$row['line_number']."\n"; - echo " ".$device_mac_address."\n"; + echo " ".$device_mac_address."\n"; echo " ".$row['device_template']." \n"; //echo " ".$row['device_description']." \n"; echo " \n"; - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; echo " \n"; echo " \n"; } echo " \n"; echo " "; - echo " \n"; echo " \n"; for ($n = 1; $n <=30; $n++) { echo " \n"; @@ -1110,7 +1110,7 @@ echo " ".$text['label-effective_caller_id_name']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-effective_caller_id_name']."\n"; echo "\n"; @@ -1121,7 +1121,7 @@ echo " ".$text['label-effective_caller_id_number']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-effective_caller_id_number']."\n"; echo "\n"; @@ -1159,7 +1159,7 @@ } } else { - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-outbound_caller_id_name-custom']."\n"; } @@ -1199,7 +1199,7 @@ unset ($prep_statement); } else { - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-outbound_caller_id_number-custom']."\n"; } @@ -1211,7 +1211,7 @@ echo " ".$text['label-emergency_caller_id_name']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-emergency_caller_id_name']."\n"; echo "\n"; @@ -1222,7 +1222,7 @@ echo " ".$text['label-emergency_caller_id_number']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-emergency_caller_id_number']."\n"; echo "\n"; @@ -1233,8 +1233,8 @@ echo " ".$text['label-directory_full_name']."\n"; echo "\n"; echo "\n"; - echo " \n"; - echo " \n"; + echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-directory_full_name']."\n"; echo "\n"; @@ -1295,7 +1295,7 @@ echo " ".$text['label-limit_max']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-limit_max']."\n"; echo "\n"; @@ -1306,7 +1306,7 @@ echo " ".$text['label-limit_destination']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-limit_destination']."\n"; echo "\n"; @@ -1342,7 +1342,7 @@ echo " ".$text['label-voicemail_mail_to']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-voicemail_mail_to']."\n"; echo "\n"; @@ -1393,7 +1393,7 @@ //echo " \n"; echo " \n"; $missed_call_data = ($missed_call_app == 'text') ? format_phone($missed_call_data) : $missed_call_data; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-missed_call']."\n"; echo "\n"; @@ -1420,7 +1420,7 @@ echo " \n"; } else { - echo " \n"; + echo " \n"; } echo "
\n"; echo $text['description-toll_allow']."\n"; @@ -1433,7 +1433,7 @@ echo " ".$text['label-call_timeout']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-call_timeout']."\n"; echo "\n"; @@ -1457,7 +1457,7 @@ } echo " \n"; } else { - echo " \n"; + echo " \n"; } echo "
\n"; echo $text['description-call_group']."\n"; @@ -1551,7 +1551,7 @@ echo " ".$text['label-user_context']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-user_context']."\n"; echo "\n"; @@ -1582,7 +1582,7 @@ echo " ".$text['label-auth_acl']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-auth_acl']."\n"; echo "\n"; @@ -1593,7 +1593,7 @@ echo " ".$text['label-cidr']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-cidr']."\n"; echo "\n"; @@ -1626,7 +1626,7 @@ echo " ".$text['label-sip_force_expires']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-sip_force_expires']."\n"; echo "\n"; @@ -1638,7 +1638,7 @@ echo " ".$text['label-nibble_account']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-nibble_account']."\n"; echo "\n"; @@ -1650,7 +1650,7 @@ echo " ".$text['label-mwi_account']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-mwi_account']."\n"; echo "\n"; @@ -1684,7 +1684,7 @@ echo " ".$text['label-absolute_codec_string']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-absolute_codec_string']."\n"; echo "\n"; @@ -1732,10 +1732,10 @@ echo " \n"; @@ -1751,7 +1751,7 @@ echo " ".$text['label-dial_string']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-dial_string']."\n"; echo "\n"; @@ -1797,7 +1797,7 @@ echo " ".$text['label-description']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-description']."\n"; echo "\n"; @@ -1805,8 +1805,8 @@ echo " \n"; echo " \n"; if ($action == "update") { - echo " \n"; - echo " "; + echo " \n"; + echo " "; if (!permission_exists('extension_domain')) { echo " "; } diff --git a/app/gateways/gateway_edit.php b/app/gateways/gateway_edit.php index 48063b35a1..785415e5f7 100644 --- a/app/gateways/gateway_edit.php +++ b/app/gateways/gateway_edit.php @@ -368,7 +368,7 @@ echo " \n"; echo " \n"; if ($action == "update") { - echo " \n"; + echo " \n"; } echo " \n"; echo " \n"; @@ -389,7 +389,7 @@ echo " ".$text['label-gateway']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-gateway-name']."\n"; echo "\n"; @@ -400,7 +400,7 @@ echo " ".$text['label-username']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-username']."\n"; echo "\n"; @@ -411,7 +411,7 @@ echo " ".$text['label-password']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo " ".$text['description-password']."\n"; echo "\n"; @@ -422,7 +422,7 @@ echo " ".$text['label-from_user']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-from_user']."\n"; echo "\n"; @@ -433,7 +433,7 @@ echo " ".$text['label-from_domain']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-from_domain']."\n"; echo "\n"; @@ -444,7 +444,7 @@ echo " ".$text['label-proxy']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-proxy']."\n"; echo "\n"; @@ -455,7 +455,7 @@ echo " ".$text['label-realm']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-realm']."\n"; echo "\n"; @@ -467,7 +467,7 @@ echo "\n"; echo "\n"; if (strlen($expire_seconds) == 0) { $expire_seconds = "800"; } - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-expire_seconds']."\n"; echo "\n"; @@ -502,7 +502,7 @@ echo " ".$text['label-retry_seconds']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-retry_seconds']."\n"; echo "\n"; @@ -556,7 +556,7 @@ echo " ".$text['label-auth_username']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-auth_username']."\n"; echo "\n"; @@ -567,7 +567,7 @@ echo " ".$text['label-extension']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-extension']."\n"; echo "\n"; @@ -609,7 +609,7 @@ echo " ".$text['label-register_proxy']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-register_proxy']."\n"; echo "\n"; @@ -620,7 +620,7 @@ echo " ".$text['label-outbound_proxy']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-outbound_proxy']."\n"; echo "\n"; @@ -681,7 +681,7 @@ echo " ".$text['label-sip_cid_type']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-sip_cid_type']."\n"; echo "\n"; @@ -692,7 +692,7 @@ echo " ".$text['label-codec_prefs']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-codec_prefs']."\n"; echo "\n"; @@ -728,7 +728,7 @@ echo " ".$text['label-ping']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-ping']."\n"; echo "\n"; @@ -740,7 +740,7 @@ echo " ".$text['label-channels']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-channels']."\n"; echo "\n"; @@ -752,7 +752,7 @@ echo " ".$text['label-hostname']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-hostname']."\n"; echo "\n"; @@ -773,10 +773,10 @@ } foreach ($_SESSION['domains'] as $row) { if ($row['domain_uuid'] == $domain_uuid) { - echo " \n"; + echo " \n"; } else { - echo " \n"; + echo " \n"; } } echo " \n"; @@ -799,7 +799,7 @@ echo "\n"; echo "\n"; if (strlen($context) == 0) { $context = "public"; } - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-context']."\n"; echo "\n"; @@ -814,10 +814,10 @@ foreach ($sip_profiles as $row) { $sip_profile_name = $row["sip_profile_name"]; if ($profile == $sip_profile_name) { - echo " \n"; + echo " \n"; } else { - echo " \n"; + echo " \n"; } } echo " \n"; @@ -855,7 +855,7 @@ echo " ".$text['label-description']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-description']."\n"; echo "\n"; @@ -864,7 +864,7 @@ echo " \n"; echo " \n"; if ($action == "update") { - echo " \n"; + echo " \n"; } echo "
"; echo " \n";