论文标题

松鼠:具有语言有效性和覆盖反馈的测试数据库管理系统

SQUIRREL: Testing Database Management Systems with Language Validity and Coverage Feedback

论文作者

Zhong, Rui, Chen, Yongheng, Hu, Hong, Zhang, Hangfan, Lee, Wenke, Wu, Dinghao

论文摘要

模糊是一种越来越受欢迎的技术,用于验证软件功能并找到安全漏洞。但是,当前基于突变的模糊器无法有效测试数据库管理系统(DBMS),该系统严格检查输入是否有效语法和语义。基于生成的测试可以保证输入的语法正确性,但它并未利用任何反馈(例如代码覆盖)来指导路径探索。 在本文中,我们开发了松鼠,这是一个新颖的模糊框架,它考虑了语言有效性和覆盖范围的反馈来测试DBMS。我们设计了一个中间表示(IR),以结构性和信息性的方式维护SQL查询。为了生成句法正确的查询,我们对IR进行基于类型的突变,包括语句插入,删除和替换。为了减轻语义错误,我们分析每个IR以确定参数之间的逻辑依赖性,并生成满足这些依赖性的查询。我们在四个流行的DBMS上评估了松鼠:SQLite,MySQL,PostgreSQL和Mariadb。松鼠在Sqlite中发现了51个虫子,在MySQL中发现了51个虫子,在Mariadb中发现了51个虫子。其中52个错误是通过分配的12个CVE修复的。在我们的实验中,松鼠的语义正确性比最新的模糊剂高2.4x-243.9倍,并且探索比基于突变的工具的新边缘多2.0x-10.9倍。这些结果表明,松鼠可以有效地查找数据库管理系统的内存错误。

Fuzzing is an increasingly popular technique for verifying software functionalities and finding security vulnerabilities. However, current mutation-based fuzzers cannot effectively test database management systems (DBMSs), which strictly check inputs for valid syntax and semantics. Generation-based testing can guarantee the syntax correctness of the inputs, but it does not utilize any feedback, like code coverage, to guide the path exploration. In this paper, we develop Squirrel, a novel fuzzing framework that considers both language validity and coverage feedback to test DBMSs. We design an intermediate representation (IR) to maintain SQL queries in a structural and informative manner. To generate syntactically correct queries, we perform type-based mutations on IR, including statement insertion, deletion and replacement. To mitigate semantic errors, we analyze each IR to identify the logical dependencies between arguments, and generate queries that satisfy these dependencies. We evaluated Squirrel on four popular DBMSs: SQLite, MySQL, PostgreSQL and MariaDB. Squirrel found 51 bugs in SQLite, 7 in MySQL and 5 in MariaDB. 52 of the bugs are fixed with 12 CVEs assigned. In our experiment, Squirrel achieves 2.4x-243.9x higher semantic correctness than state-of-the-art fuzzers, and explores 2.0x-10.9x more new edges than mutation-based tools. These results show that Squirrel is effective in finding memory errors of database management systems.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源