summaryrefslogtreecommitdiffstats
path: root/lib/private/templatelayout.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-11-28 12:19:58 +0100
committerLukas Reschke <lukas@owncloud.com>2015-11-28 12:21:53 +0100
commitf3e9106864421d902cb3751fdd0004f84b369938 (patch)
tree4b95bf59fb688f4628e213fa16b4187ec74e4cec /lib/private/templatelayout.php
parentd305412a357f31174abff757602b343c24cd91c1 (diff)
downloadnextcloud-server-f3e9106864421d902cb3751fdd0004f84b369938.tar.gz
nextcloud-server-f3e9106864421d902cb3751fdd0004f84b369938.zip
Don't trust update server
In case the update server may deliver malicious content this would allow an adversary to inject arbitrary HTML into the response. So very bad stuff. While signing the response would be better and something we can also do in the future (considering the code signing work), this is already a good first start.
Diffstat (limited to 'lib/private/templatelayout.php')
-rw-r--r--lib/private/templatelayout.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/private/templatelayout.php b/lib/private/templatelayout.php
index 7d16823d2a8..f5974128b73 100644
--- a/lib/private/templatelayout.php
+++ b/lib/private/templatelayout.php
@@ -85,7 +85,9 @@ class OC_TemplateLayout extends OC_Template {
if(isset($data['version']) && $data['version'] != '' and $data['version'] !== Array()) {
$this->assign('updateAvailable', true);
$this->assign('updateVersion', $data['versionstring']);
- $this->assign('updateLink', $data['web']);
+ if(substr($data['web'], 0, 8) === 'https://') {
+ $this->assign('updateLink', $data['web']);
+ }
\OCP\Util::addScript('core', 'update-notification');
} else {
$this->assign('updateAvailable', false); // No update available or not an admin user