mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
JS: Exclude client-side sources from RegExpInjection
This commit is contained in:
@@ -27,7 +27,10 @@ module RegExpInjection {
|
||||
* expression injection.
|
||||
*/
|
||||
class RemoteFlowSourceAsSource extends Source {
|
||||
RemoteFlowSourceAsSource() { this instanceof RemoteFlowSource }
|
||||
RemoteFlowSourceAsSource() {
|
||||
this instanceof RemoteFlowSource and
|
||||
not this instanceof ClientSideRemoteFlowSource
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
function foo() {
|
||||
let taint = window.location.hash.substring(1);
|
||||
new RegExp(taint); // OK - we do not flag RegExp injection on the client side as the impact is too low
|
||||
}
|
||||
Reference in New Issue
Block a user