From 8920222cb724c6181a0f1d2ce23647cc26df45b0 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 22 Mar 2026 15:27:13 +0000 Subject: [PATCH] Security voicemail listen_to_recording add shell_esc --- .../resources/functions/listen_to_recording.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/switch/resources/scripts/app/voicemail/resources/functions/listen_to_recording.lua b/app/switch/resources/scripts/app/voicemail/resources/functions/listen_to_recording.lua index 3fc0cfd5f..8388612c1 100644 --- a/app/switch/resources/scripts/app/voicemail/resources/functions/listen_to_recording.lua +++ b/app/switch/resources/scripts/app/voicemail/resources/functions/listen_to_recording.lua @@ -23,6 +23,9 @@ -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. +--load the functions + require("resources.functions.shell_esc") + --define function to listen to the recording function listen_to_recording(message_number, uuid, created_epoch, caller_id_name, caller_id_number, message_status, message_play) @@ -115,7 +118,7 @@ end --get the file type - command = "file -b --mime-type "..message_location; + command = "file -b --mime-type "..shell_esc(message_location); local handle = io.popen(command); local mime_type = trim(handle:read("*a")); handle:close(); @@ -127,7 +130,7 @@ end --rename the file - os.execute('mv '..message_location..' '..message_location..'.'..vm_message_ext); + os.execute('mv '..shell_esc(message_location)..' '..shell_esc(message_location..'.'..vm_message_ext)); end); dbh:release() elseif (storage_type == "http_cache") then @@ -300,4 +303,4 @@ end session:execute("sleep", "400"); end - end \ No newline at end of file + end