Changeset 7598

Show
Ignore:
Timestamp:
04/29/09 19:46:45 (4 years ago)
Author:
p_lindheimer
Message:

Merged revisions 7552-7571,7573-7597 via svnmerge from
http://svn.freepbx.org/freepbx/branches/2.5

........

r7552 | mickecarlsson | 2009-03-26 23:09:45 -0700 (Thu, 26 Mar 2009) | 1 line


Added GPL license text to various files

........

r7591 | p_lindheimer | 2009-04-27 12:09:11 -0700 (Mon, 27 Apr 2009) | 1 line


fix error message so it is same wether username was correct or not

........

r7592 | p_lindheimer | 2009-04-27 13:34:43 -0700 (Mon, 27 Apr 2009) | 1 line


make sure the requested report display is included in the menu items list, otherwise bogus values can be injected

........

r7593 | p_lindheimer | 2009-04-27 13:54:36 -0700 (Mon, 27 Apr 2009) | 1 line


make sure no bogus characters or scripts are injected in a get with the POST/GET variables that reporting uses

........

r7594 | p_lindheimer | 2009-04-27 15:23:37 -0700 (Mon, 27 Apr 2009) | 1 line


run extdisplay and all the derivatives through htmlspecialchars since many pages echo it in the display, this keeps any bogus characters that could create issues from being injected if a url is manually be typed in

........

r7595 | p_lindheimer | 2009-04-27 15:25:25 -0700 (Mon, 27 Apr 2009) | 1 line


filter the search parameters (and sort) to keep bogus entries from creating problems when redisplayed or links generated

........

r7597 | p_lindheimer | 2009-04-29 16:35:39 -0700 (Wed, 29 Apr 2009) | 1 line


add security check when action verb is set to protect against CSRF attacks, but can be disabled with CHECREFERER=false in amportal.conf

