Skip to content

Java: Add sources for content providers in Android#6724

Merged
atorralba merged 5 commits into
github:mainfrom
atorralba:atorralba/android-contentprovider-sources
Sep 28, 2021
Merged

Java: Add sources for content providers in Android#6724
atorralba merged 5 commits into
github:mainfrom
atorralba:atorralba/android-contentprovider-sources

Conversation

@atorralba
Copy link
Copy Markdown
Contributor

Content providers manage access to a central repository of data. They can be accessed by Android applications through an interface that allows different actions (query, insert, update, delete, open a file...). If a content provider is exported, any application in the device can send arbitrary data to that interface, which opens a new attack surface against the application the provider is part of.

This PR adds source models for the entry-point methods of content providers that can be externally accessed when the content provider is exported. Note that some code was added for working with permissions in content providers, but it's ultimately not used to discard potential sources because a malicious application could request those permissions to exploit a vulnerability anyway.

This increases our CVE coverage by detecting CVE-2019-5454.

@atorralba atorralba requested a review from a team as a code owner September 21, 2021 10:24
@github-actions github-actions Bot added the Java label Sep 21, 2021
Comment thread java/ql/lib/semmle/code/java/dataflow/FlowSources.qll
Comment thread java/ql/lib/semmle/code/java/frameworks/android/Android.qll
Comment thread java/ql/test/library-tests/frameworks/android/content-provider/test.ql Outdated
Add tests for non-exported providers
Comment thread java/ql/lib/semmle/code/java/dataflow/FlowSources.qll Outdated
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
@atorralba atorralba merged commit cec6cd0 into github:main Sep 28, 2021
@atorralba atorralba deleted the atorralba/android-contentprovider-sources branch September 28, 2021 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants