Skip to content

Commit 2e3df74

Browse files
committed
add importScripts as a sink for js/client-side-unvalidated-url-redirection
1 parent fee7ce6 commit 2e3df74

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,15 @@ module ClientSideUrlRedirect {
132132
}
133133
}
134134

135+
/**
136+
* An argument to `importScripts(..)` - which is used inside `WebWorker`s to import new scripts - viewed as a `ScriptUrlSink`.
137+
*/
138+
class ImportScriptsSink extends ScriptUrlSink {
139+
ImportScriptsSink() {
140+
this = DataFlow::globalVarRef("importScripts").getACall().getAnArgument()
141+
}
142+
}
143+
135144
/**
136145
* A script or iframe `src` attribute, viewed as a `ScriptUrlSink`.
137146
*/

0 commit comments

Comments
 (0)