........

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk

    • Property svnmerge-integrated changed from /freepbx/branches/2.5:1-7351,7461-7544 to /freepbx/branches/2.5:1-7351,7461-7544,7552-7571,7573-7597
  • freepbx/trunk/amp_conf/htdocs/admin/cdr/lib/defines.php

    r6816 r7598  
    9797    if (isset($_POST[$test_var])) {  
    9898      global $$test_var; 
    99       $$test_var = $_POST[$test_var];  
     99      $$test_var = htmlspecialchars($_POST[$test_var]);  
    100100    } elseif (isset($_GET[$test_var])) { 
    101101      global $$test_var;  
    102       $$test_var = $_GET[$test_var]
     102      $$test_var = htmlspecialchars($_GET[$test_var])
    103103    } 
    104104  } 
  • freepbx/trunk/amp_conf/htdocs/admin/config.php

    r7348 r7598  
    1919$type = isset($_REQUEST['type'])?$_REQUEST['type']:'setup'; 
    2020$display = isset($_REQUEST['display'])?$_REQUEST['display']:''; 
    21 $extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; 
     21if (isset($_REQUEST['extdisplay'])) { 
     22  $extdisplay = htmlspecialchars($_REQUEST['extdisplay']); 
     23  $_REQUEST['extdisplay'] = $extdisplay; 
     24} else { 
     25  $extdisplay = null; 
     26
    2227$skip = isset($_REQUEST['skip'])?$_REQUEST['skip']:0; 
    2328$action = isset($_REQUEST['action'])?$_REQUEST['action']:null; 
     
    3944 
    4045include('header.php'); 
     46/* If there is an action request then some sort of update is usually being done. 
     47   This will protect from cross site request forgeries unless disabled. 
     48*/ 
     49if ($action != '' && $amp_conf['CHECKREFERER']) { 
     50  if (isset($_SERVER['HTTP_REFERER'])) { 
     51    $referer = parse_url($_SERVER['HTTP_REFERER']); 
     52    $refererok = (trim($referer['host']) == trim($_SERVER['HTTP_HOST'])) ? true : false; 
     53  } else { 
     54    $refererok = false; 
     55  } 
     56 
     57  if (!$refererok) { 
     58    die_freepbx(_("POTENTIAL SECURITY BREACH: an attempt was made to modify settings from a URL that did not come from a FreePBX page. This action has been blocked because the HTTP_REFERER does not match your current SERVER. If you require this access, you can set CHECKREFERER=false in amportal.conf to disable this security check")); 
     59  } 
     60} 
    4161 
    4262// handle special requests 
     
    286306    $itemid = ''; 
    287307    foreach($possibilites as $possibility) { 
    288       if ( isset($_REQUEST[$possibility]) && $_REQUEST[$possibility] != '' )  
    289         $itemid = $_REQUEST[$possibility]; 
     308      if ( isset($_REQUEST[$possibility]) && $_REQUEST[$possibility] != '' ) { 
     309        $itemid = htmlspecialchars($_REQUEST[$possibility]); 
     310        $_REQUEST[$possibility] = $itemid; 
     311      } 
    290312    } 
    291313 
  • freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php

    r7478 r7598  
    745745  'FOPDISABLE'      => array('bool' , false), 
    746746  'ZAP2DAHDICOMPAT' => array('bool' , false), 
     747  'CHECKREFERER'    => array('bool' , true), 
    747748); 
    748749 
  • freepbx/trunk/amp_conf/htdocs/admin/reports.php

    r6976 r7598  
    3232} 
    3333 
    34 $display=1; 
    35 if (isset($_REQUEST['display'])) { 
    36   $display=$_REQUEST['display']; 
    37 } 
    38  
    3934// setup menu  
    4035$menu = array( 
     
    4540  ); 
    4641 
     42if (isset($_REQUEST['display']) && isset($menu[$_REQUEST['display']])) { 
     43  $display=$_REQUEST['display']; 
     44} else { 
     45  $display=1; 
     46} 
     47 
    4748// CDR viewer from www.areski.net.   
    4849// Changes for -- AMP -- commented in: 
  • freepbx/trunk/amp_conf/htdocs/recordings/includes/display.php

    r6600 r7598  
    8787               <form class='bar' action='" . $_SESSION['ARI_ROOT'] . "' method='GET' name='search'> 
    8888                 <input type=hidden name=m value=" . $m . ">   
    89                  <input type=text name=q size=40 value='" . $q . "' maxlength=256> 
     89                 <input type=text name=q size=40 value='" . htmlspecialchars($q) . "' maxlength=256> 
    9090                 " . $option_text . "  
    9191                 <input type=hidden name=start value=0>  
  • freepbx/trunk/amp_conf/htdocs/recordings/includes/login.php

    r6816 r7598  
    193193              } 
    194194              else { 
    195                 $_SESSION['ari_error'] = "Incorrect Password"
     195                $_SESSION['ari_error'] = _("Incorrect Username or Password")
    196196                return; 
    197197              } 
     
    265265                  else if ($protocol_username==$username && 
    266266                             $protocol_password!=$password) { 
    267                     $_SESSION['ari_error'] = _("Incorrect Password"); 
     267                    $_SESSION['ari_error'] = _("Incorrect Username or Password"); 
    268268                    return; 
    269269                  } 
  • freepbx/trunk/amp_conf/htdocs/recordings/modules/callmonitor.module

    r7305 r7598  
    8787        <script> 
    8888        <!-- 
    89           window.location = \"" . $_SESSION['ARI_ROOT'] . "?m=" . $m . "&q=" . $q . "&start=" . $start . "&span=" . $span . "&order=" . $order . "&sort=" . $sort . "&duration_filter=" . $duration_filter . "\" 
     89          window.location = \"" . $_SESSION['ARI_ROOT'] . "?m=" . $m . "&q=" . urlencode($q) . "&start=" . $start . "&span=" . $span . "&order=" . $order . "&sort=" . $sort . "&duration_filter=" . $duration_filter . "\" 
    9090        // --> 
    9191        </script> 
     
    291291          <input type=hidden name=f value=recAction> 
    292292          <input type=hidden name=a value=''> 
    293           <input type=hidden name=q value=" . $q . "> 
     293          <input type=hidden name=q value=" . urlencode($q) . "> 
    294294          <input type=hidden name=start value=" . $start . "> 
    295295          <input type=hidden name=span value=" . $span . "> 
  • freepbx/trunk/amp_conf/htdocs/recordings/modules/voicemail.module

    r7305 r7598  
    118118                // add folder to list 
    119119                $ret .= "<p><small><small> 
    120                            <a " . $class . " href='" . $_SESSION['ARI_ROOT'] . "?m=Voicemail&q=" . $q . "&folder=" . $f. "'> 
     120                           <a " . $class . " href='" . $_SESSION['ARI_ROOT'] . "?m=Voicemail&q=" . urlencode($q) . "&folder=" . $f. "'> 
    121121                           " . $fn . " (" . $record_count . ")" . " 
    122122                           </a> 
     
    334334        <script> 
    335335        <!-- 
    336           window.location = \"" . $_SESSION['ARI_ROOT'] . "?m=" . $m . "&folder=" . $folder . "&q=" . $q . "&start=" . $start . "&span=" . $span . "&order=" . $order . "&sort=" . $sort . "\" 
     336          window.location = \"" . $_SESSION['ARI_ROOT'] . "?m=" . $m . "&folder=" . $folder . "&q=" . urlencode($q) . "&start=" . $start . "&span=" . $span . "&order=" . $order . "&sort=" . $sort . "\" 
    337337        // --> 
    338338        </script> 
     
    371371    $span = $span=='' ? 15 : $span; 
    372372    $order = $order=='' ? 'calldate' : $order; 
    373     $sort = $sort=='' ? 'desc' : $sort
     373    $sort = ($sort=='' || strtolower($sort) == 'desc') ? 'desc' : 'asc'
    374374 
    375375    $paths = split(';',$ASTERISK_VOICEMAIL_PATH); 
     
    625625        <input type=hidden name=f value=msgAction> 
    626626        <input type=hidden name=a value=''> 
    627         <input type=hidden name=q value=" . $q . "> 
     627        <input type=hidden name=q value=" . urlencode($q) . "> 
    628628        <input type=hidden name=folder value=" . $folder . "> 
    629629        <input type=hidden name=start value=" . $start . "> 
  • freepbx/trunk/amportal.conf

    r7088 r7598  
     1# This file is part of FreePBX. 
     2# 
     3#    FreePBX is free software: you can redistribute it and/or modify 
     4#    it under the terms of the GNU General Public License as published by 
     5#    the Free Software Foundation, either version 2 of the License, or 
     6#    (at your option) any later version. 
     7# 
     8#    FreePBX is distributed in the hope that it will be useful, 
     9#    but WITHOUT ANY WARRANTY; without even the implied warranty of 
     10#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     11#    GNU General Public License for more details. 
     12# 
     13#    You should have received a copy of the GNU General Public License 
     14#    along with FreePBX.  If not, see <http://www.gnu.org/licenses/>. 
     15# 
    116# This file contains settings for components of the Asterisk Management Portal 
    217# Spaces are not allowed! 
     
    210225# GUI will continue to refer to these as ZAP but it will use the proper DAHDI channels. 
    211226# This will also keep Zap Channel DIDs working. 
     227 
     228# CHECKREFERER=true|false 
     229# DEFAULT VALUE: true 
     230# When set to the default value of true, all requests into FreePBX that might possibly add/edit/delete settings will 
     231# be validated to assure the request is coming from the server. This will protect the system from CSRF (cross site  
     232# request forgery) attacks. It will have the effect of preventing legitimately entering URLs that could modify 
     233# settings which can be allowed by changing this field to false 
     234# 
  • freepbx/trunk/install_amp

    r7088 r7598  
    11#!/usr/bin/php -q 
    22<?php 
    3  
     3//This file is part of FreePBX. 
     4// 
     5//    FreePBX is free software: you can redistribute it and/or modify 
     6//    it under the terms of the GNU General Public License as published by 
     7//    the Free Software Foundation, either version 2 of the License, or 
     8//    (at your option) any later version. 
     9// 
     10//    FreePBX is distributed in the hope that it will be useful, 
     11//    but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     13//    GNU General Public License for more details. 
     14// 
     15//    You should have received a copy of the GNU General Public License 
     16//    along with FreePBX.  If not, see <http://www.gnu.org/licenses/>. 
     17// 
     18//    Copyright 2006, qldrob 
     19//    Copyright 2009, Bandwith.com 
     20// 
    421require_once ("libfreepbx.install.php"); 
    522 
  • freepbx/trunk/libfreepbx.install.php

    r6215 r7598  
    11<?php 
     2//This file is part of FreePBX. 
     3// 
     4//    FreePBX is free software: you can redistribute it and/or modify 
     5//    it under the terms of the GNU General Public License as published by 
     6//    the Free Software Foundation, either version 2 of the License, or 
     7//    (at your option) any later version. 
     8// 
     9//    FreePBX is distributed in the hope that it will be useful, 
     10//    but WITHOUT ANY WARRANTY; without even the implied warranty of 
     11//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     12//    GNU General Public License for more details. 
     13// 
     14//    You should have received a copy of the GNU General Public License 
     15//    along with FreePBX.  If not, see <http://www.gnu.org/licenses/>. 
     16// 
     17//    Copyright 2007, Philippe Lindheimer 
     18// 
    219 
    320/********************************************************************************************************************/ 
  • freepbx/trunk/setup_svn.php

    r7094 r7598  
    11#!/usr/bin/php -q 
    22<?php 
     3//This file is part of FreePBX. 
     4// 
     5//    FreePBX is free software: you can redistribute it and/or modify 
     6//    it under the terms of the GNU General Public License as published by 
     7//    the Free Software Foundation, either version 2 of the License, or 
     8//    (at your option) any later version. 
     9// 
     10//    FreePBX is distributed in the hope that it will be useful, 
     11//    but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     13//    GNU General Public License for more details. 
     14// 
     15//    You should have received a copy of the GNU General Public License 
     16//    along with FreePBX.  If not, see <http://www.gnu.org/licenses/>. 
     17// 
     18//    Copyright 2007, Philippe Lindheimer 
     19// 
    320 
    421/** setup_svn.php 
  • freepbx/trunk/start_asterisk

    r7526 r7598  
    11#!/usr/bin/env bash 
    2  
     2# This file is part of FreePBX. 
     3
     4#    FreePBX is free software: you can redistribute it and/or modify 
     5#    it under the terms of the GNU General Public License as published by 
     6#    the Free Software Foundation, either version 2 of the License, or 
     7#    (at your option) any later version. 
     8
     9#    FreePBX is distributed in the hope that it will be useful, 
     10#    but WITHOUT ANY WARRANTY; without even the implied warranty of 
     11#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     12#    GNU General Public License for more details. 
     13
     14#    You should have received a copy of the GNU General Public License 
     15#    along with FreePBX.  If not, see <http://www.gnu.org/licenses/>. 
     16
     17#    Copyright 2007, Philippe Lindheimer 
     18
    319ROOT_UID=0   # root uid is 0 
    420E_NOTROOT=67   # Non-root exit error 
  • freepbx/trunk/update_l10n.sh

    r2836 r7598  
    11#! /bin/sh 
    2  
     2# This file is part of FreePBX. 
     3
     4#    FreePBX is free software: you can redistribute it and/or modify 
     5#    it under the terms of the GNU General Public License as published by 
     6#    the Free Software Foundation, either version 2 of the License, or 
     7#    (at your option) any later version. 
     8
     9#    FreePBX is distributed in the hope that it will be useful, 
     10#    but WITHOUT ANY WARRANTY; without even the implied warranty of 
     11#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     12#    GNU General Public License for more details. 
     13
     14#    You should have received a copy of the GNU General Public License 
     15#    along with FreePBX.  If not, see <http://www.gnu.org/licenses/>. 
     16
     17#    Copyright 2006, diego_iastrubni 
     18
    319echo "Creating new POT template file" 
    420find amp_conf/htdocs/admin -name '*.php' | xargs xgettext -L PHP -o freepbx.pot --keyword=_ -