arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.29124cs.NI
收藏

CornerCase: 使用大语言模型对协议实现进行自动化极端测试

CornerCase: Automated Extremal Testing of Protocol Implementations using LLMs

UCLA(加州大学洛杉矶分校);Microsoft Research(微软研究院)

Rathin Singha, Kuan Qian, Srinath Saikrishnan, Tracy Zhao, Soheil Abbasloo, Ryan Beckett, Siva Kesava Reddy Kakarla, Todd Millstein, George Varghese

AI总结:

提出CornerCase方法,利用大语言模型从协议规范中提取约束并生成边界测试用例,通过差分测试发现多个协议实现中的未知错误。

摘要:

网络协议实现中的许多软件错误出现在规范边界附近,例如刚好在允许范围内或范围外的输入,或者单独有效但在特定状态下无效的消息。从SSL Heartbleed漏洞到TCP Christmas Tree数据包,边界输入反复暴露出关键弱点,但现有技术(如模糊测试和基于模型的测试)对此测试不足。我们提出CornerCase,一种自动化极端测试方法,系统性地针对此类边界行为。我们的关键思想是将测试生成分解为两个阶段:首先,大语言模型(LLMs)以结构化的逐节方式从协议规范(例如RFC)中提取显式有效性约束;其次,在每个约束的边界或附近生成极端测试用例。这些测试在多个实现上执行,差分测试识别不一致性。我们在广泛使用的HTTP、DNS、BGP、SMTP和QUIC实现上评估CornerCase,发现了许多先前未知的错误。例如,HTTP服务器h2o在处理包含编码空字节的URL时进入重定向循环。总体而言,我们使用CornerCase识别并提交了42个异常;迄今为止,26个已被确认为错误,18个已修复,其他正在积极调查中。

英文摘要:

Many software bugs in network protocol implementations arise near specification boundaries, such as inputs just within or outside allowed ranges, or messages that are valid in isolation but invalid in a given state. From the SSL Heartbleed exploit to TCP Christmas Tree packets, boundary inputs have repeatedly exposed critical weaknesses, yet remain under-tested by existing techniques such as fuzzing and model-based testing. We present CornerCase, an automated extremal testing approach that systematically targets such boundary behaviors. Our key idea is to decompose test generation into two stages: first, large language models (LLMs) extract explicit validity constraints from protocol specifications (e.g., RFCs) in a structured, section-by-section manner; second, extremal test cases are generated at or near the boundary of each constraint. These tests are executed across multiple implementations, and differential testing identifies inconsistencies. We evaluate CornerCase on widely used implementations of HTTP, DNS, BGP, SMTP, and QUIC, uncovering many previously unknown bugs. For example, the HTTP server h2o enters a redirect loop when processing URLs containing encoded null bytes. Overall, we used CornerCase to identify and file 42 anomalies; to date 26 have been acknowledged as bugs and 18 fixed, with others under active investigation

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