Rooting the Amazon Fire HD 8 (Onyx) 2020 device
  • C 96.3%
  • Python 2%
  • Makefile 0.8%
  • Shell 0.5%
  • Java 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Moritz Stückler 3363e61941 device 2: complete session log (arrival -> root x2 -> full dump -> unlock brick -> recovery in progress)
Chronological record with all hashes, versions, loop-bug post-mortems,
the SBC revelation, and current bench state. Race scripts + UART capture
rescued from tmpfs. README status updated.
2026-11-14 10:15:50 +01:00
amonet-koboreru onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
analysis-lk onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
analysis-preloader onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
apkbuild device 2 OTA'd to 7.3.2.9 (PS7329/3836N): rebuild exploit for fos-124 kernel 2026-11-14 06:56:23 +01:00
dump device 2 OTA'd to 7.3.2.9 (PS7329/3836N): rebuild exploit for fos-124 kernel 2026-11-14 06:56:23 +01:00
dump-emmc-dev2 device 2: complete session log (arrival -> root x2 -> full dump -> unlock brick -> recovery in progress) 2026-11-14 10:15:50 +01:00
early-research onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
eng onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
mali22706 onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
onyxroot-app onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
publish onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
session-recovery onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
unlock7329 unlock attempt post-mortem: flashed patched preloader never reaches USB — BROM enforces preloader signature (SBC). Hardware recovery path next. 2026-11-14 08:51:33 +01:00
.gitignore device 2 OTA'd to 7.3.2.9 (PS7329/3836N): rebuild exploit for fos-124 kernel 2026-11-14 06:56:23 +01:00
craft-onyx-tee.py onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
fire-hd8-onyx-6241-root-writeup.md onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
fire-hd8-onyx-security-audit.md onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
koboreru-onyx-port.md onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
preloader-2021.bin onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
preloader.bin onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
README.md onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00
tee1-onyx-exploit.img onyx-root: Fire HD 8 2020 (KFONWI/MT8168) research archive 2026-10-27 08:39:01 +01:00

fire-hd8-onyx — Amazon Fire HD 8 2020 (onyx / KFONWI, MT8168) security research

Everything in this tree belongs to the onyx project: the CVE-2023-6241 kernel root (published as OnyxRoot), the boot-chain reversal, and the LineageOS unlock attempt (koboreru port). Read this index top to bottom before touching anything.

Status summary (2026-10-27)

  1. Kernel root: SOLVED. Mali buddy-spill exploit → EL1 root daemon (mp, port 4323, AUTH per build). Reliability fixed 2026-10-26 (health gate: only chain on nents==4096 states; WLO 1024: ident writes in mid-range L2 tables). Winning build: apkbuild/OnyxRoot-v3-sanitized.apk.
  2. Boot chain: FULLY REVERSED. BROM (USBDL fused) → preloader (amzn_pl_verify_image_maybe: unconditional prod-RSA on lk, every boot, fail = no jump) → lk (unlock_code/t_unlock_code RSA-verified every boot; images always verified when locked). See the two writeup documents.
  3. Unlock attempt (koboreru port): EXECUTED, DEVICE CURRENTLY SOFT-BRICKED. All four partitions flashed byte-verified (2021 preloader + lk + crafted tee1 + donor tee2). The payload fires every boot but freezes the CPU before completing (suspect: un-timeouted pwrap PMIC key read, MT6357 register table unverified). WDT does NOT cycle — each wake = one frozen boot (~2.5 s USB beacon). No listener on USB. Stock USBDL keys ruled out (power/vol-/vol+ all held during real boots — no stable loop). Recovery paths: R0rt1z2 contact (top), UART diagnosis + eMMC CLK short (XDA thread 4536179 has pad photos), see session-recovery/. All stock partition images are backed up in dump-emmc/ (SHA256SUMS).

Directory index

Root exploit (published)

  • mali22706/ — exploit sources (root.c = root5 with the 2026-10-26 reliability fixes, pte_child.c, mp.c) + session logs (reroot*.log, app_selfroot_success.log = the verified win)
  • onyxroot-app/ — private app project (Main.java, manifest, build-apk.sh)
  • apkbuild/ — app build chain (aapt2, android.jar, r8.jar, keystore, sanitized binaries). OnyxRoot-v3-sanitized.apk = the build to distribute (reliability fixes, zero identifying strings, token af8ef35ba62664d0, sha256 a252ba5a…). OnyxRoot.apk in the same dir is the LEAKING build (contains /home/... paths) — reference only, never share.
  • publish/ — anonymous XDA publication kit (sanitized writeup, draft post, README-PUBLISH checklist, sanitized APK token 13e2c7dbe1ceaacf)
  • pubbuild/ — workspace of the publish (sanitized) build

eMMC backup (the lifeline)

  • dump-emmc/ — FULL eMMC dump incl. mmcblk0boot0/boot1/rpmb + all partitions + SHA256SUMS. Stock boot0/lk/tee1/tee2 restoration images live here. Never delete.

LineageOS unlock attempt (koboreru port)

  • koboreru-onyx-port.md — THE port sheet: every address, the verified boot order, exploit geometry, flash plan, failure analysis. Start here.
  • amonet-koboreru/ — exploit source incl. our devices/onyx.{h,c} port and include/devices/onyx.h
  • fw-ps7318/ — authentic 2021-07 firmware images (preloader/lk/tee/boot, MD5-verified against FTVDB records)
  • craft-onyx-tee.py — builds tee1-onyx-exploit.img (the flashed exploit image; maddr=0, payload@0x100, forged bdev 0x22D8)
  • preloader.bin / preloader-2021.bin — extracted preloader payloads (current 2023 build / flashed 2021 build)

Analysis (how the chain was reversed)

  • analysis-lk/ — lk reversal: python scanners, Ghidra scripts, corpora, logs. The key insight chain is recorded in the scripts' final versions (lkdelta.py = the working ldr+add-pc scanner).
  • analysis-preloader/ — preloader reversal: corpora (pl-corpus*.c = decompiled functions), targeted decompiles, address solvers
  • gproj/, pyproj/ — Ghidra projects (LK2/LKC2/PL1/PL21/PLFULL programs, analysis included)
  • ghidra-scripts/ — R0rt1z2's MediaTek loader scripts for Ghidra

Recovery session (2026-10-26/27, post-brick)

  • session-recovery/ — mpserv.c (replacement mp daemon), probe2/3/4.py (raw USB handshake attempts vs the preloader beacon), race*.sh (root race loops with wedge handling), UART pad photos (uart-*.jpg), session logs, mtkclient logs, keys-eng.img
  • mtkclient/ — R0rt1z2's mtkclient fork (pyusb deps installed user-side)

Reference / research

  • eng/ — eng-unit dumps (lk-eng.img full-fastboot reference, boot0, tee, fastboot unlock transcript, ProjectConfig.mk)
  • firmware-otas/ — full OTA bins (ps7318/ps7322, ~2 GB), kernel_7327 tree, kindle/tahoe update APKs, ota7331
  • early-research/ — pre-exploit recon scripts, initial notes
  • app-teardown/ — Fire OS app/framework smali+dex teardowns, jars, policy.32, seapp contexts, kconfig
  • gpl-onyx/, aosp_ref/, lk-src/, panfrost/, kindle_x/ — source references (Amazon GPL kernel, AOSP, generic MTK LK, panfrost driver)
  • dump/ — early on-device dump helper scripts (fserve, dodump)
  • liblk/, lkpatcher/, dump_pllk_log/, Firmware_extractor/ — R0rt1z2 tooling (cloned)
  • platform-tools/ — Google platform-tools (fastboot with oem support)

Documents

  • fire-hd8-onyx-security-audit.md — master audit document
  • fire-hd8-onyx-6241-root-writeup.md — root exploit writeup (private full version)

Tools (big, re-downloadable — keep or delete freely)

  • ghidra_12.2_PUBLIC/ (879 M) — Ghidra install (scripts reference GHIDRA_INSTALL_DIR=/tmp/opencode/onyx/ghidra_12.2_PUBLIC)
  • jdk-21.0.13+9/ (347 M) — JDK for Ghidra
  • archives/ — ghidra.zip, jdk21.tar.gz, pt.zip (source archives of the above; safe to delete)

Notes

  • /tmp/opencode/onyx is a symlink to this directory — session scripts that reference it keep working until reboot.
  • The sanitized-build recipe: copy sources to a scratch dir (e.g. /tmp/b), zig cc -target arm-linux-musleabihf -static -O2 -DNDEBUG -s with ZIG_LOCAL_CACHE_DIR redirected; -DNDEBUG+-s removes all host paths. Verify with: strings <binary> | grep -iE 'moritz|/home/|fedora'.
  • USB ritual for the tablet: node churns on sleep — lsusb → setfacl the node → adb kill-server if needed. Root daemon (when a win happens): (printf 'AUTH af8ef35ba62664d0\n<cmds>\n'; sleep 3) | toybox nc 127.0.0.1 4323 (token differs per build — check build-apk.sh TOKEN=).