Skip to content

Taint tracking with C++ virtual tables #3660

@nununoisy

Description

@nununoisy

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.

Metadata

Metadata

Assignees

Labels

C++questionFurther information is requested

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions