用大模型把协议文档转成可验证的规范,自动发现并定位网络协议解析器漏洞。
Validating Network Protocol Parsers with Traceable RFC Document Interpretation
- 通过大模型将RFC文档转化为形式化协议消息规范作为准真值
- 在9个协议上检测出69个漏洞,其中36个经确认
- 漏洞可追溯到原始文档,适合协议开发与安全审计人员
验证网络协议实现的正确性面临真值和可追溯性难题。前者难以判断实现是否出错,尤其当错误无明显表现时;后者则关乎开发者能否理解实现如何违反规范,从而修复问题。现有工作通常忽略两者,本文结合大语言模型(LLMs)的进展,提出新方法:网络协议常附有结构化规格文档(即RFC),可利用LLM系统性地转化为形式化消息规范。这些规范虽可能因模型幻觉存在错误,但仍可用作准真值来验证协议解析器,而验证结果又能反向优化规范。由于真值源自文档,发现的任何实现缺陷均可回溯至原始文档,有效解决可追溯性问题。我们在九种使用C、Python、Go编写的网络协议实现上进行了广泛评估,结果表明该方法优于现有最先进方案,共检测出69个漏洞,其中36个已确认。本研究展示了基于自然语言规格完全自动化软件验证的可能性,此前该过程被认为主要依赖人工理解文档并推导预期输出。
原文摘要 · Abstract (English)
Validating the correctness of network protocol implementations is highly challenging due to the oracle and traceability problems. The former determines when a protocol implementation can be considered buggy, especially when the bugs do not cause any observable symptoms. The latter allows developers to understand how an implementation violates the protocol specification, thereby facilitating bug fixes. Unlike existing works that rarely take both problems into account, this work considers both and provides an effective solution using recent advances in large language models (LLMs). Our key observation is that network protocols are often released with structured specification documents, a.k.a. RFC documents, which can be systematically translated to formal protocol message specifications via LLMs. Such specifications, which may contain errors due to the hallucination of LLMs, are used as a quasi-oracle to validate protocol parsers, while the validation results in return gradually refine the oracle. Since the oracle is derived from the document, any bugs we find in a protocol implementation can be traced back to the document, thus addressing the traceability problem. We have extensively evaluated our approach using nine network protocols and their implementations written in C, Python, and Go. The results show that our approach outperforms the state-of-the-art and has detected 69 bugs, with 36 confirmed. The project also demonstrates the potential for fully automating software validation based on natural language specifications, a process previously considered predominantly manual due to the need to understand specification documents and derive expected outputs for test inputs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。