一句话:首个有状态 REST API 模糊测试器,通过推断请求依赖并利用响应反馈生成测试序列,发现 28 个 GitLab 缺陷及多个云服务缺陷。
本文提出 RESTler,首个有状态的 REST API 模糊测试工具。它分析云服务的 API 规范,自动生成请求序列来测试服务。RESTler 通过两种机制生成测试序列:(1) 从规范中声明的请求类型之间推断生产者-消费者依赖关系,例如因请求 B 以请求 A 产生的资源 id x 为输入,推断 B 应在 A 之后执行;(2) 分析先前测试执行中观察到的响应动态反馈来生成新测试,例如学习到请求序列 A;B 之后的请求 C 会被服务拒绝,从而在未来避免该组合。实验表明,这两种技术对于充分覆盖被测服务、同时剪枝庞大的请求序列搜索空间都是必要的。作者用 RESTler 测试了开源 Git 服务 GitLab 以及多个 Microsoft Azure 和 Office365 云服务,在 GitLab 中发现 28 个缺陷,并在每个已测试的 Azure 和 Office365 云服务中发现若干缺陷,这些缺陷均已被服务所有者确认并修复。
This paper introduces RESTler, the first stateful REST API fuzzer. RESTler analyzes the API specification of a cloud service and generates sequences of requests that automatically test the service through its API. RESTler generates test sequences by (1) inferring producer-consumer dependencies among request types declared in the specification (e.g., inferring that "a request B should be executed after request A" because B takes as an input a resource-id x produced by A) and by (2) analyzing dynamic feedback from responses observed during prior test executions in order to generate new tests (e.g., learning that "a request C after a request sequence A;B is refused by the service" and therefore avoiding this combination in the future). We present experimental results showing that these two techniques are necessary to thoroughly exercise a service under test while pruning the large search space of possible request sequences. We used RESTler to test GitLab, an open-source Git service, as well as several Microsoft Azure and Office365 cloud services. RESTler found 28 bugs in GitLab and several bugs in each of the Azure and Office365 cloud services tested so far. These bugs have been confirmed and fixed by the service owners.