Description of the issue
I am trying to run the ExecTainted.ql query on some test C++ code and I am finding that the query is not finding the vulnerable code. I've posted the test code in a Gist if you want to examine or run queries on it.
I am expecting the taint to be tracked from std::fgets to a call to std::system within the base class. The derivative class uses std::strcat to assemble a potentially vulnerable command string. I did not use C++ strings since I have found that they are always lost in taint tracking, but that's a separate issue.
I have tried modifying some of the taint tracking QL, such as modifying ExecTainted.ql to use taintedIncludingGlobalVars, as well as modifying the DataFlowFunction overrides for some relevant C string functions. However, I was still unable to get CodeQL to return the intended result.
Description of the issue
I am trying to run the
ExecTainted.qlquery on some test C++ code and I am finding that the query is not finding the vulnerable code. I've posted the test code in a Gist if you want to examine or run queries on it.I am expecting the taint to be tracked from
std::fgetsto a call tostd::systemwithin the base class. The derivative class usesstd::strcatto assemble a potentially vulnerable command string. I did not use C++ strings since I have found that they are always lost in taint tracking, but that's a separate issue.I have tried modifying some of the taint tracking QL, such as modifying
ExecTainted.qlto usetaintedIncludingGlobalVars, as well as modifying theDataFlowFunctionoverrides for some relevant C string functions. However, I was still unable to get CodeQL to return the intended result.