
CVE-2022-38694 Hardened Exploit - RP2350 USB Host Auto Flasher for Unisoc devices
Exploiting CVE-2022-38694 Unisoc BootROM vulnerability via Raspberry Pi RP2350 USB Host to automatically send SPL Loader on boot and start arbitrary u-boot.
Moves the exploit chain — originally requiring a PC + spd_dump — onto an RP2350 microcontroller. Plug in device, flash automatically, supports continuous flashing.
CVE-2022-38694 is a one-time signature verification bypass in Unisoc BootROM. By sending an exec stub to a specific memory address, the return address is overwritten, bypassing signature checks and allowing BootROM to accept and execute arbitrary FDL1.
Key insight: FDL1 and SPL Loader share the same load address (0x28007000), so a patched SPL Loader can be sent in place of FDL1, booting arbitrary u-boot.
First-time setup requires a PC with spd_dump:
┌──────────────────────────────────────────────────────────────────────────┐
│ Stage 1: PC-side Initial Unlock │
├──────────────────────────────────────────────────────────────────────────┤
│ │
│ Step 1: Exploit CVE-2022-38694 to boot patched SPL │
│ ┌────────────┐ ┌────────────┐ ┌─────────────────┐ │
│ │ Exec Stub │───►│ spl-unlock │───►│ Device boots │ │
│ │ @0x3F28 │ │ @0x28007000│ │ into DL mode │ │
│ └────────────┘ └────────────┘ └────────┬────────┘ │
│ │ │
│ Step 2: Send patched FDL2 via spd_dump, flash u-boot without │
│ secure boot, erase splloader │
│ │ │
│ ┌─────────────────┐ ┌──────────────────────▼───────────┐ │
│ │ Send fdl2-dl │───►│ Write u-boot (secure boot removed│ │
│ │ (patched FDL2) │ │ + Erase splloader partition) │ │
│ └─────────────────┘ └──────────────────────────────────┘ │
│ │
│ ★ After erasing splloader, device enters BootROM DL mode on every boot │
└──────────────────────────────────────────────────────────────────────────┘
Steps:
spl-unlock.bin and boot the devicefdl2-dl.bin (FDL2 with secure boot verification removed)With splloader erased, the device enters BootROM download mode on every power-on. The RP2350 USB Host automatically handles the exploit chain:
┌──────────────────────────────────────────────────────────────────────────┐
│ Stage 2: RP2350 Automated Boot │
├──────────────────────────────────────────────────────────────────────────┤
│ │
│ Power on → no splloader → BootROM download mode │
│ │
│ ┌─────────┐ ┌────────────┐ ┌─────────────┐ ┌──────────────┐ │
│ │ BootROM │───►│ Exec Stub │───►│ spl-unlock │───►│ U-Boot │ │
│ │ Handshk │ │ Bypass sig │ │ as FDL1 │ │ (no secboot) │ │
│ └─────────┘ └────────────┘ └─────────────┘ │ Boot OK ✓ │ │
│ └──────────────┘ │
│ │
│ ★ Fully automatic. Unplug → auto-reset → ready for next device. │
└──────────────────────────────────────────────────────────────────────────┘
Why erase splloader?
┌─────────────┐ ┌──────────────────┐ ┌───────────────────┐ ┌──────────────┐
│ BootROM │ │ Exec Stub │ │ SPL Loader │ │ U-Boot │
│ Handshake │ ──► │ @0x3F28 (136B) │ ──► │ @0x28007000 │ ──► │ Boot OK │
│ CHECK_BAUD │ │ Bypass sig chk │ │ Replaces FDL1 │ │ │
└─────────────┘ └──────────────────┘ └───────────────────┘ └──────────────┘
CHECK_BAUD + CONNECT, establish BSL communication0x3F28, exploit CVE-2022-38694 to overwrite return address, bypass signature verification0x28007000, signature already bypassedThis project does not include universal patched firmware. You must patch your device's firmware yourself.
Refer to TomKing062's Wiki:
| Firmware | Patch | Output | Purpose |
|---|---|---|---|
| FDL2 (u-boot/lk) | NOP secure partition write checks | fdl2-dl.bin | Stage 1: sent via spd_dump for partition writes |
| U-Boot | Patch do_cboot() to remove secure boot | Modified uboot | Stage 1: written to device, replaces stock uboot |
| SPL Loader | NOP signcheck() and result checks | spl-unlock.bin | Stage 1 & 2: sent via CVE-2022-38694 |
xxd -i spl-unlock.bin > fdl1_data.h
Update array name and macros in fdl1_data.h to match code references.
This project currently uses the UDX710 exec stub (custom_exec_3f28.bin).
To adapt for other chips, replace the exec stub and load address in custom_exec_data.h:
| Platform | Exec Address | Reference |
|---|---|---|
| UDX710 | 0x3F28 | This project (default) |
| UMS312 / UMS512 | 0x3EE8 | exec_addr_v2 |
| UMS9230 | 0x65017F08 | exec_addr_v2 |
| SC9820E / SC9832E | 0x4F18 / 0x4EE8 | CVE-2022-38694 |
Full support list: SupportList
| Component | Description |
|---|---|
| RP2350 Board | e.g. Raspberry Pi Pico 2 |
| USB Host Cable | OTG or hardware mod for RP2350 USB Host |
| Target SPD Device | splloader erased, auto-enters BootROM DL mode on power-on |