[GH-ISSUE #2163] QUERY_ALL_PACKAGES bypassed #7548

Closed
opened 2026-04-11 00:09:45 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @BHydden on GitHub (Nov 1, 2022).
Original GitHub issue: https://github.com/bitwarden/android/issues/2163

Originally assigned to: @mpbw2 on GitHub.

Steps To Reproduce

  1. Go to adriond app bug: server use ssl by nginx ,when login it show java.security.cert.certpathvalidatorexception (#1384)
  2. See that <action android:name="*" /> was introduced to bypass the official review channels associated with QUERY_ALL_PACKAGES

Expected Result

Formal channels are followed to maintain integrity.

Actual Result

Formal channels are bypassed to take app data without associated review process.

Screenshots or Videos

No response

Additional Context

No response

Operating System

Android

Operating System Version

No response

Device

No response

Build Version

2022.10.0 (5247)

Beta

  • Using a pre-release version of the application.
Originally created by @BHydden on GitHub (Nov 1, 2022). Original GitHub issue: https://github.com/bitwarden/android/issues/2163 Originally assigned to: @mpbw2 on GitHub. ### Steps To Reproduce 1. Go to #1384 2. See that `<action android:name="*" />` was introduced to bypass the official review channels associated with `QUERY_ALL_PACKAGES` ### Expected Result Formal channels are followed to maintain integrity. ### Actual Result Formal channels are bypassed to take app data without associated review process. ### Screenshots or Videos _No response_ ### Additional Context _No response_ ### Operating System Android ### Operating System Version _No response_ ### Device _No response_ ### Build Version 2022.10.0 (5247) ### Beta - [ ] Using a pre-release version of the application.
GiteaMirror added the bug label 2026-04-11 00:09:45 -05:00
Author
Owner

@kspearrin commented on GitHub (Nov 1, 2022):

Hey @BHydden , thanks for the report. As referenced in the original PR, this change was added to support the ability to launch other apps from within the Bitwarden vault, which is a typical path that many people follow when logging into other apps. Do you know of another way to support this use case?

<!-- gh-comment-id:1298704496 --> @kspearrin commented on GitHub (Nov 1, 2022): Hey @BHydden , thanks for the report. As referenced in the original PR, this change was added to support the ability to launch other apps from within the Bitwarden vault, which is a typical path that many people follow when logging into other apps. Do you know of another way to support this use case?
Author
Owner

@BHydden commented on GitHub (Nov 1, 2022):

Do you know of another way to support this use case?

https://developer.android.com/training/package-visibility/declaring#all-apps

In rare cases, your app might need to query or interact with all installed apps on a device, independent of the components they contain. To allow your app to see all other installed apps, the system provides the QUERY_ALL_PACKAGES permission.

<!-- gh-comment-id:1298956009 --> @BHydden commented on GitHub (Nov 1, 2022): > Do you know of another way to support this use case? https://developer.android.com/training/package-visibility/declaring#all-apps > In rare cases, your app might need to query or interact with all installed apps on a device, independent of the components they contain. To allow your app to see all other installed apps, the system provides the `QUERY_ALL_PACKAGES` permission.
Author
Owner

@lberrymage commented on GitHub (Nov 2, 2022):

@kspearrin From the PR description:

In order for PackageManager.GetLaunchIntentForPackage(..) to function in Android 11+, the package has to be visible to us.

This method's documentation notes the solution:

Consider using getLaunchIntentSenderForPackage(java.lang.String) if the caller is not allowed to query for the packageName.

This method would indeed work as a replacement.

Returns an IntentSender that can be used to launch a front-door activity in a package. This is used, for example, to implement an "open" button when browsing through packages. The current implementation is the same with getLaunchIntentForPackage(java.lang.String). Instead of returning the Intent, it returns the IntentSender which is not restricted by the package visibility.

This method is only available as of SDK 33, but it could at least be used on recent versions of Android with fallback to the old way based on SDK_INT.

<!-- gh-comment-id:1301109272 --> @lberrymage commented on GitHub (Nov 2, 2022): @kspearrin From the PR description: > In order for `PackageManager.GetLaunchIntentForPackage(..)` to function in Android 11+, the package has to be visible to us. This [method's documentation](https://developer.android.com/reference/android/content/pm/PackageManager#getLaunchIntentForPackage(java.lang.String)) notes the solution: > Consider using [`getLaunchIntentSenderForPackage(java.lang.String)`](https://developer.android.com/reference/android/content/pm/PackageManager#getLaunchIntentSenderForPackage(java.lang.String)) if the caller is not allowed to query for the packageName. This method would indeed work as a replacement. > Returns an `IntentSender` that can be used to launch a front-door activity in a package. This is used, for example, to implement an "open" button when browsing through packages. The current implementation is the same with `getLaunchIntentForPackage(java.lang.String)`. Instead of returning the `Intent`, it returns the `IntentSender` which is not restricted by the package visibility. This method is only available as of SDK 33, but it could at least be used on recent versions of Android with fallback to the old way based on `SDK_INT`.
Author
Owner

@mpbw2 commented on GitHub (Nov 2, 2022):

@lberrymage Thanks for the info. We'll be testing getLaunchIntentSenderForPackage on API 33 here shortly, and if it works we'll make API 33+ a requirement for this feature going forward.

To be clear, this will mean removing support for launching apps from Bitwarden in older versions of Android because falling back to the old way would require leaving wildcard visibility in the manifest until minSdk can safely be set to 33, which won't be for some time. In addition, adding QUERY_ALL_PACKAGES isn't appropriate for us since we don't want to utilize a high-risk permission for such a small feature. We don't need (or want) that information.

<!-- gh-comment-id:1301377335 --> @mpbw2 commented on GitHub (Nov 2, 2022): @lberrymage Thanks for the info. We'll be testing `getLaunchIntentSenderForPackage` on API 33 here shortly, and if it works we'll make API 33+ a requirement for this feature going forward. To be clear, this will mean removing support for launching apps from Bitwarden in older versions of Android because falling back to the old way would require leaving wildcard visibility in the manifest until minSdk can safely be set to 33, which won't be for some time. In addition, adding `QUERY_ALL_PACKAGES` isn't appropriate for us since we don't want to utilize a high-risk permission for such a small feature. We don't need (or want) that information.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#7548