-
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
[C++] Taint analysis does not appear to handle aliasing #18151
Comments
Indeed we currently don't yet do alias analysis in taint flow, the problem is actually related to what you raised in #18101. This is something we're working on: at some point we had implemented it, but we had to roll back because of performance issues. However, we're working to get those resolved and make alias analysis work with data flow and taint tracking. |
Hmm, that is unfortunate. Is this only the case in C++ or also in other supported languages? |
Sorry, I don't currently know what's the status of this in other languages. Any specific language you are interested in? |
Yes, Java and JavaScript in particular. |
As far as I know, aliasing in Java and Javascript is restricted to (implicit) references and is covered (no pointers to worry about). |
Taint analysis appears to loose taint whenever assignments to pointer aliases are involved.
This first example is very simple but the flow from
source
tosink
is not found. It appears to me as though there is no alias analysis being performed if this simple case doesn’t work?This is the output I get from this example. Only the flow via
a
is detected.I had wondered if maybe an alias analysis is only performed to resolve dynamic dispatch, but in this simple case it has the same problem. Only the first flow is found, not the second one
This is the output. (The line numbers are off by 10, because I’ve omitted defining
source
andtarget
again).The query I run in all of these cases is the following
CodeQL version: 2.19.3
The text was updated successfully, but these errors were encountered: