One Bad Apple Spoils the Barrel: Understanding the Security Risks Introduced by Third-Party Components in IoT Firmware

Binbin Zhao, Shouling Ji, Jiacheng Xu, Yuan Tian, Qiuyang Wei, Qinying Wang, Chenyang Lyu, Xuhong Zhang, Changting Lin, Jingzheng Wu, Raheem Beyah

TL;DR

This paper introduces FIRMSEC, a novel framework for automatically identifying third-party components (TPCs) and their associated vulnerabilities within IoT firmware. By analyzing a massive dataset of over 34,000 firmware images, they reveal widespread use of vulnerable and outdated TPCs, highlighting significant security risks and potential license violations in the IoT ecosystem.

What Problem Does This Paper Address?

The rapid growth of the Internet of Things (IoT) has led to an increased reliance on third-party components (TPCs) to accelerate firmware development. However, these TPCs often contain known vulnerabilities that can significantly compromise the security of the entire IoT device. Existing security analysis tools often overlook the specific impact of TPC vulnerabilities, lack scalability for large-scale analysis, or struggle with the diverse nature of IoT firmware (e.g., monolithic firmware). This paper aims to bridge this gap by providing a comprehensive understanding of TPC-introduced security risks in IoT firmware through a large-scale, automated analysis.

Methods

The authors developed a framework called FIRMSEC, which consists of three main components:

  1. Firmware Collection: A web crawler and custom plugins were used to gather a large and diverse dataset of firmware images from various sources, including official websites, FTP sites, communities, and a private repository.
  2. Firmware Preprocessing: This stage involves:
  3. Filtration: Removing non-firmware files to ensure data integrity.
  4. Identification: Determining crucial firmware information like operating systems, architectures, and filesystems using metadata and web crawling.
  5. Extraction and Disassembly: Unpacking firmware to extract components and disassembling them to analyze code. Custom plugins were developed for tools like IDA to handle monolithic firmware and various filesystems.
  6. Firmware Analysis: This is the core of FIRMSEC, employing a novel TPC detection strategy that combines:
  7. Syntactical Features: Analyzing string literals and function information.
  8. Control-Flow Graph (CFG) Features: Extracting and comparing attributed control-flow graphs (ACFGs).
  9. Version-Level Detection: Crucially, FIRMSEC aims to identify TPCs at a specific version level, which is essential for accurate vulnerability mapping. This is achieved by using edit distance and ratio-based matching for syntactical features, and a customized Gemini approach for CFG features.
  10. Vulnerability Identification: Once TPCs are identified, their versions are checked against a constructed TPC database containing known vulnerabilities (CVEs) to pinpoint potential security risks.

Datasets

  • Firmware Dataset: The authors constructed a large-scale dataset comprising 34,136 valid firmware images from 13 vendors, including 11,086 publicly accessible and 23,050 private images. This dataset covers 35 kinds of IoT devices.
  • TPC Database: A database was built containing 1,261 TPCs, along with their licenses, versions, CVEs, CVSS scores, and descriptions.
  • Evaluation Datasets: Several datasets were created for training, validation, and testing, including ACFGs from 1,192 TPCs and labeled firmware-to-TPC mappings.

Key Insights and Ideas

  • Ubiquitous Vulnerabilities: The study reveals that a significant portion of IoT firmware relies on outdated or vulnerable TPCs, creating a widespread security risk.
  • The "Bad Apple" Effect: A single vulnerable TPC can "spoil the barrel," affecting numerous devices and potentially leading to large-scale attacks.
  • Monolithic Firmware Challenge: The paper highlights the difficulty in analyzing monolithic firmware, which lacks a traditional OS structure, and presents solutions to address this.
  • Vendor Practices: Vendors often reuse the same TPCs across different products and may not update them promptly, even when new firmware versions are released.
  • Geographical Disparities: The security posture of IoT devices varies significantly by region, with some areas exhibiting a higher concentration of vulnerable devices.
  • License Compliance: A substantial number of commercial firmware images show potential violations of GPL/AGPL licenses, raising legal concerns.

Key Results

  • TPC Detection: FIRMSEC achieved 91.03% precision and 92.26% recall at the version-level for TPC detection, outperforming existing state-of-the-art methods.
  • Vulnerability Identification: The analysis identified 584 TPCs and detected 128,757 vulnerabilities caused by 429 CVEs across the 34,136 firmware images.
  • Dataset Size: The dataset of 34,136 firmware images is claimed to be the largest of its kind for IoT firmware analysis.
  • Vulnerability Verification: An average precision of 96.3% was achieved in verifying identified vulnerabilities.
  • TPC Delay: The average delay time for TPCs used in firmware was found to be 1948.2 days, indicating a significant lag in adopting newer, potentially more secure versions.
  • License Violations: 2,478 commercial firmware images were found to potentially violate GPL/AGPL licenses.

Limitations and Future Work

  • Uncommon TPCs: FIRMSEC's ability to detect TPCs is limited by its database. Uncommon TPCs not present in the database may be missed, leading to false negatives.
  • Encrypted Firmware: The analysis could not be performed on encrypted firmware images.
  • Unknown Filesystems/Processors: A small percentage of firmware images could not be analyzed due to unknown filesystems or processors.
  • Future Work: The authors plan to:
  • Expand the firmware dataset to include more devices, such as smart assistant devices.
  • Continuously enrich the TPC database.
  • Combine FIRMSEC with fuzzing techniques to discover unknown vulnerabilities.
  • Address the ethical implications of their findings through responsible disclosure and by providing a sanitized dataset.

Summary updated

Abstract

Currently, the development of Internet of Things (IoT) firmware heavily depends on third-party components (TPCs) to improve development efficiency. Nevertheless, TPCs are not secure, and the vulnerabilities in TPCs will influence the security of IoT firmware. Existing works pay less attention to the vulnerabilities caused by TPCs, and we still lack a comprehensive understanding of the security impact of TPC vulnerability against firmware. To fill in the knowledge gap, we design and implement FirmSec, which leverages syntactical features and control-flow graph features to detect the TPCs in firmware, and then recognizes the corresponding vulnerabilities. Based on FirmSec, we present the first large-scale analysis of the security risks raised by TPCs on 34,136 firmware images. We successfully detect 584 TPCs and identify 128,757 vulnerabilities caused by 429 CVEs. Our in-depth analysis reveals the diversity of security risks in firmware and discovers some well-known vulnerabilities are still rooted in firmware. Besides, we explore the geographical distribution of vulnerable devices and confirm that the security situation of devices in different regions varies. Our analysis also indicates that vulnerabilities caused by TPCs in firmware keep growing with the boom of the IoT ecosystem. Further analysis shows 2,478 commercial firmware images have potentially violated GPL/AGPL licensing terms.
BibTeX
@article{zhao2022one,
  author = {Binbin Zhao and Shouling Ji and Jiacheng Xu and Yuan Tian and Qiuyang Wei and Qinying Wang and Chenyang Lyu and Xuhong Zhang and Changting Lin and Jingzheng Wu and Raheem Beyah},
  title = {{One Bad Apple Spoils the Barrel: Understanding the Security Risks Introduced by Third-Party Components in IoT Firmware}},
  journal = {IEEE Trans. Dependable Secur. Comput.},
  year = {2022},
  url = {https://openreview.net/forum?id=1ETGYawjmn},
}
Figure