LuaTaint: A Static Analysis System for Web Configuration Interface Vulnerability of Internet of Things Devices

Jiahui Xiang, Lirong Fu, Tong Ye, Peiyu Liu, Huan Le, Liming Zhu, Wenhai Wang

TL;DR

This paper introduces LuaTaint, a novel static analysis system designed to automatically detect vulnerabilities in the web configuration interfaces of IoT devices. By combining advanced static taint analysis with the power of Large Language Models (LLMs) for false alarm pruning, LuaTaint achieves high precision and comprehensive detection, addressing a critical gap in IoT security.

What Problem Does This Paper Address?

The proliferation of Internet of Things (IoT) devices has led to a surge in security vulnerabilities, particularly within their web configuration interfaces. These interfaces, often built with diverse and sometimes insecure code, are prime targets for attackers. Existing methods for identifying these vulnerabilities struggle with the complexity and variability of these interfaces, often lacking precision or comprehensive coverage. Specifically, taint-based vulnerabilities, where untrusted data flows into sensitive functions without proper validation, are prevalent and difficult to detect effectively. This paper aims to bridge this gap by providing an automated, precise, and comprehensive solution for detecting these critical vulnerabilities in IoT web interfaces.

Methods

LuaTaint employs a multi-faceted approach:

  • Static Taint Analysis: At its core, LuaTaint performs static taint analysis on the Lua code of IoT device firmware. This involves building an Abstract Syntax Tree (AST) and a Control Flow Graph (CFG) to understand the program's structure and data flow.
  • Framework-Adapted Module: Recognizing that IoT web interfaces often follow specific patterns (like the Model-View-Controller architecture used in LuCI), LuaTaint incorporates rules derived from these framework-specific dispatching mechanisms. This helps to accurately trace data flow and identify sensitive functions, improving precision and reducing false positives.
  • Field-Sensitive Analysis: To handle the dynamic typing and complex data structures (like Lua tables) common in IoT firmware, LuaTaint uses a field-sensitive analysis. This allows it to differentiate between table attributes originating from trusted and untrusted sources, leading to more accurate vulnerability detection.
  • LLM-Assisted False Alarm Pruning: A key innovation is the integration of a Large Language Model (LLM), specifically GPT-4, to prune false alarms generated by the static analysis. By providing the LLM with code snippets and context, it helps to distinguish genuine vulnerabilities from benign code patterns, significantly enhancing the precision of the system and reducing the need for manual verification.

Datasets

The evaluation of LuaTaint utilized several datasets:

  • Manufactured Vulnerabilities: The authors created 323 distinct examples of known vulnerabilities (CI, RCE, path traversal, SQL injection) to test the system's completeness.
  • Real-World Vulnerabilities (CVEs): A dataset of 189 firmware web-related vulnerabilities from six vendors (D-Link, TP-Link, Tenda, NetGear, TOTOLink, Linksys) was used to assess performance against known issues.
  • Firmware Samples: The primary dataset consisted of 2,447 firmware samples from 11 renowned vendors (including 8devices, Avalon, GL.iNet, Linksys, NetGear, TP-Link, Xiaomi, OpenWrt, etc.). From these, 145 samples were verified, leading to the discovery of 111 vulnerabilities.

Key Insights and Ideas

  • Taint-based vulnerabilities are rampant: The study highlights that taint-based vulnerabilities (like command injection and cross-site scripting) constitute a significant portion of IoT web interface flaws.
  • Framework-specific analysis is crucial: Simply applying generic taint analysis is insufficient. Understanding the specific dispatching rules and architecture of frameworks like LuCI is vital for accurate detection.
  • LLMs are powerful allies for security analysis: Leveraging LLMs for false alarm pruning dramatically improves the precision of automated vulnerability detection systems, reducing manual effort and increasing confidence in findings.
  • Vulnerabilities often recur: The same vulnerability patterns are found across different firmware series from the same vendors, suggesting a need for proactive security measures by manufacturers.

Key Results

  • Discovery of 111 vulnerabilities: LuaTaint successfully identified 111 true vulnerabilities across 145 verified firmware samples.
  • High detection precision: The system achieved a vulnerability detection precision rate of up to 89.29%.
  • Significant reduction in false alarms: The framework-adapted module and LLM pruning together reduced the false alarm rate from 77.97% to 59.12% (before LLM) and further to 89.29% (after LLM pruning, in terms of true positive rate).
  • Outperforms existing tools: Compared to Semgrep, a popular static analysis tool, LuaTaint demonstrated superior precision and comprehensiveness in analyzing Lua and LuCI frameworks.
  • Efficiency gains: The approximation operation in the analysis significantly reduced runtime and memory overhead by an average of 68.95% and 52.13%, respectively.

Limitations and Future Work

  • Focus on back-end: LuaTaint primarily analyzes the back-end of web handlers and lacks in-depth analysis of front-end interactions, which could improve detection of vulnerabilities like XSS.
  • Computational overhead: While optimizations are in place, large-scale analysis can still incur significant computational costs. Future work could explore more efficient data flow algorithms.
  • LLM dependency: The reliance on LLMs for pruning introduces a dependency on external APIs and potential costs.
  • Future directions: The authors suggest expanding the analysis to more device types and vulnerability scenarios, exploring more intelligent and automated detection methods, and further fine-tuning LLMs for improved pruning performance.

Summary updated

Abstract

The diversity of Web configuration interfaces for Internet of Things (IoT) devices has exacerbated issues, such as inadequate permission controls and insecure interfaces, resulting in various vulnerabilities. Owing to the varying interface configurations across various devices, the existing methods are inadequate for identifying these vulnerabilities precisely and comprehensively. This study addresses these issues by introducing an automated vulnerability detection system, called LuaTaint. It is designed for the commonly used Web configuration interface of IoT devices. LuaTaint combines static taint analysis with a large language model (LLM) to achieve widespread and high-precision detection. The extensive traversal of the static analysis ensures the comprehensiveness of the detection. The system also incorporates rules related to page handler control logic within the taint detection process to enhance its precision and extensibility. Moreover, we leverage the prodigious abilities of LLM for code analysis tasks. By utilizing LLM in the process of pruning false alarms, the precision of LuaTaint is enhanced while significantly reducing its dependence on manual analysis. We develop a prototype of LuaTaint and evaluate it using 2447 IoT firmware samples from 11 renowned vendors. LuaTaint has discovered 111 vulnerabilities. Moreover, LuaTaint exhibits a vulnerability detection precision rate of up to 89.29%.
BibTeX
@article{xiang2025luataint,
  author = {Jiahui Xiang and Lirong Fu and Tong Ye and Peiyu Liu and Huan Le and Liming Zhu and Wenhai Wang},
  title = {{LuaTaint: A Static Analysis System for Web Configuration Interface Vulnerability of Internet of Things Devices}},
  journal = {IEEE Internet of Things Journal},
  year = {2025},
  url = {https://openreview.net/forum?id=bAAfKMLiwn},
}
Figure