[论文解读] REST-ler: Automatic Intelligent REST API Fuzzing
REST-ler 是首个用于 REST API 的自动、智能模糊测试工具,它通过分析 Swagger 规范来推断请求依赖关系,并从服务响应中动态学习无效请求序列。它生成智能测试序列,以高效探索复杂的 API 行为,在 GitLab 等真实服务中发现安全相关漏洞,且仅需极少的人工干预。
Cloud services have recently exploded with the advent of powerful cloud-computing platforms such as Amazon Web Services and Microsoft Azure. Today, most cloud services are accessed through REST APIs, and Swagger is arguably the most popular interface-description language for REST APIs. A Swagger specification describes how to access a cloud service through its REST API (e.g., what requests the service can handle and what responses may be expected). This paper introduces REST-ler, the first automatic intelligent REST API security-testing tool. REST-ler analyzes a Swagger specification and generates tests that exercise the corresponding cloud service through its REST API. Each test is defined as a sequence of requests and responses. REST-ler generates tests intelligently by (1) inferring dependencies among request types declared in the Swagger specification (e.g., inferring that "a request B should not be executed before a request A" because B takes as an input argument a resource-id x returned 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 show that these two techniques are necessary to thoroughly exercise a service under test while pruning the large search space of possible request sequences. We also discuss the application of REST-ler to test GitLab, a large popular open-source self-hosted Git service, and the new bugs that were found.
研究动机与目标
- 解决云服务中 REST API 安全测试缺乏自动化、智能工具的问题。
- 通过推断依赖关系并利用运行时反馈,减少可能请求序列的巨大搜索空间。
- 在传统基于语法或流量回放的方法之外,提升自动化 API 模糊测试的有效性和覆盖率。
- 识别并报告真实世界、生产级别的云服务(如 GitLab)中的安全关键漏洞。
- 证明智能、反馈驱动的 API 模糊测试对于全面且高效的测试至关重要。
提出的方法
- 通过分析 Swagger 规范,静态推断 API 请求之间的依赖关系,例如需要从前一个响应中获取资源 ID 才能调用后续请求。
- 通过观察服务响应进行动态反馈分析,学习哪些请求序列无效或被拒绝,从而避免冗余或有害的测试路径。
- 生成以请求和响应序列为基本单元的测试用例,受推断出的依赖关系和反馈驱动的无效路径剪枝策略引导。
- 实现多种搜索策略(例如深度优先、广度优先以及反馈引导探索),以在可能的 API 交互状态空间中导航。
- 采用黑盒方法,仅观察 HTTP 请求和响应,不逆向分析内部服务逻辑或源代码。
- 借鉴基于模型的测试和面向对象系统中 API 测试的学习机制,扩展模糊测试,以提升测试的多样性与覆盖率。
实验结果
研究问题
- RQ1能否通过从 Swagger 规范中智能推断依赖关系,显著减少可能的 API 请求序列的搜索空间?
- RQ2服务响应的动态反馈能否提升 API 模糊测试的有效性和效率?
- RQ3不同搜索策略在真实服务中发现新型和复杂 API 行为方面有何影响?
- RQ4自动化、智能的 API 模糊测试能否发现传统测试或手动渗透测试所遗漏的安全相关缺陷?
- RQ5此类工具在发现大型、复杂的真实云服务(如 GitLab)中的漏洞方面,其有效性在多大程度上得以体现?
主要发现
- REST-ler 在 GitLab 中成功发现多个新型安全相关缺陷,包括可能导致数据损坏或泄露的数据库操作并发问题。
- 静态依赖关系推断与动态反馈分析的结合,是实现高测试覆盖率的同时避免无效或冗余请求序列的关键。
- 反馈驱动的学习显著剪枝了搜索空间,使 REST-ler 能够高效探索更深、更复杂的 API 交互模式。
- 在评估的搜索策略中,反馈引导探索在发现新型和复杂行为方面优于深度优先和广度优先方法。
- 该工具证明了对大型、复杂服务(具有复杂状态依赖)的 REST API 实现自动化、智能模糊测试是可行且有效的。
- 结果表明,REST-ler 可作为手动渗透测试的可扩展、互补工具,用于识别云服务中的安全漏洞。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。