Java dataflow configuration - redirecting method calls made to subinterfaces #19665
Unanswered
the-cartographer
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
When doing dataflow analysis in Java, is it possible to "redirect" calls made to a method on a subinterface to a specific implementation?
I'm working in a microservices codebase where each service's client has interfaces that are generally organised like this;
The actual plumbing/implementation differences between sync and async calls happens at the transport layer (and is not relevant to my analysis), so on the server side only a single implementation exists for
getFoo
regardless on whether a sync or async call was madeDataflow analysis is working out of the box as expected in simple cases where the base interface is used and the corresponding implementation can be found
However I also want CodeQL to follow the flow in these scenarios where a subinterface is used, and guide it to the implementation found in
com.acme.foo.server.FooServer
And
I've tried (and failed 😭) for a a few hours now to define an
isAdditionalFlowStep(DataFlow::Node n1, DataFlow::Node n2)
predicate that achieves this, but I'm not exactly clear on how to connect the call to the actual implementation I'm after - would someone be able to help or point me towards an example I can borrow from? 🙏Beta Was this translation helpful? Give feedback.
All reactions