Cross-Device Firmware Bug Detection in Deployed IoT Systems Based on Twisted-CodeBERT-GCN Semantic Learning

Hao Liu, Yucheng Liu, Yinghua Jiang, Zhifu Zhang, Liquan Chen, Gerhard Petrus Hancke · IEEE Transactions on Consumer Electronics · 2025

With the rapid growth of interactive consumer IoT devices, particularly in smart home and health care electronics, the detection of firmware bugs has become increasingly critical for system security and reliability. Existing approaches, constrained by their single device scenarios, lack the capability to detect cross device bugs arising from interaction once devices are operating within the IoT system as a whole. In this paper, we propose a novel Twisted-CodeBERT-GCN semantic information (SI) learning based approach that can effectively detect both single device bugs (SDBs) and cross device bugs (CDBs). Our method first transforms IoT firmware code into logic semantic flow graphs (LSFGs), then enhances their representation through the LoRA-based fine-tuned CodeBERT model with context semantic information (CSI). By embedding this CSI directly onto the graph nodes’ logic semantic information (LSI), a process we term “twisting”, we create rich, multi-modal representations. These twisted LSFGs are further processed by a specialized graph convolutional network (GCN) model to extract comprehensive semantic information for bug detection. Evaluated the public dataset (SARD/NVD) and a custom-built dataset of real-world IoT firmware, our method achieves 89.6% accuracy for SDBs and 89.2% precision for CDBs, representing a 5.2% improvement in precision over VulDeePecker.

Read the paper · More papers on PaperTik