From eac6f09832780b12307ad747ab32ceb6c3a08cc0 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 31 Mar 2023 13:34:22 -0600 Subject: [PATCH] Update how dialplan_detail_type is sanitized These detail types are safe: ${sip_to_user} and ${sip_req_user} --- app/destinations/destination_imports.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/destinations/destination_imports.php b/app/destinations/destination_imports.php index 5f3d590c24..5af19a1cc7 100644 --- a/app/destinations/destination_imports.php +++ b/app/destinations/destination_imports.php @@ -276,9 +276,21 @@ $dialplan_detail_type = "destination_number"; } + //authorized specific dialplan_detail_type that are safe, sanitize all other values + switch ($dialplan_detail_type) { + case 'destination_number': + break; + case '${sip_to_user}': + break; + case '${sip_req_user}': + break; + default: + $dialplan_detail_type = xml::sanitize($dialplan_detail_type); + } + //build the xml dialplan $array["dialplans"][$row_id]["dialplan_xml"] = "\n"; - $array["dialplans"][$row_id]["dialplan_xml"] .= " \n"; + $array["dialplans"][$row_id]["dialplan_xml"] .= " \n"; $array["dialplans"][$row_id]["dialplan_xml"] .= " \n"; $array["dialplans"][$row_id]["dialplan_xml"] .= " \n"; $array["dialplans"][$row_id]["dialplan_xml"] .= " \n";