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

Java: CWE-266 - Query to detect Intent URI Permission Manipulation in Android applications #6975

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
@atorralba
Copy link
Contributor

@atorralba atorralba commented Oct 27, 2021

This PR adds a query to detect Intent URI Permission Manipulation in Android applications. The query detects when an exported Activity is obtaining a user-provided Intent and redirecting it back to the calling application. Also, it requires that a non-exported Content Provider with the attribute android:grantUriPermissions="true" exists in the project.

Description

When an externally provided Intent is returned to an Activity with setResult, a malicious application could exploit this by manipulating the Intent to grant itself permissions to access arbitrary Content Providers that are accessible by the vulnerable application.

Evaluation

The query finds 3 TP when run on a set of 1k Android open source projects.

By adding the source defined in #6963, this goes up to 4 TP results (the extra result occurs in an intentionally vulnerable application).

@atorralba atorralba requested a review from as a code owner Oct 27, 2021
@github-actions github-actions bot added the Java label Oct 27, 2021
Removed duplicated code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment