diff --git a/NEWS b/NEWS index fa0b73f9d..029c86ece 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ Bug fixes - [web] fixed generic avatar in lists (#3719) - [web] fixed validation in Sieve filter editor + - [web] properly encode events and tasks rawsource to avoid XSS issues (#3718) 3.1.2 (2016-06-06) ------------------ diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 4f6072ac8..b0f901a3d 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -875,7 +875,7 @@ static NSArray *reminderValues = nil; [content appendFormat: @"%@", [[self clientObject] contentAsString]]; [response setHeader: @"text/plain; charset=utf-8" forKey: @"content-type"]; - [response appendContentString: content]; + [response appendContentString: [content stringByEscapingHTMLString]]; return response; } diff --git a/UI/WebServerResources/js/Scheduler/ComponentController.js b/UI/WebServerResources/js/Scheduler/ComponentController.js index 6f28c18d8..81be3c7fd 100644 --- a/UI/WebServerResources/js/Scheduler/ComponentController.js +++ b/UI/WebServerResources/js/Scheduler/ComponentController.js @@ -167,23 +167,23 @@ template: [ '', ' ', - '
',
-            data,
-            '    
', + '
',
             '  
', ' ', ' ' + l('Close') + '', ' ', '
' ].join(''), - controller: ComponentRawSourceDialogController + controller: ComponentRawSourceDialogController, + locals: { data: data } }); /** * @ngInject */ - ComponentRawSourceDialogController.$inject = ['scope', '$mdDialog']; - function ComponentRawSourceDialogController(scope, $mdDialog) { + ComponentRawSourceDialogController.$inject = ['scope', '$mdDialog', 'data']; + function ComponentRawSourceDialogController(scope, $mdDialog, data) { + scope.data = data; scope.close = function() { $mdDialog.hide(); };