Skip to content

Commit 80a716f

Browse files
author
Esben Sparre Andreasen
committed
JS: fixup visibility of DataFlow::HtmlAttributeNode
1 parent 4ce7ec1 commit 80a716f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

javascript/ql/src/semmle/javascript/dataflow/DataFlow.qll

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -742,22 +742,21 @@ module DataFlow {
742742
/**
743743
* A data flow node representing an HTML attribute.
744744
*/
745-
private class HtmlAttributeNode extends DataFlow::Node, THtmlAttributeNode {
745+
class HtmlAttributeNode extends DataFlow::Node, THtmlAttributeNode {
746746
HTML::Attribute attr;
747747

748748
HtmlAttributeNode() { this = THtmlAttributeNode(attr) }
749749

750750
override string toString() { result = attr.toString() }
751751

752-
override ASTNode getAstNode() { none() }
753-
754-
override BasicBlock getBasicBlock() { none() }
755-
756752
override predicate hasLocationInfo(
757753
string filepath, int startline, int startcolumn, int endline, int endcolumn
758754
) {
759755
attr.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
760756
}
757+
758+
/** Gets the attribute corresponding to this data flow node. */
759+
HTML::Attribute getAttribute() { result = attr }
761760
}
762761

763762
/**

javascript/ql/src/semmle/javascript/security/dataflow/Xss.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ module DomBasedXss {
203203
*/
204204
class VHtmlSink extends DomBasedXss::Sink {
205205
HTML::Attribute attr;
206-
VHtmlSink() { this = DataFlow::THtmlAttributeNode(attr) and attr.getName() = "v-html" }
206+
VHtmlSink() { this.(DataFlow::HtmlAttributeNode).getAttribute() = attr and attr.getName() = "v-html" }
207207
HTML::Attribute getAttr() {
208208
result = attr
209209
}

0 commit comments

Comments
 (0)