mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
Merge branch 'main' into dragAndDrop
This commit is contained in:
@@ -45,9 +45,20 @@ module ArrayTaintTracking {
|
||||
)
|
||||
or
|
||||
// `array.reduce` with tainted value in callback
|
||||
// The callback parameters are: (previousValue, currentValue, currentIndex, array)
|
||||
call.(DataFlow::MethodCallNode).getMethodName() = "reduce" and
|
||||
pred = call.getArgument(0).(DataFlow::FunctionNode).getAReturn() and // Require the argument to be a closure to avoid spurious call/return flow
|
||||
succ = call
|
||||
exists(DataFlow::FunctionNode callback |
|
||||
callback = call.getArgument(0) // Require the argument to be a closure to avoid spurious call/return flow
|
||||
|
|
||||
pred = callback.getAReturn() and
|
||||
succ = call
|
||||
or
|
||||
pred = call.getReceiver() and
|
||||
succ = callback.getParameter([1, 3]) // into currentValue or array
|
||||
or
|
||||
pred = [call.getArgument(1), callback.getAReturn()] and
|
||||
succ = callback.getParameter(0) // into previousValue
|
||||
)
|
||||
or
|
||||
// `array.push(e)`, `array.unshift(e)`: if `e` is tainted, then so is `array`.
|
||||
pred = call.getAnArgument() and
|
||||
|
||||
@@ -430,6 +430,12 @@ module DOM {
|
||||
result.hasUnderlyingType("Element")
|
||||
or
|
||||
result.hasUnderlyingType(any(string s | s.matches("HTML%Element")))
|
||||
or
|
||||
exists(DataFlow::ClassNode cls |
|
||||
cls.getASuperClassNode().getALocalSource() =
|
||||
DataFlow::globalVarRef(any(string s | s.matches("HTML%Element"))) and
|
||||
result = cls.getAnInstanceReference()
|
||||
)
|
||||
}
|
||||
|
||||
module LocationSource {
|
||||
|
||||
Reference in New Issue
Block a user