JS: fixup visibility of DataFlow::HtmlAttributeNode

This commit is contained in:
Esben Sparre Andreasen
2019-02-15 09:03:40 +01:00
parent 4ce7ec1661
commit 80a716f3b3
2 changed files with 5 additions and 6 deletions

View File

@@ -742,22 +742,21 @@ module DataFlow {
/**
* A data flow node representing an HTML attribute.
*/
private class HtmlAttributeNode extends DataFlow::Node, THtmlAttributeNode {
class HtmlAttributeNode extends DataFlow::Node, THtmlAttributeNode {
HTML::Attribute attr;
HtmlAttributeNode() { this = THtmlAttributeNode(attr) }
override string toString() { result = attr.toString() }
override ASTNode getAstNode() { none() }
override BasicBlock getBasicBlock() { none() }
override predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
attr.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
}
/** Gets the attribute corresponding to this data flow node. */
HTML::Attribute getAttribute() { result = attr }
}
/**

View File

@@ -203,7 +203,7 @@ module DomBasedXss {
*/
class VHtmlSink extends DomBasedXss::Sink {
HTML::Attribute attr;
VHtmlSink() { this = DataFlow::THtmlAttributeNode(attr) and attr.getName() = "v-html" }
VHtmlSink() { this.(DataFlow::HtmlAttributeNode).getAttribute() = attr and attr.getName() = "v-html" }
HTML::Attribute getAttr() {
result = attr
}