Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
spd_flasher — CVE-2022-38694 Hardened Exploit - RP2350 USB Host Auto Flasher for Unisoc devices | Kitploit
Tools/GitHubGitHub/leochen-coremind/spd_flasher
Embedded Systems SecurityExploitationReverse EngineeringHardware HackingMobile SecurityLearning & Education
GitHubleochen-coremind/spd_flasher

spd_flasher

CVE-2022-38694 Hardened Exploit - RP2350 USB Host Auto Flasher for Unisoc devices

View Repository
3114 days agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2022-38694 Hardened Exploit — RP2350 USB Host Auto Flasher

中文版 README

Tutorial

  • UDX710 Boot Chain Reverse Engineering and RP2350 Hardened Boot Tutorial

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.

How It Works

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.

Hardening Process (Two Stages)

Stage 1: Initial Unlock (PC + spd_dump)

First-time setup requires a PC with spd_dump:

root@kitploit:~
┌──────────────────────────────────────────────────────────────────────────┐
│                    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:

  1. Use CVE-2022-38694 to send spl-unlock.bin and boot the device
  2. Send patched fdl2-dl.bin (FDL2 with secure boot verification removed)
  3. Use FDL2 to write u-boot with secure boot removed to the uboot partition
  4. Erase splloader partition → device loses normal boot, enters BootROM DL mode on every power-on

Stage 2: Hardened Operation (RP2350 Auto Flash)

With splloader erased, the device enters BootROM download mode on every power-on. The RP2350 USB Host automatically handles the exploit chain:

root@kitploit:~
┌──────────────────────────────────────────────────────────────────────────┐
│                   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?

  • Normal boot chain: BootROM → SPL Loader → u-boot → System
  • SPL Loader verifies u-boot signature — it will reject modified u-boot
  • With splloader erased, BootROM can't find SPL → falls into download mode
  • CVE-2022-38694 sends spl-unlock (skips signature check) → successfully boots u-boot without secure boot

Exploit Chain (RP2350 Execution)

root@kitploit:~
┌─────────────┐     ┌──────────────────┐     ┌───────────────────┐     ┌──────────────┐
│  BootROM    │     │  Exec Stub       │     │  SPL Loader       │     │  U-Boot      │
│  Handshake  │ ──► │  @0x3F28 (136B)  │ ──► │  @0x28007000      │ ──► │  Boot OK     │
│  CHECK_BAUD │     │  Bypass sig chk  │     │  Replaces FDL1    │     │              │
└─────────────┘     └──────────────────┘     └───────────────────┘     └──────────────┘
  1. BootROM Handshake — CHECK_BAUD + CONNECT, establish BSL communication
  2. Send Exec Stub — Load 136 bytes to 0x3F28, exploit CVE-2022-38694 to overwrite return address, bypass signature verification
  3. Send SPL Loader — FDL1 and SPL Loader share load address 0x28007000, signature already bypassed
  4. Boot U-Boot — spl-unlock skips signature checks, boots u-boot with secure boot removed

Prerequisites: Patch Firmware

This project does not include universal patched firmware. You must patch your device's firmware yourself.

Patch Tutorial

Refer to TomKing062's Wiki:

  • 🇬🇧 patch_do_cboot — SPL (English)
  • 🇨🇳 patch_do_cboot — SPL (中文)

Firmware to Patch

Convert spl-unlock.bin to Header

root@kitploit:~
xxd -i spl-unlock.bin > fdl1_data.h

Update array name and macros in fdl1_data.h to match code references.

Supported Platforms

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:

Full support list: SupportList

Hardware Requirements

ComponentDescription
RP2350 Boarde.g. Raspberry Pi Pico 2
USB Host CableOTG or hardware mod for RP2350 USB Host
Target SPD Devicesplloader erased, auto-enters BootROM DL mode on power-on

Pin Configuration

PinFunction
USB D+/D-Connect to target SPD device
GP4 (TX)UART debug output
GP5 (RX)UART debug input

USB port is used for Host communication. Debug logs via UART1 (GP4/GP5, 115200bps).

Building

Prerequisites

  • Pico SDK v2.2.0+
  • CMake 3.13+
  • ARM GCC toolchain

Build

root@kitploit:~
cd spd_flasher
mkdir build && cd build
cmake .. -DTARGET_CHIP=rp2350
make -j$(nproc)

Output: spd_flasher.uf2 (drag-and-drop via BOOTSEL) / spd_flasher.bin (programmer)

Usage

  1. Complete Stage 1 (initial unlock + erase splloader) on PC
  2. Flash spd_flasher.uf2 to RP2350
  3. Connect RP2350 to target device via USB Host cable
  4. Power on device → auto BootROM DL mode → RP2350 runs exploit chain
  5. Auto-reset on completion, plug in next device immediately

Why RP2350?

Project Structure

root@kitploit:~
spd_flasher/
├── main.c               # Main program, USB Host init & device management
├── spd_protocol.c        # SPD BSL protocol (HDLC framing, state machine)
├── spd_protocol.h        # Protocol definitions
├── tusb_config.h         # TinyUSB Host configuration
├── custom_exec_data.h    # Exec Stub data (136B @0x3F28)
├── fdl1_data.h           # SPL Loader data (spl-unlock.bin @0x28007000)
├── spl-unlock.bin        # SPL Loader raw binary
├── CMakeLists.txt        # CMake build configuration
└── signing_key.pem / aes_key.bin / iv_salt.bin  # RP2350 secure boot keys

Acknowledgments

  • CVE-2022-38694 Unlock Bootloader — TomKing062
  • NCC Group Research — Vulnerability discovery
  • Raspberry Pi Pico SDK
  • TinyUSB

Disclaimer

This project is for security research and educational purposes only. Users must comply with all applicable laws and regulations. The author assumes no responsibility for any direct or indirect damages resulting from the use of this tool.

License

This project is licensed under the GNU General Public License v3.0.

Download Tool
FirmwarePatchOutputPurpose
FDL2 (u-boot/lk)NOP secure partition write checksfdl2-dl.binStage 1: sent via spd_dump for partition writes
U-BootPatch do_cboot() to remove secure bootModified ubootStage 1: written to device, replaces stock uboot
SPL LoaderNOP signcheck() and result checksspl-unlock.binStage 1 & 2: sent via CVE-2022-38694
PlatformExec AddressReference
UDX7100x3F28This project (default)
UMS312 / UMS5120x3EE8exec_addr_v2
UMS92300x65017F08exec_addr_v2
SC9820E / SC9832E0x4F18 / 0x4EE8CVE-2022-38694
PC + spd_dumpRP2350 Hardened
SizeRequires PCSingle MCU
OperationManual commandsPower on = running
ContinuousManual per deviceAuto-reset
DeploymentInconvenientProduction-ready
Cost—~$3