mirror of
https://github.com/ansible/awx.git
synced 2026-02-17 19:20:05 -03:30
XSS character escaping for tooltips
I've added character escaping for tooltips to avoid XSS security breaches
This commit is contained in:
@@ -389,7 +389,7 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job
|
||||
* Include the standard TB data-XXX attributes to controll a tooltip's appearance. We will
|
||||
* default placement to the left and delay to the config setting.
|
||||
*/
|
||||
.directive('awToolTip', function() {
|
||||
.directive('awToolTip', function($sce) {
|
||||
return function(scope, element, attrs) {
|
||||
var delay = (attrs.delay !== undefined && attrs.delay !== null) ? attrs.delay : ($AnsibleConfig) ? $AnsibleConfig.tooltip_delay : {show: 500, hide: 100},
|
||||
placement;
|
||||
@@ -409,6 +409,9 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job
|
||||
});
|
||||
});
|
||||
|
||||
attrs.awToolTip = attrs.awToolTip.replace(/</g, "<");
|
||||
attrs.awToolTip = attrs.awToolTip.replace(/>/g, ">");
|
||||
attrs.awToolTip = $sce.getTrustedHtml(attrs.awToolTip);
|
||||
$(element).tooltip({
|
||||
placement: placement,
|
||||
delay: delay,
|
||||
|
||||
Reference in New Issue
Block a user