mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
make ATM anti sink model for dojo.require
This commit is contained in:
@@ -204,5 +204,8 @@ predicate isOtherModeledArgument(DataFlow::Node n, FilteringReason reason) {
|
|||||||
call.getCalleeName() = "next" and
|
call.getCalleeName() = "next" and
|
||||||
exists(DataFlow::FunctionNode f | call = f.getLastParameter().getACall()) and
|
exists(DataFlow::FunctionNode f | call = f.getLastParameter().getACall()) and
|
||||||
reason instanceof NextFunctionCallReason
|
reason instanceof NextFunctionCallReason
|
||||||
|
or
|
||||||
|
call = DataFlow::globalVarRef("dojo").getAPropertyRead("require").getACall() and
|
||||||
|
reason instanceof DojoRequireReason
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ newtype TFilteringReason =
|
|||||||
TArgumentToArrayReason() or
|
TArgumentToArrayReason() or
|
||||||
TArgumentToBuiltinGlobalVarRefReason() or
|
TArgumentToBuiltinGlobalVarRefReason() or
|
||||||
TConstantReceiverReason() or
|
TConstantReceiverReason() or
|
||||||
TBuiltinCallNameReason()
|
TBuiltinCallNameReason() or
|
||||||
|
TDojoRequireReason()
|
||||||
|
|
||||||
/** A reason why a particular endpoint was filtered out by the endpoint filters. */
|
/** A reason why a particular endpoint was filtered out by the endpoint filters. */
|
||||||
abstract class FilteringReason extends TFilteringReason {
|
abstract class FilteringReason extends TFilteringReason {
|
||||||
@@ -194,3 +195,9 @@ class BuiltinCallNameReason extends NotASinkReason, TBuiltinCallNameReason {
|
|||||||
|
|
||||||
override int getEncoding() { result = 27 }
|
override int getEncoding() { result = 27 }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class DojoRequireReason extends NotASinkReason, TDojoRequireReason {
|
||||||
|
override string getDescription() { result = "DojoRequire" }
|
||||||
|
|
||||||
|
override int getEncoding() { result = 28 }
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user