change getAnElementRead to getASubstringRead

This commit is contained in:
Erik Krogh Kristensen
2020-05-05 13:33:21 +02:00
parent 8711a8744c
commit 3568439769
3 changed files with 3 additions and 3 deletions

View File

@@ -29,7 +29,7 @@ DataFlow::SourceNode schemeOf(DataFlow::Node url) {
// url.split(":")[0]
exists(StringSplitCall split |
split.getSeparator() = ":" and
result = split.getAnElementRead(0) and
result = split.getASubstringRead(0) and
url = split.getBaseString()
)
or

View File

@@ -178,5 +178,5 @@ class StringSplitCall extends DataFlow::MethodCallNode {
* Gets a read of the `i`th element from the split string.
*/
bindingset[i]
DataFlow::Node getAnElementRead(int i) { result = getAPropertyRead(i.toString()) }
DataFlow::Node getASubstringRead(int i) { result = getAPropertyRead(i.toString()) }
}

View File

@@ -285,7 +285,7 @@ module DomBasedXss {
StringSplitCall splitCall;
QueryPrefixSanitizer() {
this = splitCall.getAnElementRead(0) and
this = splitCall.getASubstringRead(0) and
splitCall.getSeparator() = "?" and
splitCall.getBaseString().getALocalSource() = [DOM::locationRef(), DOM::locationRef().getAPropertyRead("href")]
}