-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Swift: Support MaD summaries #10699
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
Swift: Support MaD summaries #10699
Conversation
1b48c66
to
56523d4
Compare
56523d4
to
0065a5a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, a big improvement for taint.
private class UrlSessionSummaries extends SummaryModelCsv { | ||
override predicate row(string row) { | ||
row = | ||
";URLSession;true;dataTask(with:completionHandler:);;;Argument[0];Argument[1].Parameter[0];taint" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this, along with the test for it!
I think the data
returned from a dataTask
should ultimately be a taint source rather than a summary - it doesn't really matter if the URL itself was tainted, the data returned from it is. But at the very least we have something here and we know we can cope with callbacks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Indeed, I agree that this should be a taint source as well. Having a taint summary will still be useful though (so that we can still track flow through these library calls in queries that don't pick any RemoteFlowSource
as a taint source).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added it to the taint source TODO list.
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
This PR does a couple of MaD-summary related things:
A commit-by-commit review is encouraged. The first commit adds support for selecting fields as flow sources. This is motivated by #10597, and this PR changes those flow sources to specified using MaD.
The remaining commits adds support for specifying summaries in MaD for Swift. It took some extra dataflow work to support callbacks, but in the end, we can now track flow from
taintedUrl
todata!
in the call tosink
: