Bypassing CVE-2023-21257 Replacing Intune-Managed Android Wo... #1608
+87
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
Overview
This blog post shows how to install an arbitrary Android app into an Android Enterprise Work Profile on a BYOD device after Google’s patch for CVE-2023-21257, by abusing Android Studio’s multi-user install behavior, Microsoft Intune’s required/auto-install apps, and the Google Play Store service (Finsky) version resolution logic. The attacker replaces a managed Work Profile app (e.g. Workday) with a malicious app having the same package name and...
🔧 Technical Details
Trick 1 – Leveraging Android multi-user architecture and “install for all users”
Android Enterprise Work Profiles are separate Android users (e.g. user 0 = owner, user 1 = Work Profile). Directly installing into a Work Profile user with commands like
adb install --user 1 <apk>fails under typical enterprise restrictions, producing errors such asjava.lang.SecurityException: Shell does not have permission to access user 1. However, deploying via Android Studio with the run configuration set to “install for all users” uses theINSTALL_ALL_USERSpath inPackageManagerService. Pre-patch, this allowed APKs to be installed for both personal and Work Profile users, effectively sidestepping per-user ADB permission checks. Post-patch, this path is policy-gated but still drives the rest of the exploit chain because it pushes the malicious APK into the system’s install flow (including temp directories) for the Work Pro...🤖 Agent Actions
Summary:
Tests: Not run (documentation-only changes).
This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.