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

Swift: Add sinks for sqlite3 and SQLite.swift to swift/cleartext-storage-database #14312

Merged
merged 11 commits into from
Oct 5, 2023

Conversation

geoffw0
Copy link
Contributor

@geoffw0 geoffw0 commented Sep 25, 2023

Add sinks for the sqlite3 C API and SQLite.swift library to the swift/cleartext-storage-database query - i.e. places where these libraries write data to a database. Also adds a small number of flow summaries for SQLite.Swift, which has an interface where you construct objects representing interfaces (only a small part of this is modelled, we will only catch very simple uses of that particular interface for now).

Performance seems unaffected (DCA will confirm).

MRVA run found no new results from these changes (though quite a lot of new results since public beta).

@geoffw0 geoffw0 added the Swift label Sep 25, 2023
@geoffw0 geoffw0 requested a review from a team as a code owner September 25, 2023 20:22
";QueryType;true;insert(_:);;;Argument[0];database-store",
";QueryType;true;insert(_:_:);;;Argument[0..1];database-store",
";QueryType;true;insert(or:_:);;;Argument[1];database-store",
";QueryType;true;insertMany(_:);;;Argument[0];database-store",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be Argument[0].CollectionElement?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it can't be because at present MAD doesn't support access path syntax on sinks (or sources). I'm pushing for this feature because I think it's the natural way to express sinks like this.

The case should covered by the additional taint step at present, and that will be upgraded to an implicit read step in this query in #14357 .

I've just added tests for insertMany to this PR, as it's a special case that clearly deserves a test of its own.

@geoffw0
Copy link
Contributor Author

geoffw0 commented Oct 5, 2023

Fixed merge conflicts.

@rdmarsh2 rdmarsh2 merged commit bbec408 into github:main Oct 5, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants