Changeset 13922

Show
Ignore:
Timestamp:
03/27/12 11:46:48 (1 year ago)
Author:
p_lindheimer
Message:

fixes #5729 validate the callback number and also double check when pulling it from the AstDB in case it has been tampered with in there

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.10/amp_conf/htdocs/recordings/includes/callme.php

    r13781 r13922  
    5353function callme_getnum($exten) 
    5454{ 
    55         global $astman; 
    56         $cmd    = "database get AMPUSER $exten/callmenum"; 
     55 global $astman; 
     56 $cmd     = "database get AMPUSER $exten/callmenum"; 
    5757  $callme_num   = ''; 
    58         $results  = $astman->Command($cmd); 
     58 $results   = $astman->Command($cmd); 
    5959 
    6060  if (is_array($results)) 
     
    7979        global $astman; 
    8080 
     81        $callme_num = preg_replace("/[^0-9*#+]/", "", $callme_num); 
    8182        $cmd = "database put AMPUSER $exten/callmenum $callme_num"; 
    8283        $astman->Command($cmd); 
     
    8990{ 
    9091  global $astman; 
     92 
     93  if (!preg_match("/^[0-9*#+]+$/",$to)) {  
     94    freepbx_log(FPBX_LOG_SECURITY, sprintf(_('Malformed callme number passed to callme_startcall $to field could be Security Breach: %s'), $to)); 
     95    return false; 
     96  } 
     97  if (!preg_match("/^[0-9]+$/",$from)) {  
     98    freepbx_log(FPBX_LOG_SECURITY, sprintf(_('Malformed callme number passed to callme_startcall $from field could be Security Breach: %s'), $to)); 
     99    return false; 
     100  } 
     101  // TODO: should I check that new_path is a valid sound file to play and bomb out if not as possible security protection? 
     102 
    91103  $channel  = "Local/$to@from-internal/n"; 
    92104  $context  = "vm-callme";