Skip to main content
QUICK REVIEW

[论文解读] Automated Black-box Testing of Mass Assignment Vulnerabilities in RESTful APIs

Davide Corradini, Michele Pasqua|arXiv (Cornell University)|Jan 3, 2023
Web Application Security Vulnerabilities被引用 4
一句话总结

本文提出了一种新颖的黑盒测试方法,仅使用 OpenAPI 规范即可自动检测 RESTful API 中的批量赋值漏洞。通过聚类相似操作并识别只读字段,该方法利用抽象模板生成针对性的测试用例,并通过安全预言机进行验证,实现了对植入漏洞的 100% 检测率且无误报。

ABSTRACT

Mass assignment is one of the most prominent vulnerabilities in RESTful APIs. This vulnerability originates from a misconfiguration in common web frameworks, such that naming convention and automatic binding can be exploited by an attacker to craft malicious requests writing confidential resources and (massively) overriding data, that should be read-only and/or confidential. In this paper, we adopt a black-box testing perspective to automatically detect mass assignment vulnerabilities in RESTful APIs. Execution scenarios are generated purely based on the OpenAPI specification, that lists the available operations and their message format. Clustering is used to group similar operations and reveal read-only fields, the latter are candidate for mass assignment. Then, interaction sequences are automatically generated by instantiating abstract testing templates, trying to exploit the potential vulnerabilities. Finally, test cases are run, and their execution is assessed by a specific oracle, in order to reveal whether the vulnerability could be successfully exploited. The proposed novel approach has been implemented and evaluated on a set of case studies written in different programming languages. The evaluation highlights that the approach is quite effective in detecting seeded vulnerabilities, with a remarkably high accuracy.

研究动机与目标

  • 为解决由于 Web 框架配置错误而引发的 RESTful API 中批量赋值漏洞这一关键安全风险。
  • 开发一种无需访问源代码或框架特定知识的自动化黑盒测试方法。
  • 通过分析 OpenAPI 规范,识别可能通过批量赋值被利用的 API 操作中的只读字段。
  • 生成并执行高精度的测试用例,以针对性地检测潜在的批量赋值利用。
  • 在多种案例研究中评估该方法,以验证其在真实场景中的有效性和准确性。

提出的方法

  • 对 OpenAPI 规范中的操作应用聚类,以将可能操作于同一数据资源的操作分组。
  • 使用启发式方法基于字段在操作中的一致性出现以及在写操作中的缺失,识别 API 设计中为只读的字段。
  • 实例化抽象测试模板,生成尝试通过恶意输入覆盖这些只读字段的具体测试用例。
  • 通过自定义安全预言机监控 API 响应,检测写操作是否成功修改了本应为只读的字段。
  • 在多种编程语言和框架的案例研究中实现并评估该方法,使用植入的漏洞进行验证。
  • 将工具与 RestTestGen 集成,以利用其模块化架构实现可扩展性和测试生成。

实验结果

研究问题

  • RQ1在无源代码访问的情况下,自动化黑盒测试能否有效检测 RESTful API 中的批量赋值漏洞?
  • RQ2聚类与启发式方法仅基于 OpenAPI 规范,能否准确识别只读字段?
  • RQ3抽象测试模板能否被有效实例化,以生成针对批量赋值利用的有意义测试用例?
  • RQ4该方法在真实世界案例研究中检测已知批量赋值漏洞的精确率与召回率如何?
  • RQ5该方法是否可在不同编程语言和 Web 框架之间通用化?

主要发现

  • 所提出的方法在评估的案例研究中成功检测到所有植入的批量赋值漏洞,且无误报。
  • 该方法实现了 100% 的检测准确率,证明了其在识别可利用字段方面的高度可靠性。
  • 聚类与启发式方法的结合,仅基于 OpenAPI 规范即实现了对只读字段的准确识别。
  • 该方法在多种编程语言和 Web 框架中均表现有效,表明其具有广泛的适用性。
  • 安全预言机正确标记了所有成功的批量赋值尝试,证实了检测机制的可靠性。
  • 评估结果表明,该方法是首个完全自动化的黑盒方法,用于检测 REST API 中的批量赋值漏洞。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。