Ignore:
Timestamp:
Feb 3, 2011 4:12:35 PM (2 years ago)
Author:
thomasb
Message:

Prevent from relaying arbitrary requests through modcss.inc (security issue)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/steps/mail/func.inc

    r4484 r4488  
    11951195function rcmail_alter_html_link($matches) 
    11961196{ 
    1197   global $EMAIL_ADDRESS_PATTERN; 
     1197  global $RCMAIL, $EMAIL_ADDRESS_PATTERN; 
    11981198 
    11991199  $tag = $matches[1]; 
     
    12021202 
    12031203  if ($tag == 'link' && preg_match('/^https?:\/\//i', $attrib['href'])) { 
    1204     $attrib['href'] = "?_task=utils&_action=modcss&u=" . urlencode($attrib['href']) 
    1205         . "&c=" . urlencode($GLOBALS['rcmail_html_container_id']); 
     1204    $tempurl = 'tmp-' . md5($attrib['href']) . '.css'; 
     1205    $_SESSION['modcssurls'][$tempurl] = $attrib['href']; 
     1206    $attrib['href'] = $RCMAIL->url(array('task' => 'utils', 'action' => 'modcss', 'u' => $tempurl, 'c' => $GLOBALS['rcmail_html_container_id'])); 
    12061207    $end = ' />'; 
    12071208  } 
Note: See TracChangeset for help on using the changeset viewer.