We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5bbfa3 commit 0a29d13Copy full SHA for 0a29d13
javascript/ql/src/semmle/javascript/security/dataflow/XssThroughDom.qll
@@ -62,13 +62,14 @@ module XssThroughDom {
62
this.getArgument(0).mayHaveStringValue(unsafeAttributeName())
63
) and
64
// looks like a $("<p>" + ... ) source, which is benign for this query.
65
- not this
66
- .getReceiver()
67
- .(DataFlow::CallNode)
68
- .getAnArgument()
69
- .(StringOps::ConcatenationRoot)
70
- .getConstantStringParts()
71
- .substring(0, 1) = "<"
+ not exists(DataFlow::Node prefix |
+ DomBasedXss::isPrefixOfJQueryHtmlString(this
+ .getReceiver()
+ .(DataFlow::CallNode)
+ .getAnArgument(), prefix)
+ |
+ prefix.getStringValue().regexpMatch("\\s*<.*")
72
+ )
73
}
74
75
0 commit comments