Replies: 2 comments 1 reply
-
Hi @LFYSec, Thank you for raising this issue! Can you show me the |
Beta Was this translation helpful? Give feedback.
-
@LFYSec I looked into this today, and found that this isn't down to For most types, if The implementation of this behaviour can be seen at https://github.com/github/codeql/blob/main/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll#L127 If you're writing a custom query, you can opt back into array taint propagation for all types. For example, with your example code slightly adapted, this works for me: import java
import semmle.code.java.dataflow.TaintTracking
import semmle.code.java.dataflow.internal.ContainerFlow
class Cfg extends TaintTracking::Configuration {
Cfg() { this = "testConfig" }
override predicate isSource(DataFlow::Node n) {
n.asParameter().getName() = "roleIds"
}
override predicate isSink(DataFlow::Node n) {
n.asExpr().(Argument).getCall().getCallee().getName() = "testaa"
}
override predicate isAdditionalTaintStep(DataFlow::Node fromNode, DataFlow::Node toNode) {
arrayReadStep(fromNode, toNode, _)
}
}
from Cfg c, DataFlow::PathNode src, DataFlow::PathNode snk
where c.hasFlowPath(src, snk)
select src, snk |
Beta Was this translation helpful? Give feedback.
-
Hey, I want to ask, when I use TaintTracking, why there is no data flow from the roleIds parameter to testaaa(roleId)?
for (Long roleId : roleIds)
seems to cause the data flow to breakBeta Was this translation helpful? Give feedback.
All reactions