mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
change getAnElementRead to getASubstringRead
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()) }
|
||||
}
|
||||
|
||||
@@ -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")]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user