Changeset c170bfc in github


Ignore:
Timestamp:
Sep 5, 2011 4:39:52 AM (22 months ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.7, release-0.8
Children:
67eecde
Parents:
94a5a24
Message:

Protect from Clickjacking by sending X-Frame-Options headers (#1487037)

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • config/main.inc.php.dist

    rf7b58af rc170bfc  
    237237// check referer of incoming requests 
    238238$rcmail_config['referer_check'] = false; 
     239 
     240// X-Frame-Options HTTP header value sent to prevent from Clickjacking. 
     241// Possible values: sameorigin|deny. Set to false in order to disable sending them 
     242$rcmail_confoig['x_frame_options'] = 'sameorigin'; 
    239243 
    240244// this key is used to encrypt the users imap password which is stored 
  • program/include/rcube_template.php

    r9e443d1 rc170bfc  
    357357        $template = preg_replace_callback('/<form\s+([^>]+)>/Ui', array($this, 'alter_form_tag'), $template); 
    358358        $this->footer = preg_replace_callback('/<form\s+([^>]+)>/Ui', array($this, 'alter_form_tag'), $this->footer); 
     359         
     360        // send clickjacking protection headers 
     361        $iframe = $this->framed || !empty($_REQUEST['_framed']); 
     362        if (!headers_sent() && ($xframe = $this->app->config->get('x_frame_options', 'sameorigin'))) 
     363            header('X-Frame-Options: ' . ($iframe && $xframe == 'deny' ? 'sameorigin' : $xframe)); 
    359364 
    360365        // call super method 
Note: See TracChangeset for help on using the changeset viewer.