]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Read title value as text instead of HTML 7359/head
authorTrevor Bramble <inbox@trevorbramble.com>
Thu, 3 Dec 2015 02:08:00 +0000 (18:08 -0800)
committerTrevor Bramble <inbox@trevorbramble.com>
Thu, 3 Dec 2015 02:08:00 +0000 (18:08 -0800)
Using `.html` when grabbing the `title` value allows it to be evaluated by JavaScript, a potential security loophole.

js/foundation/foundation.tooltip.js

index d6cb3f638c4455908890bbced139b8a635bb42ac..e5cba11f381d317ddd22da38c76aebc0292ca93a 100644 (file)
         tip_template = window[settings.tip_template];
       }
 
-      var $tip = $(tip_template(this.selector($target), $('<div></div>').html($target.attr('title')).html())),
+      var $tip = $(tip_template(this.selector($target), $('<div></div>').html($target.attr('title')).text())),
           classes = this.inheritable_classes($target);
 
       $tip.addClass(classes).appendTo(settings.append_to);