--- name: android-intent-injection-redirection description: Exploit Android intent injection and redirection — intent:// parsing in WebViews, nested/forwarded intents reaching non-exported components, and FileProvider grantUriPermission chains for cross-app file theft. Tier 1. Use when components forward or parse untrusted intents. Aligns to OWASP MASTG MASVS-PLATFORM. --- # Android Intent Injection & Redirection Trick the app into forwarding an attacker-crafted intent so it reaches private components or leaks private files with the victim app's permissions. ## Trigger phrases `intent redirection, intent injection, intent.parseuri, nested intent, getparcelableextra, fileprovider abuse, grant_read_uri_permission, cross-app file theft` ## Method 1. **Find redirection sinks** in decompiled code: - `grep -rniE "parseUri|getParcelableExtra|startActivity|startActivityForResult|setData|FLAG_GRANT" app_java/` - Look for a component that takes an intent/URI from an extra and `startActivity()`s it, or `Intent.parseUri()` on attacker data. 2. **Intent redirection to non-exported components:** craft an outer intent whose extra carries a nested `Intent` (`getParcelableExtra("forward")`) targeting a private activity/provider; send via an exported entry point: - `adb shell am start -n /.RedirectActivity --es target ""` (or via a PoC app building the nested Intent object). 3. **intent:// in WebView:** if a WebView calls `Intent.parseUri()` on a URL, load `intent://...#Intent;component=/.PrivateActivity;end` to reach non-exported activities (chain `android-webview-attacks`). 4. **FileProvider / grantUri file theft:** forward a `content:///...` URI with `FLAG_GRANT_READ_URI_PERMISSION` to an attacker component to read the victim's private files; test traversal in the FileProvider `` (`root-path`/`external-path` too broad). ## Modern / rare techniques - **[NEW/RARE] Nested-Intent redirection** carrying `FLAG_GRANT_READ_URI_PERMISSION` to reach private content providers → private file exfil (Oversecured pattern). - **[NEW/RARE] FileProvider `` over-exposure** (`root-path`/broad `external-path`) → combine with redirection for arbitrary app-private file read. - **Implicit→explicit coercion:** an app that re-sends an implicit intent you control lets you pin the component to a private one. ## Bypass / evasion When a target activity is non-exported, redirection *through* the victim is the only reach — the victim's own UID/permissions satisfy the access check that would block you directly. ## Escalation / chaining Reaches non-exported components (extends `android-exported-components`), reads private files (feeds `android-insecure-storage`/`android-backend-api-testing`); WebView-driven variant chains with `android-webview-attacks` and `android-deeplink-applink-abuse`. ## Backend & tooling Preferred Kali path (native Kali / WSL+Kali / Kali-SSH / Kali-MCP / HexStrike). Needs the user's device/emulator (adb; a PoC app for nested-intent/grantUri cases) + Kali tooling (apktool/jadx/drozer). Windows-local last resort. See `zazy-orchestrator`. ## Verification (background, before reporting) Reproduce from an unprivileged PoC app / plain adb and confirm the private component actually launched or the private file contents were read before marking CONFIRMED. Re-run to rule out a one-off. ## Evidence The crafted intent/URI, the non-exported component reached or private file read (redacted), and the forwarding code path. Remediation: never forward untrusted intents/URIs; validate granted URIs; narrow FileProvider paths; avoid `FLAG_GRANT_*` on exported entry points; reject nested/implicit intents.