-
Notifications
You must be signed in to change notification settings - Fork 16
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
Adding Primitive Tainting #211
base: main
Are you sure you want to change the base?
Conversation
I noticed another thing during debugging #213. Currently, we can't disable sources related to primitive tainting in about:config. |
So, as an update/status recap from my point of view:
I looked at adding more sources/sinks to the WebIDL generator. My first impression was this would be a fairly involved change that certainly does not work for every operation. I will investigate further to check for cost/benefit tradeoffs.
This works as is; it is just user-unfriendly in its current form. This is fixed once #2 lands. So the major remaining points seem to be:
I think we can get a good grasp by running a) the benchmarks (e.g., Ares 6) that mach supports and perform the same tests we did for FP tracer. There, the primitive tainting was fairly fast (<15% overhead on page load times)
I will look further, but I believe it might be best to decouple this change from this PR. Reworking the flow representation has benefits that go beyond primitive tainting. I certainly recall fighting this for the hand sanitizer study. As this change seems fairly disruptive (i.e., all tooling would require a significant rework), we probably have to get this right. What might be an option would be to store the flow internally as a directed graph and then offer the code to lineralize the flows to their current form. My impression is that the current Foxhound users mainly use Playwright (we can make an example available here) or extensions (same applies). So, to sum up this point: I believe we should decouple the flow representation from this PR and offer to disable flow creation for primitive sources via the configuration, similar to how we allow disabling taint sources. This would allow us to merge this PR earlier and avoid divergence between mainline Foxhound and primitaint Foxhound. |
I agree that we should avoid diverging the main and primitaint branches, the idea of this PR is to have something we can merge to main. I would also be in favour of splitting up the work if possible. As you suggest I think a full blown move to graph based taint flows is going to be a big effort and should be handled in a separate PR (if at all...). |
In this branch properties of WebIDL files can be marked as taint sources with an attribute. This is super nice, but if one wants to disable one of them one has to note down their names during a build. This is pretty cumbersome. This commit tries to resolve this issue, as it simply adds every IDL based source to the properties defaults.
… to make Math library taint aware
Before Array.indexOf and Array.includes had subtle differences in behavior when it came to tainted values or keys when using said functions. This adds some special case for tainted numbers and unboxes them, so that they behave the same. This requires to flag tainted numbers as not bitwise comparable, which might have downstream effects (?)
This PR enables tainting for numbers, and is a mergable version of the https://github.com/SAP/project-foxhound/tree/primitaint branch.
This PR adds the following features:
There is still some work to do before the merge:
a = b + c
- if b and c are tainted, how does the taint flow look for c?See whether existing sources can be moved to the webidl generator