一句话:提出基于 OpenAPI 规范的黑盒方法,通过操作聚类识别只读字段并生成测试序列,自动检测 RESTful API 的批量赋值漏洞。
论文关注 RESTful API 中最突出的漏洞之一——批量赋值(mass assignment)漏洞,它源于常见 Web 框架的配置错误:框架依据命名约定自动绑定请求字段,攻击者可借此(大规模)覆盖本应只读的数据。作者采用纯黑盒测试视角,仅依据 OpenAPI 规范(其中列出可用操作及其消息格式)自动生成执行场景。方法先用聚类将相似操作分组以揭示只读字段,这些字段即批量赋值攻击的候选目标;随后实例化抽象测试模板,自动生成测试交互序列,尝试利用已发现的只读字段实施攻击;最后运行交互并用专门的 oracle 判定漏洞是否可被成功利用。该新颖方法已被实现,并在以不同编程语言编写的若干案例研究上评估。结果表明,该方法在检测人工植入漏洞方面相当有效,且准确率显著较高。
Mass assignment is one of the most prominent vulnerabilities in RESTful APIs that originates from a misconfiguration in common web frameworks. This allows attackers to exploit naming convention and automatic binding to craft malicious requests that (massively) override data supposed to be read-only. In this paper, we adopt a black-box testing perspective to automatically detect mass assignment vulnerabilities in RESTful APIs. Indeed, 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 candidates for mass assignment. Then, test interaction sequences are automatically generated by instantiating abstract testing templates, with the aim of trying to use the found read-only fields to carry out a mass assignment attack. Test interactions 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.