mirror of
https://github.com/ansible/awx.git
synced 2026-05-22 00:07:40 -02: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
|
* 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.
|
* default placement to the left and delay to the config setting.
|
||||||
*/
|
*/
|
||||||
.directive('awToolTip', function() {
|
.directive('awToolTip', function($sce) {
|
||||||
return function(scope, element, attrs) {
|
return function(scope, element, attrs) {
|
||||||
var delay = (attrs.delay !== undefined && attrs.delay !== null) ? attrs.delay : ($AnsibleConfig) ? $AnsibleConfig.tooltip_delay : {show: 500, hide: 100},
|
var delay = (attrs.delay !== undefined && attrs.delay !== null) ? attrs.delay : ($AnsibleConfig) ? $AnsibleConfig.tooltip_delay : {show: 500, hide: 100},
|
||||||
placement;
|
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({
|
$(element).tooltip({
|
||||||
placement: placement,
|
placement: placement,
|
||||||
delay: delay,
|
delay: delay,
|
||||||
|
|||||||
Reference in New Issue
Block a user