Changeset 930 in subversion


Ignore:
Timestamp:
Nov 25, 2007 12:34:19 PM (5 years ago)
Author:
thomasb
Message:

Fixed some potential security risks + updatedd changelog

Location:
trunk/roundcubemail
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r921 r930  
    11CHANGELOG RoundCube Webmail 
    22--------------------------- 
     3 
     42007/11/25 (thomasb) 
     5---------- 
     6- Applied UID fetch patch by Glen Ogilvie 
     7- Applied patch for correct Postgres instructions from ticket #1484674 
     8- Fix overriding of session vars when register_globals is on (#1484670) 
     9- Fix wrong Postgres setup instructions in INSTALL (#1484674) 
     10- Fix bug with case-sensitive folder names (#1484245) 
     11- Don't create default folders by default 
     12- Added Georgian localization by Zaza Zviadadze 
     13- Updated Russian localization 
     14- Fixed some potential security risks (audited by Andris) 
     15 
    316 
    4172007/11/20 (tomekp) 
  • trunk/roundcubemail/program/include/main.inc

    r925 r930  
    14331433  // use value from post 
    14341434  if (!empty($_POST[$fname])) 
    1435     $value = $_POST[$fname]; 
     1435    $value = get_input_value($fname, RCUBE_INPUT_POST); 
    14361436 
    14371437  $out = $input->show($value); 
  • trunk/roundcubemail/program/include/rcmail_template.inc

    r802 r930  
    832832    } 
    833833       
    834     $fields['host'] = isset($select_host) ? $select_host->show($_POST['_host']) : null; 
     834    $fields['host'] = isset($select_host) ? $select_host->show(get_input_value('_host', RCUBE_INPUT_POST)) : null; 
    835835    } 
    836836  else if (!strlen($CONFIG['default_host'])) 
    837837    { 
    838838    $input_host = new textfield(array('name' => '_host', 'id' => 'rcmloginhost', 'size' => 30)); 
    839     $fields['host'] = $input_host->show($_POST['_host']); 
     839    $fields['host'] = $input_host->show(get_input_value('_host', RCUBE_INPUT_POST)); 
    840840    } 
    841841 
  • trunk/roundcubemail/program/include/rcube_html.inc

    r786 r930  
    293293        continue; 
    294294 
    295       // encode textarea content 
    296       if ($key=='value') 
    297         $value = Q($value, 'strict', FALSE); 
    298  
    299295      // attributes with no value 
    300296      if (in_array($key, array('checked', 'multiple', 'disabled', 'selected', 'nowrap'))) 
     
    305301      // don't convert size of value attribute 
    306302      else if ($key=='value') 
    307         $attrib_arr[] = sprintf('%s="%s"', $this->_conv_case($key, 'attrib'), $value); 
     303        $attrib_arr[] = sprintf('%s="%s"', $this->_conv_case($key, 'attrib'), Q($value, 'strict', false)); 
    308304         
    309305      // regular tag attributes 
    310306      else 
    311         $attrib_arr[] = sprintf('%s="%s"', $this->_conv_case($key, 'attrib'), $this->_conv_case($value, 'value')); 
     307        $attrib_arr[] = sprintf('%s="%s"', $this->_conv_case($key, 'attrib'), $this->_conv_case(Q($value), 'value')); 
    312308    } 
    313309 
  • trunk/roundcubemail/program/steps/addressbook/func.inc

    r582 r930  
    3333// set list properties and session vars 
    3434if (!empty($_GET['_page'])) 
    35   { 
    36   $CONTACTS->set_page(intval($_GET['_page'])); 
    37   $_SESSION['page'] = $_GET['_page']; 
    38   } 
     35  $CONTACTS->set_page(($_SESSION['page'] = intval($_GET['_page']))); 
    3936else 
    4037  $CONTACTS->set_page(isset($_SESSION['page']) ?$_SESSION['page'] : 1); 
  • trunk/roundcubemail/program/steps/mail/func.inc

    r909 r930  
    3131// set imap properties and session vars 
    3232if ($mbox = get_input_value('_mbox', RCUBE_INPUT_GPC)) 
    33   { 
    34   $IMAP->set_mailbox($mbox); 
    35   $_SESSION['mbox'] = $mbox; 
    36   } 
     33  $IMAP->set_mailbox(($_SESSION['mbox'] = $mbox)); 
    3734 
    3835if (!empty($_GET['_page'])) 
    39   { 
    40   $IMAP->set_page((int)$_GET['_page']); 
    41   $_SESSION['page'] = (int)$_GET['_page']; 
    42   } 
     36  $IMAP->set_page(($_SESSION['page'] = intval($_GET['_page']))); 
    4337 
    4438// set mailbox to INBOX if not set 
     
    863857    $attrib['id'] = 'rcmailMsgBody'; 
    864858 
    865   $safe_mode = (bool)$_GET['_safe']; 
     859  $safe_mode = intval($_GET['_safe']); 
    866860  $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id')); 
    867861  $out = '<div '. $attrib_str . ">\n"; 
     
    11981192  global $CONFIG, $IMAP, $MESSAGE; 
    11991193   
    1200   if (!is_array($MESSAGE) || !is_array($MESSAGE['parts']) || !($_GET['_uid'] && $_GET['_part']) || !$MESSAGE['parts'][$_GET['_part']]) 
     1194  $part = get_input_value('_part', RCUBE_INPUT_GPC); 
     1195  if (!is_array($MESSAGE) || !is_array($MESSAGE['parts']) || !($_GET['_uid'] && $_GET['_part']) || !$MESSAGE['parts'][$part]) 
    12011196    return ''; 
    12021197     
    1203   $part = &$MESSAGE['parts'][$_GET['_part']]; 
     1198  $part = &$MESSAGE['parts'][$part]; 
    12041199   
    12051200  $attrib_str = create_attrib_string($attrib, array('id', 'class', 'style', 'cellspacing', 'cellpadding', 'border', 'summary')); 
     
    12311226  global $MESSAGE; 
    12321227   
    1233   $part = $MESSAGE['parts'][$_GET['_part']]; 
     1228  $part = $MESSAGE['parts'][get_input_value('_part', RCUBE_INPUT_GPC)]; 
    12341229  $ctype_primary = strtolower($part->ctype_primary); 
    12351230 
  • trunk/roundcubemail/program/steps/mail/get.inc

    r912 r930  
    8989      list($new_parts, $new_attachments) = 
    9090        rcmail_parse_message($MESSAGE['structure'], 
    91                              array('safe' => (bool)$_GET['_safe'], 
     91                             array('safe' => intval($_GET['_safe']), 
    9292                                   'prefer_html' => TRUE, 
    9393                                   'get_url' => $GET_URL.'&_part=%s')); 
     
    103103 
    104104      $OUTPUT = new rcube_html_page(); 
    105       $OUTPUT->write(rcmail_print_body($part, (bool)$_GET['_safe'])); 
     105      $OUTPUT->write(rcmail_print_body($part, intval($_GET['_safe']))); 
    106106      } 
    107107    else 
     
    131131  $cont = '';  
    132132  list($MESSAGE['parts']) = rcmail_parse_message($MESSAGE['structure'], 
    133                                                  array('safe' => (bool)$_GET['_safe'], 
     133                                                 array('safe' => intval($_GET['_safe']), 
    134134                                                 'get_url' => $GET_URL.'&_part=%s')); 
    135135 
  • trunk/roundcubemail/program/steps/mail/sendmail.inc

    r816 r930  
    200200if (!empty($_POST['_priority'])) 
    201201  { 
    202   $priority = (int)$_POST['_priority']; 
     202  $priority = intval($_POST['_priority']); 
    203203  $a_priorities = array(1=>'highest', 2=>'high', 4=>'low', 5=>'lowest'); 
    204204  if ($str_priority = $a_priorities[$priority]) 
  • trunk/roundcubemail/program/steps/mail/show.inc

    r668 r930  
    5858    list($MESSAGE['parts'], $MESSAGE['attachments']) = rcmail_parse_message( 
    5959      $MESSAGE['structure'], 
    60       array('safe' => (bool)$_GET['_safe'], 
     60      array('safe' => intval($_GET['_safe']), 
    6161            'prefer_html' => $CONFIG['prefer_html'], 
    6262            'get_url' => $GET_URL.'&_part=%s') 
     
    7272  // give message uid to the client 
    7373  $OUTPUT->set_env('uid', $MESSAGE['UID']); 
    74   $OUTPUT->set_env('safemode', (bool)$_GET['_safe']); 
     74  $OUTPUT->set_env('safemode', intval($_GET['_safe'])); 
    7575 
    7676  $next = $prev = -1; 
Note: See TracChangeset for help on using the changeset viewer.