-
Notifications
You must be signed in to change notification settings - Fork 225
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
Fail to reference String.prototype models in prologue.js #1222
Comments
By the way, I was using method |
@ppflower thanks for the report. I can confirm this is a bug, and I've added a test case here: It's an issue with string constants; WALA successfully finds the CG edge to |
@msridhar Thanks for replying. Now I understand what happened. It seems that when WALA handles javascript function dispatch, it relies on the concrete heap object to decide the target method. Here is another problem I ran into about very common callbacks in javascript programs. It is a bit more complex than the previous one. Consider the following piece of code:
But it is not possible to model all possible properties in I assume that when the receiver object variable points to nothing in an invoke statement, WALA might try to predict the type of target and create one(in this case String). The strategy might be decided by user. I'm not very familiar with WALA code, it's just a quick idea :) Thanks a lot for your time. |
I am trying to do taint analysis on the following javascript code with WALA, but failed.
The IR of the function main is as follows:
It seems that there is no def instruction of
v18
(used in instruction 14), which should represent the functionreplace
defined inString.prototype
inprologue.js
. It leads to an incomplete callgraph(no edges to functionsreplace
andsink
), and a broken taint chain. At first I thought it was because WALA cannot decide the return value type of functionsource
. After I changed the source to a literal string like the following, there is still no right reference of the functionreplace
.Other functions like
replace
(modeled not directly inprologue.js
, but in global prototype objects) have the same problem. I would like to confirm whether or not this is a bug. And if not, I would like to know how I can reference and analyze such functions correctly. Thanks.The text was updated successfully, but these errors were encountered: