用AI代理自动验证并修复LLM生成的嵌入式固件漏洞
Securing LLM-Generated Embedded Firmware through AI Agent-Driven Validation and Patching
- 三阶段流程:生成-验证-迭代修补,结合AI代理协作
- 漏洞修复率92.4%,安全覆盖率0.87,实时性达8.6ms
- 适合嵌入式安全开发与AI驱动的自动化测试人群
大型语言模型(LLMs)在生成嵌入式系统固件方面展现出潜力,但常引入安全缺陷且难以满足实时性能要求。本文提出一种三阶段方法:结合基于LLM的固件生成、虚拟环境中的自动化安全验证与迭代优化。采用结构化提示词,GPT-4生成适用于网络与控制任务的固件,并在QEMU上部署于FreeRTOS。通过模糊测试、静态分析和运行时监控检测缓冲区溢出(CWE-120)、竞争条件(CWE-362)及拒绝服务威胁(CWE-400)。专用AI代理(威胁检测、性能优化、合规验证)协同提升检测与修复效率。问题按CWE分类后,触发针对性的LLM补丁生成,形成闭环迭代。实验显示漏洞修复率达92.4%(较基线提升37.3%),威胁模型符合率95.8%,安全覆盖指数0.87。实时指标包括最坏执行时间8.6ms,抖动195μs。该流程显著提升固件安全性与性能,并开源了用于未来研究的数据集。
原文摘要 · Abstract (English)
Large Language Models (LLMs) show promise in generating firmware for embedded systems, but often introduce security flaws and fail to meet real-time performance constraints. This paper proposes a three-phase methodology that combines LLM-based firmware generation with automated security validation and iterative refinement in a virtualized environment. Using structured prompts, models like GPT-4 generate firmware for networking and control tasks, deployed on FreeRTOS via QEMU. These implementations are tested using fuzzing, static analysis, and runtime monitoring to detect vulnerabilities such as buffer overflows (CWE-120), race conditions (CWE-362), and denial-of-service threats (CWE-400). Specialized AI agents for Threat Detection, Performance Optimization, and Compliance Verification collaborate to improve detection and remediation. Identified issues are categorized using CWE, then used to prompt targeted LLM-generated patches in an iterative loop. Experiments show a 92.4\% Vulnerability Remediation Rate (37.3\% improvement), 95.8\% Threat Model Compliance, and 0.87 Security Coverage Index. Real-time metrics include 8.6ms worst-case execution time and 195μs jitter. This process enhances firmware security and performance while contributing an open-source dataset for future research.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。