Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/roundcube/roundcubemail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2016-01-16 19:48:22 +0300
committerAleksander Machniak <alec@alec.pl>2016-03-06 16:31:07 +0300
commit4a408843b0ef816daf70a472a02b78cd6073a4d5 (patch)
treecacb8d3c24c016948b4f22b15e0f9d0402db81d5 /plugins/zipdownload
parentd4df3748cfaacadf52b19eb37b2a476df80525a9 (diff)
Protect download urls against CSRF using unique request tokens (#1490642)
Send X-Frame-Options headers with every HTTP response
Diffstat (limited to 'plugins/zipdownload')
-rw-r--r--plugins/zipdownload/zipdownload.js2
-rw-r--r--plugins/zipdownload/zipdownload.php6
2 files changed, 6 insertions, 2 deletions
diff --git a/plugins/zipdownload/zipdownload.js b/plugins/zipdownload/zipdownload.js
index 228b04f8f..6f918d298 100644
--- a/plugins/zipdownload/zipdownload.js
+++ b/plugins/zipdownload/zipdownload.js
@@ -54,7 +54,7 @@ function rcmail_zipdownload(mode)
// default .eml download of single message
if (mode == 'eml') {
var uid = rcmail.get_single_uid();
- rcmail.goto_url('viewsource', rcmail.params_from_uid(uid, {_save: 1}));
+ rcmail.goto_url('viewsource', rcmail.params_from_uid(uid, {_save: 1}), false, true);
return;
}
diff --git a/plugins/zipdownload/zipdownload.php b/plugins/zipdownload/zipdownload.php
index 2928f4978..241de5489 100644
--- a/plugins/zipdownload/zipdownload.php
+++ b/plugins/zipdownload/zipdownload.php
@@ -63,7 +63,7 @@ class zipdownload extends rcube_plugin
'_action' => 'plugin.zipdownload.attachments',
'_mbox' => $rcmail->output->env['mailbox'],
'_uid' => $rcmail->output->env['uid'],
- ));
+ ), false, false, true);
$link = html::a(array('href' => $href, 'class' => 'button zipdownload'),
rcube::Q($this->gettext('downloadall'))
@@ -120,6 +120,10 @@ class zipdownload extends rcube_plugin
public function download_attachments()
{
$rcmail = rcmail::get_instance();
+
+ // require CSRF protected request
+ $rcmail->request_security_check(rcube_utils::INPUT_GET);
+
$imap = $rcmail->get_storage();
$temp_dir = $rcmail->config->get('temp_dir');
$tmpfname = tempnam($temp_dir, 'zipdownload');