Smart Speaker Shenanigans: Making The SONOS One Sing
Peter Geissler (Independent security researcher · Haxxin BV)
HITBSecConf2023 - Amsterdam · Day 2 · Track 1
Overview
This article delves into an extensive security research journey presented by Peter Geissler at HITB Amsterdam, detailing his efforts to compromise the Sonos One smart speaker. Initially motivated by the Pwn2Own contest, Geissler embarked on a deep exploration of the device's hardware and firmware, uncovering a complex web of secure boot mechanisms, proprietary encryption schemes, and underlying vulnerabilities. The talk, "Smart Speaker Shenanigans: Making The SONOS One Sing," meticulously details how a heap overflow within the device's secure monitor led to arbitrary code execution in the highly privileged EL3 environment, ultimately enabling the extraction of critical cryptographic keys, the decryption of the root filesystem, and the full analysis of over-the-air (OTA) firmware updates.

Key moments
- 4:00 Sonos flash is LUKS encrypted
- 5:45 Using Lenovo alarm clock with similar SOC
- 10:50 Decrypting BL2 blobs using USB recovery mode
- 18:40 Secure storage heap overflow vulnerability found
- 23:45 Arbitrary read/write leads to Boot ROM dump
- 30:00 Live demo: Dumping Sonos OTP and Boot ROM
- 39:45 Successfully decrypting the Sonos root filesystem
- 49:45 Zero-day vulnerability and wider impact discussed
Smart Speaker Shenanigans: Making The SONOS One Sing
Speakers: Peter Geissler, Independent security researcher, Haxxin BV
Conference: HITB Amsterdam
YouTube: https://www.youtube.com/watch?v=Wqcbp9wFO7o
Overview
This article delves into an extensive security research journey presented by Peter Geissler at HITB Amsterdam, detailing his efforts to compromise the Sonos One smart speaker. Initially motivated by the Pwn2Own contest, Geissler embarked on a deep exploration of the device's hardware and firmware, uncovering a complex web of secure boot mechanisms, proprietary encryption schemes, and underlying vulnerabilities. The talk, "Smart Speaker Shenanigans: Making The SONOS One Sing," meticulously details how a heap overflow within the device's secure monitor led to arbitrary code execution in the highly privileged EL3 environment, ultimately enabling the extraction of critical cryptographic keys, the decryption of the root filesystem, and the full analysis of over-the-air (OTA) firmware updates.
Geissler's research stands as a testament to the rigor required to uncover deep-seated security flaws in modern embedded systems. It highlights the significant challenges faced by researchers when confronted with layered security measures, including secure boot, encrypted storage, and vendor-specific trusted execution environments. By methodically dissecting the Amlogic SoC's boot process and exploiting a subtle flaw in the secure monitor's handling of secure storage, Geissler not only demonstrated a complete compromise of the Sonos One but also provided a blueprint for analyzing similar devices built on the same hardware platform.
The implications of this research are far-reaching. It exposes fundamental weaknesses that could affect a wide range of consumer electronics utilizing similar Amlogic SoCs and ARM Trusted Firmware (ATF) implementations. For defenders, it provides invaluable insights into the types of vulnerabilities that can exist within the trusted computing base and emphasizes the critical importance of secure design, robust memory safety, and meticulous key management from manufacturing through device lifecycle. This talk serves as a cautionary tale for device manufacturers and a guide for security professionals seeking to understand and mitigate advanced threats against embedded systems.
Background
▶ Watch: Sonos flash is LUKS encrypted (4:00)
The journey into the Sonos One's security began with Peter Geissler's participation in the Pwn2Own contest, where the smart speaker proved to be a significantly more challenging target than anticipated. Initial efforts to gain a foothold were met with a locked-down device. Physical inspection of the Sonos One's PCB revealed several key components: a UART port for serial communication, a mini PCI Express connector (typically for the Wi-Fi card), an eMMC flash chip containing the main firmware and operating system, an Amlogic A113D System-on-a-Chip (SoC), and DDR4 DRAM.
Early attempts to leverage the UART port for a U-Boot prompt were thwarted, as Sonos had patched previous vulnerabilities that allowed code execution in this environment. Furthermore, the serial output indicated the presence of AXG secure boot, signifying a robust protection mechanism. The primary hurdle was the eMMC flash chip, which, upon physical removal and dumping, revealed a highly encrypted structure. The root filesystem was found to be mounted using cryptsetup LUKS, an encrypted volume, with the key derivation process being particularly intricate. Geissler discovered a custom method called "Sonos blob encrypt decrypt," which issued a vendor-specific Secure Monitor Call (SMC) to EL3 (the highest privilege level in the ARM TrustZone secure world) to retrieve the actual decryption key. Without code execution in EL3, this presented a significant roadblock.
To overcome this, Geissler strategically pivoted to a more accessible target: a Lenovo alarm clock, which utilized a similar Amlogic A113X SoC. This device, while also employing secure boot, was "slightly less locked down" and offered a crucial entry point: a USB recovery mode. This mode was disabled on the Sonos but functional on the Lenovo, providing a pathway to interact with the device's low-level boot process. Both SoCs are quad-core ARM64 CPUs with TrustZone support, commonly used in audio processing applications.
Understanding the underlying architecture, Geissler delved into the ARM Trusted Firmware (ATF), a reference implementation used by vendors for secure boot chains. The ATF defines distinct execution stages: BL1 (Boot ROM), BL2 (next stage bootloader), BL31 (Secure Monitor, running in EL3), and BL33 (normal world bootloader like U-Boot). The boot flow typically involves BL1 loading BL2, which then initiates BL31 in the secure world and BL33 in the normal world. A critical piece of information came from a hard-to-obtain Amlogic datasheet, revealing that the SoC's boot process checks GPIO straps to determine the boot source, prioritizing USB, SPI, eMMC, NAND, or SD in a fallback sequence. The presence of the USB boot option on the Lenovo clock was the key to unlocking the initial stages of research.
Key Findings
▶ Watch: Decrypting BL2 blobs using USB recovery mode (10:50)
Peter Geissler's research yielded a series of interconnected and increasingly powerful findings, starting with an ingenious method to bypass initial encryption and culminating in full control over the Sonos One's trusted execution environment.
- BL2 Decryption Oracle: By intentionally corrupting a valid BL2 bootloader image and uploading it via the Lenovo clock's USB recovery mode, Geissler discovered that the device would attempt decryption and verification in SRAM before failing. Crucially, the USB bootloader loop remained active, allowing him to issue a read command and retrieve the decrypted contents of the BL2 blob. This "decryption oracle" was a foundational breakthrough, revealing that the cipher was likely AES in CBC mode with a 16-byte block size.
- FIP Table and BL3X Decryption: With the BL2 decryption oracle, Geissler was able to decrypt the Firmware Image Package (FIP) table and all subsequent BL3X blobs (BL31, BL32) from a NAND dump. The FIP table, which outlines offsets and sizes for the next-stage bootloader components, became fully parsable, enabling offline analysis in tools like IDA Pro and Ghidra.
- Secure Monitor (BL31) Vulnerability: Deep analysis of the BL31 Secure Monitor (responsible for handling SMCs) revealed numerous vendor-specific "SIP services." Among these, the Secure Storage service, designed for storing encrypted key-value pairs, contained a critical heap overflow. The internal
keysarray, fixed at 64 entries, lacked bounds checking for thekey countvariable. This allowed an attacker to write beyond the array's allocated memory.
- Arbitrary Read/Write Primitive: Exploiting the heap overflow, Geissler could craft malicious key entries in an adjacent scratch buffer. By introducing an error in the parameter block during a subsequent
parseoperation, he could clear the initial 64 valid keys while preserving his forged entries. These forged entries, with controlled "value pointers" and "value sizes," transformed thestorage readandstorage writeSMCs into powerful arbitrary 64-bit read and write primitives within the EL3 secure world.
- Arbitrary Call Primitive: Leveraging the arbitrary write primitive, Geissler identified and hijacked entries in the SMC dispatcher's function pointer table. This allowed him to redirect the control flow of a specific custom SMC, effectively creating an arbitrary call primitive capable of invoking any function in BL31 with up to three arguments.
- OTP and e-fuse Data Extraction: The arbitrary call primitive was then used to invoke internal functions within BL31 that were designed to read OTP (One-Time Programmable) and e-fuse data. This allowed the complete dumping of these highly sensitive hardware regions, which contained critical cryptographic material, including the AES-256 key for secure boot stages and the AESGCMHW key vital for LUKS volume decryption.
- Boot ROM Dumping: With arbitrary read/write capabilities in EL3, Geissler patched the EL3 page tables (specifically
TTBR0_EL3andTCR_EL3) to reintroduce mappings for the Boot ROM's physical address (FFFF0000). This enabled a full dump of the device's immutable Boot ROM, opening doors for further analysis of the earliest boot stages.
- Sonos Root Filesystem Decryption: Using the extracted OTP keys and a detailed understanding of Sonos's multi-stage key derivation process (involving Manufacturing Data Pages (MDP), AES-256 GCM decryption, and two layers of HMAC with a "Sonos large" seed), Geissler successfully derived the final AES key required to decrypt the LUKS-encrypted root filesystem. He then used
dmsetupto mount the decrypted SquashFS image.
- Over-the-Air (OTA) Firmware Decryption: Further analysis revealed how Sonos handles OTA updates. By understanding the binary manifest and using the RSA private model key (extracted from MDP and decrypted via the
Sonos blob encrypt decryptSMC), Geissler could decrypt an embedded AES key within the firmware image. This AES-128 CBC key (with an all-zero IV) allowed him to decrypt and analyze all OTA firmware update chunks, including shell scripts, SquashFS filesystems, and U-Boot FIT images.
Technical Deep Dive
▶ Watch: Arbitrary read/write leads to Boot ROM dump (23:45)
The technical depth of this research is remarkable, spanning hardware analysis, low-level bootloader exploitation, memory corruption, and complex cryptographic key derivation. The target SoC, the Amlogic A113D (and its close relative, the A113X in the Lenovo clock), is a quad-core ARM64 processor designed for multimedia and audio, featuring ARM TrustZone for secure execution.
The initial breakthrough on the Lenovo clock leveraged its USB recovery mode, a custom protocol that allows reading and writing to specific regions of SRAM and executing code. Geissler utilized the open-source tool Pi AML boot to interact with this protocol. The crucial "decryption oracle" was established by uploading a slightly corrupted BL2 image. While the secure boot process would decrypt and verify the image in SRAM, the verification would fail, preventing execution. However, the USB bootloader remained active, allowing a subsequent read command to dump the decrypted BL2 contents. This confirmed a block cipher, likely AES-256, operating in CBC mode with a 16-byte block size. This oracle was then applied to decrypt the FIP table and all subsequent BL3X blobs, including BL31 (Secure Monitor) and BL32 (Trusted OS).
Reversing BL31 revealed a complex SMC dispatcher that handled both standard and vendor-specific SIP services. The "Sonos blob encrypt decrypt" function, initially a black box, was found to issue an SMC to BL3, highlighting the central role of the secure monitor. The most critical vulnerability was discovered within the Secure Storage service. This service, designed to store encrypted key-value pairs, suffered from a heap overflow when parsing incoming data. Internally, the Secure Storage maintained an array of up to 64 key entries. However, the key count variable, which tracked the number of entries, was incremented without bounds checking against this fixed array size. This meant an attacker could provide enough crafted entries to overflow the keys array and overwrite adjacent memory.
The exploitation chain for this heap overflow was meticulously crafted:
- Heap Overflow: By providing more than 64 storage entries, the
key countwould exceed the array's capacity, leading to an out-of-bounds write. - Forging Key Entries: The overflow was used to write into a scratch buffer immediately following the
keysarray, allowing the creation of arbitrary, attacker-controlled key entry objects in memory. - Preserving Forged Entries: A subsequent
parsecommand was issued with a malformed parameter block. This intentionally triggered an error, causing the original 64 valid keys to be zeroed out but crucially not resetting thekey countor clearing the maliciously forged entries in the scratch buffer. - Arbitrary Read/Write: With forged key entries pointing to arbitrary memory locations and having attacker-controlled lengths, subsequent
storage readandstorage writeSMCs effectively became arbitrary 64-bit read and write primitives within the EL3 secure world. - Arbitrary Call: Geissler then identified a function pointer table used by the SMC dispatcher. Using the arbitrary 64-bit write, he could overwrite an entry in this table to point to an arbitrary address. By invoking the corresponding SMC, he achieved an arbitrary call primitive (similar to Call-Oriented Programming), allowing him to execute any function in BL31 with up to three arguments.
This arbitrary call primitive was immediately leveraged to dump sensitive OTP (One-Time Programmable) and e-fuse data. These hardware-backed memory regions store crucial device-specific cryptographic keys, including the AES-256 key used for secure boot and the AESGCMHW key essential for decrypting the main filesystem.
Further expanding his capabilities, Geissler undertook the ambitious task of dumping the device's Boot ROM. This required manipulating the MMU (Memory Management Unit) setup in EL3. He learned from the datasheet that the Boot ROM's physical address is FFFF0000. By analyzing the TTBR0_EL3 (Translation Table Base Register 0 for EL3) and TCR_EL3 (Translation Control Register for EL3), he determined the page table structure (32-bit address space, 4K page size, 4 entries in L1, 9 bits for L2 indexing). Using the arbitrary 64-bit write primitive, he patched the EL3 page tables at specific entries (e.g., L2 entry 511, L3 entries covering FFE range) to create valid mappings for the Boot ROM pages. Once mapped, the Boot ROM could be read out in its entirety.
Transitioning from the Lenovo clock to the Sonos One, the initial foothold was established using a DMA attack via the PCI Express bus, a method previously documented by Synacktiv. This involved removing the Wi-Fi card and inserting specialized hardware compatible with PCI Leech. This allowed patching the Linux kernel in DRAM to execute a custom command, specifically by modifying the power off command string and hooking the VFS read routine to invoke orderly power off. This resulted in a periodic execution of a user-mode helper that launched Wget to fetch a shell script, which then started TelnetD and modified /etc/passwd for root access.
With root access on the Sonos, Geissler could then load a custom kernel module. This module provided a user-friendly interface via debugfs to issue arbitrary SMCs and write to shared memory regions. This allowed him to port the secure monitor exploit. Although the exact memory layout of BL31 on the Sonos differed, the read 64 primitive still worked, enabling him to dump the Sonos's BL31 code, adjust offsets, and successfully execute the full exploit chain to dump OTP and Boot ROM data specific to the Sonos.
The final challenge was decrypting the LUKS-encrypted root filesystem and OTA firmware updates.
For LUKS decryption, the process was multi-layered:
- Manufacturing Data Pages (MDP): Three blobs on Sonos flash contained encrypted keys.
- Sonos blob encrypt decrypt: This SMC, now fully understood, used AES-256 in GCM mode. The key was a SHA-256 digest of the previously extracted
AESGCMHWkey from OTP. The IV was derived by XORing the last 12 bytes of the encrypted blob with "rootfs00" (for rootfs) or "ubifs000" (for UBIFS). - LUKS Key De-obfuscation: The decrypted keys from MDP were fed into a complex two-stage HMAC-SHA256 process, using an ASCII string "Sonos large" as a seed. The final SHA-256 digest was the actual AES key for the LUKS partition.
- DM-setup: With the derived AES key, Geissler used
LO setupto create a loopback device, skipping the initial 2MB LUKS header, and thendmsetup createto mount the SquashFS filesystem.
For OTA firmware decryption, Geissler reversed the update manifest retrieval process (HTTP GET request with device identifiers). The manifest, a custom binary TLV blob, pointed to the firmware base URL. The actual firmware images were encrypted using a nested cryptographic scheme:
- An RSA private model key, found encrypted in the MDP (and now decryptable), was used to decrypt a blob at the start of the firmware image.
- This decrypted blob contained an encrypted AES key.
- The final AES-128 key (used in CBC mode with an all-zero IV, as the first 16 bytes of output were unused) was then used to decrypt the firmware chunks. This allowed full inspection of the OTA update contents, including kernel images and device trees.
Demo / Proof of Concept
▶ Watch: Live demo: Dumping Sonos OTP and Boot ROM (30:00)
The demonstration visually confirmed the successful exploitation chain and key extraction on a live Sonos One speaker. The setup involved an SSH connection to a Raspberry Pi, which was equipped with the necessary DMA hardware (PCI Leech-compatible) connected via USB.
The initial phase of the demo focused on gaining root access to the Sonos speaker. The Raspberry Pi's ARP table confirmed the Sonos speaker's IP address on the Ethernet network. A shell script was then executed on the Pi, which initiated the DMA attack. This script patched the Sonos kernel in memory, specifically by modifying the power off command string and hooking the VFS read routine to trigger the orderly power off sequence. This manipulation resulted in the Sonos executing a custom userland command, which in turn spawned a TelnetD server and updated the /etc/passwd file with a known password hash. The researcher then demonstrated Telnetting into the Sonos speaker and gaining a root shell.
Next, the researcher set up an HTTP server on the Raspberry Pi to serve the next-stage payload to the compromised Sonos. After downloading and unpacking this payload, a custom kernel module was loaded onto the Sonos. This module provided the necessary interface to issue arbitrary Secure Monitor Calls (SMCs) and interact with shared memory regions from userland.
With the kernel module loaded, the core exploit was executed using a custom tool named "Sonos tool." The first command invoked was dump OTP, which triggered the secure monitor heap overflow, arbitrary read/write, and arbitrary call primitives to extract the device-specific OTP (One-Time Programmable) data. The output displayed a hex dump of the OTP, emphasizing that these values were unique to the demonstrated Sonos speaker.
Following the OTP dump, the Sonos tool was used to dump boot ROM. This command initiated the process of patching the EL3 page tables via the arbitrary write primitive, mapping the Boot ROM into the accessible memory space. The demo showed a progress counter as the tool read out individual quad words of the 64KB Boot ROM. After completion, the SHA-1 hash of the dumped Boot ROM was displayed (as SHA-256 was unavailable on the Sonos's busybox). Running strings on the dumped Boot ROM revealed human-readable strings, confirming the successful extraction of this normally inaccessible firmware.
The demonstration concluded with a brief overview of the extracted OTP data, highlighting key fields such as the digest of the RSA public key for secure boot, the AES-256 key for secure boot stages, and crucially, the AESGCMHW key—the "boy we've been looking for"—directly relevant to LUKS volume decryption. The CPU ID was also noted, which could be used for alternative key derivation methods. This comprehensive demonstration proved the end-to-end compromise of the Sonos One, from initial shell access to deep-seated key extraction and firmware dumping.
Defensive Implications
▶ Watch: Zero-day vulnerability and wider impact discussed (49:45)
Peter Geissler's research into the Sonos One exposes several critical areas where embedded device security can be strengthened, offering valuable lessons for manufacturers and defenders alike.
- Robust Secure Boot Implementation: The core issue lies in the secure boot chain's reliance on vendor-specific extensions (SIP services) within the ARM Trusted Firmware (ATF). The heap overflow in the Secure Storage service highlights that even code running in the highly privileged EL3 can contain critical vulnerabilities. Manufacturers must rigorously audit and test all custom modifications to reference firmware, implementing stringent memory safety checks, especially for operations handling external or untrusted input. Fuzzing trusted components is essential.
- Eliminate Side Channels and Recovery Modes: The presence of an accessible USB recovery mode on the Amlogic SoC (even if disabled on the Sonos) provided a crucial initial foothold for research and decryption. While such modes are necessary for development, they must be permanently disabled or cryptographically locked down in production devices. Any alternative boot paths or debug interfaces should be robustly secured or physically removed.
- Strict Bounds Checking and Memory Safety: The root cause of the arbitrary read/write primitive was a simple lack of bounds checking on the
key countvariable within the Secure Storage'skeysarray. This fundamental memory safety flaw allowed a cascade of exploitation. Developers must implement meticulous bounds checks for all array accesses, particularly in low-level, privileged code. Adopting memory-safe languages or employing advanced static and dynamic analysis tools can help mitigate such vulnerabilities.
- Simplify and Standardize Cryptographic Key Derivation: Sonos's multi-stage, proprietary key derivation scheme for LUKS volumes (involving AES-256 GCM, two HMAC-SHA256 steps with a "Sonos large" seed, and MDP-derived keys) is overly complex. Such complexity increases the attack surface and makes auditing difficult. Manufacturers should favor widely accepted, well-vetted cryptographic standards and avoid "security by obscurity" through convoluted custom schemes. Key material should be derived directly from a hardware root of trust using standard KDFs.
- Secure Key Management and Provisioning: The extraction of OTP and e-fuse data, containing fundamental device keys, signifies a complete compromise of the device's root of trust. Once these keys are exposed, the entire security model is fundamentally broken, as future firmware updates can be decrypted and analyzed, and potentially even crafted. Hardware-backed key storage should be designed to prevent any software, even in EL3, from directly extracting the raw key material. Instead, keys should only be usable for specific cryptographic operations within the secure enclave.
- Thorough Manufacturing Data Scrubbing: The discovery of leftover Wi-Fi keys and other provisioning-related "crap" in the NAND flash dump is a significant manufacturing oversight. Sensitive data used during factory provisioning must be completely and securely erased before devices ship. Failure to do so creates unnecessary attack vectors and compromises.
- Consider Vendor Reference Code Vulnerabilities: The researcher noted that the exploited heap overflow might be present in the Amlogic vendor reference code, implying that "many more devices" using this chip could be vulnerable. Device manufacturers must conduct independent security audits of all third-party and reference code, not just their own additions, as vulnerabilities in base platforms can have widespread impact.
- Proactive Vulnerability Disclosure and Patching: While the researcher chose not to disclose the EL3 vulnerability, such findings highlight the need for robust vulnerability disclosure programs. Manufacturers should actively engage with the security research community and establish clear channels for receiving and addressing security reports. Even if keys are compromised, patching subsequent vulnerabilities in firmware and bootloaders remains crucial for mitigating ongoing risks and preventing further exploitation.
In essence, Geissler's work underscores that true device security requires a holistic approach, addressing vulnerabilities at every layer—from the hardware and boot ROM to the secure monitor, operating system, and manufacturing process.
Key Takeaways
- Heap Overflow in Secure Monitor Leads to Full Compromise: A critical heap overflow vulnerability within the Amlogic SoC's Secure Storage SIP service in EL3 allowed for arbitrary 64-bit read/write and arbitrary code execution, demonstrating how a subtle memory corruption bug in a trusted component can completely undermine device security.
- Decryption Oracle is a Powerful Starting Point: The ingenious technique of using a corrupted BL2 image and the USB recovery mode to create a "decryption oracle" was instrumental in bypassing initial encryption and gaining visibility into the secure boot chain, highlighting the importance of side-channel attacks and unexpected behaviors.
- Multi-Stage Key Derivation is Complex and Vulnerable: Sonos's intricate, proprietary key derivation process for LUKS and OTA updates, involving multiple cryptographic primitives (AES-256 GCM, HMAC-SHA256, RSA) and keys spread across OTP and MDP, ultimately proved reversible once the core OTP keys were extracted.
- Manufacturing Process Flaws Expose Sensitive Data: The discovery of unscrubbed Wi-Fi keys and provisioning data in the NAND flash dump underscores the critical need for secure data sanitization during the manufacturing process to prevent leakage of sensitive information.
- Cross-Device Research Accelerates Exploitation: The strategic pivot to the less-locked-down Lenovo alarm clock, which shares a similar Amlogic SoC, was crucial for initial research, demonstrating the value of identifying and leveraging common platforms to overcome security barriers.
- Once Root Keys Are Out, Game Over: The extraction of fundamental cryptographic keys from OTP and e-fuses means that even future firmware updates can be decrypted and analyzed, making a full recovery from such a compromise extremely challenging for the vendor without a complete hardware redesign.
About the Speaker(s)
Peter Geissler is an independent security researcher based in the Netherlands. He has a long-standing association with Hack in the Box, having been involved for approximately 10 years, primarily organizing CTF competitions and delivering various talks. Geissler is also active on Twitter under the handle @Blasty_4. His work often focuses on embedded device security, as demonstrated by his participation in contests like Pwn2Own, where he targets devices such as printers and smart speakers.
Reviews
Dr. Zero (Offensive Security Researcher) — MUST SEE
This is the real deal — a full chain from DMA foothold to EL3 arbitrary code execution on a production smart speaker, with OTP key extraction, Boot ROM dump, and complete firmware decryption. Geissler did the work himself, the exploit chain is elegant, and the live demo delivered. This is what hardware security research looks like when someone actually commits.
Heather Calloway (CISO) — STRONG ACCEPT
This is serious embedded security research — a full chain from USB oracle to EL3 code execution to OTP key extraction on a consumer smart speaker. Every CISO with IoT exposure should understand what this means: once the root keys are out, the device's security model is permanently broken. Worth your time to understand the class of risk, not the exploit mechanics.