Changeset 382 in subversion


Ignore:
Timestamp:
Nov 22, 2006 6:42:37 AM (7 years ago)
Author:
thomasb
Message:

Fixed XSS vulnerability (Bug #1484109)

Location:
trunk/roundcubemail
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/index.php

    r344 r382  
    33 +-----------------------------------------------------------------------+ 
    44 | RoundCube Webmail IMAP Client                                         | 
    5  | Version 0.1-20060907                                                  | 
     5 | Version 0.1-20061122                                                  | 
    66 |                                                                       | 
    77 | Copyright (C) 2005-2006, RoundCube Dev. - Switzerland                 | 
     
    4141*/ 
    4242 
    43 define('RCMAIL_VERSION', '0.1-20060907'); 
     43define('RCMAIL_VERSION', '0.1-20061122'); 
    4444 
    4545// define global vars 
     
    9191 
    9292// catch some url/post parameters 
    93 $_task = get_input_value('_task', RCUBE_INPUT_GPC); 
    94 $_action = get_input_value('_action', RCUBE_INPUT_GPC); 
     93$_task = strip_quotes(get_input_value('_task', RCUBE_INPUT_GPC)); 
     94$_action = strip_quotes(get_input_value('_action', RCUBE_INPUT_GPC)); 
    9595$_framed = (!empty($_GET['_framed']) || !empty($_POST['_framed'])); 
    9696 
    97 if (empty($_task)) 
     97// use main task if empty or invalid value 
     98if (empty($_task) || !in_array($_task, $MAIN_TASKS)) 
    9899  $_task = 'mail'; 
    99100 
     
    373374 
    374375// parse main template 
    375 // only allow these templates to be included 
    376 if (in_array($_task, $MAIN_TASKS)) 
    377   parse_template($_task); 
     376parse_template($_task); 
    378377 
    379378 
  • trunk/roundcubemail/program/include/main.inc

    r371 r382  
    10641064  } 
    10651065 
    1066  
     1066/** 
     1067 * Remove single and double quotes from given string 
     1068 */ 
     1069function strip_quotes($str) 
     1070{ 
     1071  return preg_replace('/[\'"]/', '', $str); 
     1072} 
    10671073 
    10681074 
Note: See TracChangeset for help on using the changeset viewer.