partialFlow exists, but the corresponding partialFlowRev doesn't for a Codeql Query #14092
Replies: 1 comment
-
The issue is access paths. These can be seen if you print In brief, the partial flow goes That means we arrive at the sink (the return value By contrast the reverse partial flow insists that the access path is empty at the sink (the Sometimes though, we don't want If we add the following to the predicate allowImplicitRead(DataFlow::Node n, DataFlow::ContentSet c) {
isSink(n) and c instanceof DataFlow::FieldContent
} then data-flow will allow us, upon reaching a sink, to implicitly read out any remaining access path. In fact if you look at the library module With this added, we're able to make the final step |
Beta Was this translation helpful? Give feedback.
-
I am working on this project:
https://github.com/trydent-io/jooby-samples , and interested in a flow in this file:
https://github.com/trydent-io/jooby-samples/blob/master/jooby-sample-rest-api-jackson/src/main/java/org/jooby/sample/RestApiJacksonMain.java
where a firstName / lastName rest parameter is returned from method (inside the Person Class) - so Created this Configuration:
the isSource and isSink return the expected values, but I can't get the flow , so tried partial data flow:
And got the expected results...
When trying
RestReturnDataFlow::flowPath(source,sink) returns Nothing
orMyPartialDataFlow::partialFlowRev( source, sink, dist)
instead of the partialFlow statement
Nothing is returned ,
How can I get the flow (+ the path) ?
I tried importing the module
PartialPathGraph
like it was suggested in this documenation https://codeql.github.com/docs/writing-codeql-queries/debugging-data-flow-queries-using-partial-flow/ to understand better what happens, but the import doesn't work ,Beta Was this translation helpful? Give feedback.
All reactions