Skip to content
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

Foxhound: Don't add duplicate taint operations #207

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tmbrbr
Copy link
Contributor

@tmbrbr tmbrbr commented Mar 11, 2024

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.

@tmbrbr tmbrbr requested a review from leeN March 11, 2024 10:42
@tmbrbr tmbrbr self-assigned this Mar 11, 2024
@leeN
Copy link
Collaborator

leeN commented Mar 11, 2024

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?

@tmbrbr
Copy link
Contributor Author

tmbrbr commented Mar 11, 2024

Good catch, perhaps we can add a counter to the taint operations to keep track of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants