deniz.in

Markets

Weather

Loading weather

· via Hacker News – Front Page (native)

Font exploit and firmware-status bypass bring untethered Rockbox to the iPod nano 5G

Viktor Krapivin adapted the ipod_sun font exploit to the iPod nano 5G and paired it with a bypass of the private-partition FirmwareStatus check, producing a boot chain that starts Rockbox with no computer involved.

Font exploit and firmware-status bypass bring untethered Rockbox to the iPod nano 5G

Viktor Krapivin has achieved unsigned code execution on the iPod nano 5G by adapting a font-based exploit first demonstrated on later nano models and combining it with a newly found bypass in the device's boot flow. In a blog post that reached the front page of Hacker News, he describes a fully untethered boot chain: once installed, a modified nano 5G starts the open-source Rockbox firmware directly from its own NAND flash, with no computer and no button sequence needed at power-on.

An old exploit meets an older iPod

A few years ago, a researcher known as CUB3D demonstrated unsigned code execution on the nano 6G and 7G with ipod_sun, a font-based exploit, and whether the approach could reach the 5G remained an open question. Krapivin's stated motivation was getting Rockbox running — in his words, a current music player that never touches the internet. A DFU exploit, q3k's wInd3x, already provides code execution on the 5G, but booting custom code that way requires a host computer every time, so he used it only as a development aid while building something self-sufficient. His analysis targets the latest 5G firmware, version 1.0.2 (34A20020).

How the original chain works

The nano 5G exposes its NAND through a flash translation layer as a logical disk of 4 KiB sectors, divided into a private area for persistent device state, a firmware partition holding boot programs and resources, and a data volume for user files. The firmware partition contains a directory of named images: osos for the normal operating system, disk for disk mode, and rsrc, a FAT16 resource volume that contains the fonts.

ipod_sun chains two weaknesses together. First, the disk-mode boot path never requests the resource signature check that normal OS boot performs, so swapping the disk and osos directory entries causes disk mode to launch Apple's regular OS under the laxer policy. The OS then reads its fonts from a modified rsrc image that nobody validated. Second, the malformed font triggers CVE-2010-1797, the FreeType CFF stack overflow also known through the star exploit, corrupting the parser's stack and redirecting execution.

That works but stays tethered by buttons: the swapped images remain on disk, and every restart requires choosing disk mode manually, because a normal boot selects the other directory entry.

A second bypass in the normal boot path

The bootloader is organized into EFI-style modules stored as Portable Executable images. The module that hands control to the next boot stage asks the PrivateData module for a FirmwareStatus value kept in an authenticated record in the private NAND partition. Krapivin's reverse engineering shows bit 0 is checked first: if set, the boot attempt is rejected, which he reads as a guard against booting a half-finished update, since the restore OS sets the status to 1 during firmware transfer and clears it at the end. Bit 1 is the interesting one: with it set (a value of 2), the routine returns success before ever querying the rsrc signature.

Apple itself, he notes, writes status 2 only after the first successful boot with a verified rsrc, plausibly to skip repeated signature checks and save boot time or energy. His bypass therefore leaves the firmware directory alone and instead writes a valid private record with FirmwareStatus set to 2. Normal boot then accepts the modified resource image, and the font payload fires automatically.

The record is a 512-byte header beginning with the little-endian magic PRVD, in a partition of MBR type 0x3e that starts at logical block 1. FirmwareStatus lives at offset 0x40, and a 16-byte integrity tag at 0x80 consists of the first 16 bytes of a SHA-1 digest over the first 0x80 bytes, encrypted with the device's hardware AES UID key through key slot 2. Because the tag is device-bound, forging it requires code execution on that particular iPod — exactly what the DFU exploit supplies.

Tooling and result

To inspect and update the private partition, Krapivin adapted emCORE, the USB-controlled environment from freemyipod's earlier iPod work, and contributed a NAND driver for the 5G along with flash translation layer and AES integration; the flash memory sequencer subsystem that enables NAND writes is slated for a follow-up post. A private-status tool verifies the existing header and tag, constructs the updated record, asks the device to compute its new tag, rechecks the partition table and header, then writes, flushes and reads back. The on-device bootloader described in the post occupies less than 28 KB, and the finished chain loads Rockbox from NAND. Krapivin also reports a way to make ipod_sun fully untethered on the nano 7G, and likely the 6G as well.

Why it matters

The work turns a piece of aging Apple hardware into an offline media player running maintained open firmware, extending the freemyipod and Rockbox lineage to one more device. The security lesson is broader than the fifteen-year-old font bug at its core: the real leverage comes from inconsistent policy between boot paths and from a cached trust decision, where one verified boot permanently waives signature checks for everything after it. Even device-bound cryptography, in the form of the UID-keyed integrity tag, only holds until an attacker obtains any code execution on the device itself. For owners of 6G and 7G nanos, the untethering technique may soon make the same trick practical there too.

  • #rockbox
  • #ipod-nano
  • #exploit
  • #reverse-engineering
  • #security

Related posts