Skip to content

Commit 13288be

Browse files
committed
make ATM anti sink model for dojo.require
1 parent 9ffc029 commit 13288be

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/CoreKnowledge.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ predicate isOtherModeledArgument(DataFlow::Node n, FilteringReason reason) {
209209
call.getCalleeName() = "next" and
210210
exists(DataFlow::FunctionNode f | call = f.getLastParameter().getACall()) and
211211
reason instanceof NextFunctionCallReason
212+
or
213+
call = DataFlow::globalVarRef("dojo").getAPropertyRead("require").getACall() and
214+
reason instanceof DojoRequireReason
212215
)
213216
or
214217
(exists(Base64::Decode d | n = d.getInput()) or exists(Base64::Encode d | n = d.getInput())) and

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/FilteringReasons.qll

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ newtype TFilteringReason =
3131
TConstantReceiverReason() or
3232
TBuiltinCallNameReason() or
3333
TBase64ManipulationReason() or
34-
TJQueryArgumentReason()
34+
TJQueryArgumentReason() or
35+
TDojoRequireReason()
3536

3637
/** A reason why a particular endpoint was filtered out by the endpoint filters. */
3738
abstract class FilteringReason extends TFilteringReason {
@@ -208,3 +209,9 @@ class JQueryArgumentReason extends NotASinkReason, TJQueryArgumentReason {
208209

209210
override int getEncoding() { result = 29 }
210211
}
212+
213+
class DojoRequireReason extends NotASinkReason, TDojoRequireReason {
214+
override string getDescription() { result = "DojoRequire" }
215+
216+
override int getEncoding() { result = 30 }
217+
}

0 commit comments

Comments
 (0)