[bug] Allow specific safe variables

This is a bug fix for recent security changes. These particular variables are essential to the SIP profile: record-template.
This commit is contained in:
FusionPBX
2023-04-26 10:20:13 -06:00
committed by GitHub
parent 4a71d7a49a
commit 4859282306

View File

@@ -267,6 +267,13 @@
-- sip_profile_setting_value = sip_profile_setting_value:gsub("%$", "");
--end
--sanitize the sip profile setting value, allow specific safe variables
sip_profile_setting_value = xml.sanitize(sip_profile_setting_value);
sip_profile_setting_value = string.gsub(sip_profile_setting_value, "{domain_name}", "${domain_name}");
sip_profile_setting_value = string.gsub(sip_profile_setting_value, "{strftime", "${strftime");
sip_profile_setting_value = string.gsub(sip_profile_setting_value, "{uuid}", "${uuid}");
sip_profile_setting_value = string.gsub(sip_profile_setting_value, "{record_ext}", "${record_ext}");
--set the parameters
if (sip_profile_setting_name) then
xml:append([[ <param name="]] .. xml.sanitize(sip_profile_setting_name) .. [[" value="]] .. xml.sanitize(sip_profile_setting_value) .. [["/>]]);