@@ -338,45 +338,7 @@ module DomBasedXss {
338338 /**
339339 * A Vue `v-html` attribute, viewed as an XSS sink.
340340 */
341- class VHtmlSink extends DomBasedXss:: Sink {
342- HTML:: Attribute attr ;
343-
344- VHtmlSink ( ) {
345- this .( DataFlow:: HtmlAttributeNode ) .getAttribute ( ) = attr and attr .getName ( ) = "v-html"
346- }
347-
348- /**
349- * Gets the HTML attribute of this sink.
350- */
351- HTML:: Attribute getAttr ( ) { result = attr }
352- }
353-
354- /**
355- * A taint propagating data flow edge through a string interpolation of a
356- * Vue instance property to a `v-html` attribute.
357- *
358- * As an example, `<div v-html="prop"/>` reads the `prop` property
359- * of `inst = new Vue({ ..., data: { prop: source } })`, if the
360- * `div` element is part of the template for `inst`.
361- */
362- class VHtmlSourceWrite extends TaintTracking:: AdditionalTaintStep {
363- VHtmlSink attr ;
364-
365- VHtmlSourceWrite ( ) {
366- exists ( Vue:: Instance instance , string expr |
367- attr .getAttr ( ) .getRoot ( ) =
368- instance .getTemplateElement ( ) .( Vue:: Template:: HtmlElement ) .getElement ( ) and
369- expr = attr .getAttr ( ) .getValue ( ) and
370- // only support for simple identifier expressions
371- expr .regexpMatch ( "(?i)[a-z0-9_]+" ) and
372- this = instance .getAPropertyValue ( expr )
373- )
374- }
375-
376- override predicate step ( DataFlow:: Node pred , DataFlow:: Node succ ) {
377- pred = this and succ = attr
378- }
379- }
341+ class VHtmlSink extends Vue:: VHtmlAttribute , DomBasedXss:: Sink { }
380342
381343 /**
382344 * A property read from a safe property is considered a sanitizer.
0 commit comments