Open tmbrbr opened 8 months ago
The changes generally look perfectly fine; I'm wondering whether we might lose information that could be interesting.
If I understand it correctly, if we repeatedly perform the same operation, we won't add this anymore.
Say, and this is somewhat contrived, we have code like this:
let foo = location.hash;
for(int i = 0; i < 3; i++) {
foo = decodeURIComponent(foo);
}
If, for example, we do not do URI encoding, the taint flow only has 1 decode operation. It might be possible to encode several times to end up with an XSS payload after this loop, which we would not be able to find anymore, right?
Good catch, perhaps we can add a counter to the taint operations to keep track of this.
Don't add a new TaintNode if the operation is the same (i.e. same Operation, Arguments and Location) as the previous operation. This way, we only add a single operation in e.g. a for loop.