-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with new Dataflow module #14740
Comments
|
Thanks for your question. I've asked our C++ analysis engineers to take a look. |
|
Hi @tardigrade-9, Yes, unfortunately it has not been possible for us to do a one-to-one porting of the old, and now deprecated dataflow library. This is because the old dataflow library often was too imprecise in its distinction between a pointer and what it pointed to. The problem is that the So the The new library has a predicate another predicate called Here's an updated query that should find the right use-after-free vulnerabilities. The only difference should be the use of /**
* @kind path-problem
*/
import cpp
import semmle.code.cpp.dataflow.new.DataFlow
import Flow::PathGraph
module UAFConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node arg) {
exists(FunctionCall fc |
fc.getArgument(0) = arg.asDefiningArgument() and
fc.getTarget().hasGlobalOrStdName("free")
)
}
predicate isSink(DataFlow::Node sink) { dereferenced(sink.asIndirectExpr()) }
}
module Flow = DataFlow::Global<UAFConfig>;
from Flow::PathNode source, Flow::PathNode sink
where Flow::flowPath(source, sink)
select sink, source, sink, "Potential use-after-free vulnerability: memory is $@ and $@.", source,
"freed here", sink, "used here"I've also updated it to use the module-based API. I will ask around to see how we can update the QL code in the workshop repository. |
|
Thanks @MathiasVP , the query is working.. Appreciate the quick response... |
Unable to find UAF
The above query is able to find the UAF. I refered this from githubuniversal workshop. Since this DataFlow module is deprecated, I used new::DataFlow to rewrite the same query, but I don't see any results.
Additionally, I also tried module approach as mentioned in docs, no luck there too.
Can someone please point what I am missing, thanks.
The text was updated successfully, but these errors were encountered: