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

fix(android): Isolate provider access to a subdirectory #901

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

breautek
Copy link
Contributor

Platforms affected

Android

Motivation and Context

The file provider is what grants app delegates (such as the camera app) access for reading and/or writing. It is what allows the camera intent to write it's image to the app's internal cache directory. The previous configuration allowed access to the entire cache directory which could be perceived as a security risk.

Using a sub-directory will at least isolate access to that specific directory and won't expose other cache files that the app may have stored. The chosen directory is something that should only be used by this plugin, and the directory will be mostly empty assuming that users call the cleanup API. Worst case scenario it may have images that was previously captured by the user.

Description

Update to provider to path to use a subdirectory, and updated the create code to use subdirectory.

Testing

Tested on using android simulator using getPicture API.
Paramedic tests also passes.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@breautek breautek added this to the 8.0.0 milestone Oct 24, 2024
@breautek breautek mentioned this pull request Oct 25, 2024
5 tasks
@breautek breautek requested a review from erisu October 25, 2024 13:49
@breautek breautek merged commit 4448030 into apache:master Oct 25, 2024
14 of 15 checks passed
@breautek breautek deleted the isolate-cache-dir branch October 25, 2024 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants