Unlock the power of your datacenter with ARM.
Klara’s ARM and Embedded Software Development Team intelligently applies modern design methodologies and agile development best practices to firmware development from bare metal systems to multi-processor architectures.
Embedded Development Contact UsAdditional Articles
Here are more interesting articles on Embedded that you may find useful:
- The Maintainer’s Dilemma: Strategies for Supporting Legacy Drivers Across Decades of Hardware Evolution
- Why FreeBSD is the Right Choice for Embedded Devices
- Looking Towards the Future: FreeBSD on the RISC-V Architecture
- RISC-V: The New Architecture on the Block
- FreeBSD arm64 Performance – Getting more out of your FreeBSD Deployment
Introduction
At the foundation of every Internet of Things (IoT) device lies an often-neglected layer of critical software–the firmware. While application security garners significant attention in cybersecurity discourse, firmware vulnerabilities represent a particularly insidious threat vector that continues to be underestimated by manufacturers and security practitioners alike. The issue first came to mainstream attention over a decade ago when the IoT HVAC system used by major US retailor Target was used as a jumping off point to compromise their payment processing systems. According to Zscaler's ThreatLabz, IoT malware attacks increased by a staggering 400% in 2023 compared to the previous year. Additionally, with researchers identifying 34 of the 39 most commonly used IoT exploits as being over three years old on average, it highlights the persistence of legacy vulnerabilities in the ecosystem.
This technical examination investigates the multifaceted challenges of securing firmware in the IoT ecosystem, where the stakes have never been higher. With millions of connected devices transmitting sensitive data across networks worldwide and NETGEAR's 2024 IoT Security Landscape Report revealing that even home network devices face an average of 10 attacks every 24 hours, the attack surface is expanding exponentially while many fundamental security problems remain unsolved.
The Firmware Attack Surface: Deeper Than Anticipated
Firmware security represents a complex challenge because it operates at the intersection of the hardware and software domains. Modern IoT firmware stacks typically consist of:
- Bootloader components (often multiple stages, sometimes implementing a chain-of-trust)
- Hardware initialization modules (often technically their own independent firmware)
- Operating system kernels (frequently lightweight RTOS implementations)
- Device drivers
- Application-specific logic
- Update mechanisms
Each layer presents unique attack vectors. A 2023 study from MDPI found numerous IoT firmware vulnerabilities persist, with devices frequently lacking adequate protection mechanisms due to resource constraints in embedded systems. The study highlighted that manufacturers often overlook vulnerabilities identified aftermarket release due to non-iterative implementation cycles, while the Internet-readiness of these devices makes exploitation more streamlined and direct. Without sufficient forethought to securely update devices once they are in the field, even once someone identifies a vulnerability, correcting it can be difficult. The delivery mechanism for firmware updates needs to provide both security (to prevent malware from taking over the device) and safety (to ensure a problematic update does not disable the device).
The intimate relationship between firmware and hardware creates particularly challenging security scenarios. Consider the simplified representation of a typical IoT firmware attack path:
[Boot ROM] → [Bootloader] → [Firmware Authentication] → [Kernel Initialization] → [Driver Loading] → [Application Execution]
Attackers targeting these early-stage execution environments can potentially bypass higher-level security controls entirely. According to threat intelligence research by Mandiant, vulnerabilities in the ThroughTek Kalay P2P Network (CVE-2021-28372) potentially affected 83 million devices, allowing remote code execution that could enable attackers to take control of routers, smart devices, and IP cameras.
If developers implement security only in the Kernel, an attacker that compromises the bootloader can load an unvalidated or untrusted kernel, bypassing all security. However, if security is implemented only at the boot loader, then a flaw in a driver or other component can compromise an otherwise trusted Kernel. Security requires a holistic approach to provide end-to-end protection.
The Technical Debt Crisis in IoT Firmware
A significant contributor to firmware insecurity is the prevalence of legacy code and third-party components. Research by the IoT Security Foundation indicates that unpatched firmware is responsible for 60% of IoT security breaches. This technical debt manifests in several problematic patterns:
Memory-Unsafe Implementation Languages
Despite decades of research demonstrating the security advantages of memory-safe languages, numerous studies have confirmed that the vast majority of IoT firmware is implemented in memory-unsafe languages. According to cybersecurity experts, it's estimated that at least 65% of security vulnerabilities are the result of memory errors, with Microsoft reporting that approximately 70% of vulnerabilities in their products over the past decade have been memory safety issues. Memory corruption vulnerabilities continue to dominate the firmware vulnerability landscape, with buffer overflows and use-after-free conditions representing a significant portion of discovered issues.
Consider the following typical example from an actual deployed device (sanitized to protect the manufacturer):
int process_config_packet(uint8_t* packet, size_t packet_len) { char config_buffer[CONFIG_BUFFER_SIZE]; // Unsafe copy without proper bounds checking memcpy(config_buffer, packet, packet_len); process_configuration(config_buffer); return SUCCESS; }
This pattern appears repeatedly across IoT ecosystems, creating exploitable conditions when packet_len exceeds CONFIG_BUFFER_SIZE. Such vulnerabilities become especially problematic in network-connected devices where attackers can craft malicious inputs remotely.
In cases where it is impractical to replace firmware or software written in memory-unsafe languages, there is a new hardware ISA specifically designed to prevent common memory safety issues by enforcing pointer boundaries in hardware. The Capability Hardware Enhanced RISC Instructions (CHERI) and CHERIoT projects provide an alternative solution to rewriting legacy software.
Secure Boot Implementation Failures
The security of firmware fundamentally depends on secure boot processes to validate firmware integrity before execution. A 2023 study from Quorum Cyber revealed alarming statistics about IoT vulnerabilities, reporting a 41% increase in Industrial Control System vulnerabilities in the first half of 2021, with nearly 400 different remotely exploitable vulnerabilities discovered in various devices.
Ensuring that only the intended firmware is loaded on a device is critical to the entire chain-of-trust. If the firmware is compromised, then all software running atop it can no longer be trusted. Secure Boot is a mechanism to verify the cryptographic signature of a firmware image to provide assurance of its provenance and detect if it has not been tampered with. Once trusted firmware is loaded, it is the responsibility of that firmware to verify the next component in the chain. In most cases, that means the firmware needs to establish that the kernel is from a trusted source and has not been compromised. It is then the responsibility of the kernel to ensure that any drivers it loads–or software it allows to run–are provided by a trusted party. It must also verify that these components have not been substituted with malware by a rogue actor.
The Measurement Gap
Perhaps most concerning is what we've termed the "measurement gap" in firmware security–the inability of organizations to accurately assess their firmware security posture. According to the 2023 NETGEAR and Bitdefender IoT Security Landscape Report, the highest number of vulnerabilities were discovered in TV sets (34%), smart plugs (18%), digital video recorders (13%), and routers (12%). Vulnerabilities in TVs are especially common because they are often used for extended periods with infrequent updates, typically functioning well beyond their support windows.
As with the opening example of the HVAC system that was compromised, it is important to consider what sensitive services and data a device such as a Smart TV might have access to, and how it can be contained.
Technical Approaches to Mitigating Firmware Risks
Addressing firmware security challenges requires a defense-in-depth approach that spans the entire technology stack, and the entire device lifecycle.
Starting from first principles, effective firmware security implementations include:
Hardware-Rooted Trust
Modern security-focused IoT architectures implement hardware security modules (HSMs) or Trusted Platform Modules (TPMs) to establish a hardware root of trust. These hardware components provide secure key storage, cryptographic acceleration, and attestation capabilities that protect firmware integrity.
Measured Boot with Attestation
Beyond secure boot, measured boot processes calculate and securely store cryptographic measurements of each firmware component during the boot sequence. Systems can later use these measurements for remote attestation, allowing systems to verify device integrity before establishing trusted connections.
A simplified attestation protocol typically works as follows:
- Device boots, measuring each component with a cryptographic hash
- Measurements are securely stored in TPM Platform Configuration Registers (PCRs)
- Remote verifier challenges device to provide attestation
- TPM signs the PCR values with a device-unique attestation key
- Verifier compares reported measurements against known-good values
- Only then does the verifier provide access to the sensitive data, security network, or necessary decryption keys
This approach enables continuous trust verification throughout the device lifecycle rather than only at boot time.
Memory-Safe Implementation Languages
The emerging use of Rust for firmware development represents a significant advancement in preventing memory corruption vulnerabilities. According to The Register, memory safety is becoming a critical focus in programming language choices, with experts estimating that at least 65% of security vulnerabilities are the result of memory errors that are prevented by memory-safe languages.
Conclusion
Firmware security represents the foundation upon which all other IoT security controls rest. The technical challenges in this domain are substantial, spanning hardware integration, cryptographic implementation, supply chain verification, and secure coding practices.
In particular, the research data highlighted in this analysis demonstrates both the scale of the problem and the efficacy of emerging solutions. As the IoT ecosystem continues its explosive growth, the security community must devote increased attention and resources to this foundational layer of the technology stack.
Organizations developing or deploying IoT solutions should implement firmware security testing as part of their standard security assessment methodologies, including binary analysis, cryptographic verification, and hardware-level security control testing. Ultimately, the future of IoT security depends not just on network controls and application security, but on a much deeper understanding of and investment in the complexities of firmware security.
Author's Note: This article draws on research conducted between 2021 and early 2025 across multiple IoT ecosystems, referencing data from organizations including Zscaler's ThreatLabz, NETGEAR, CISA, Mandiant, Microsoft, IoT Security Foundation, and academic research in the field. Finally, for detailed technical specifications of testing methodologies and complete vulnerability statistics, please refer to the original research publications cited.