[Paper Review] Automated Black-box Testing of Mass Assignment Vulnerabilities in RESTful APIs
This paper presents a novel black-box testing approach to automatically detect mass assignment vulnerabilities in RESTful APIs using only the OpenAPI specification. By clustering similar operations and identifying read-only fields, it generates targeted test cases via abstract templates and validates them with a security oracle, achieving 100% detection of seeded vulnerabilities with no false positives.
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.
Motivation & Objective
- To address the critical security risk posed by mass assignment vulnerabilities in RESTful APIs, which arise from misconfigured web frameworks.
- To develop an automated, black-box testing approach that does not require source code access or framework-specific knowledge.
- To identify read-only fields in API operations that could be exploited via mass assignment by analyzing OpenAPI specifications.
- To generate and execute test cases that target potential mass assignment exploits with high precision.
- To evaluate the approach on diverse case studies to validate its effectiveness and accuracy in real-world scenarios.
Proposed method
- Clustering is applied to operations in the OpenAPI specification to group those likely operating on the same data resources.
- Heuristics are used to identify fields that are read-only in the API's design, based on their consistent presence across operations and absence in write operations.
- Abstract test templates are instantiated to generate concrete test cases that attempt to override these read-only fields via malicious input.
- A custom security oracle monitors API responses to detect whether write operations successfully modified fields that should be read-only.
- The approach is implemented and evaluated on case studies across multiple programming languages and frameworks, using seeded vulnerabilities for validation.
- The tooling is integrated with RestTestGen to leverage its modular architecture for extensibility and test generation.
Experimental results
Research questions
- RQ1Can automated black-box testing effectively detect mass assignment vulnerabilities in RESTful APIs without access to source code?
- RQ2How accurately can clustering and heuristics identify read-only fields from the OpenAPI specification alone?
- RQ3Can abstract test templates be effectively instantiated to generate meaningful test cases targeting mass assignment exploits?
- RQ4What is the precision and recall of the proposed approach in detecting known mass assignment vulnerabilities in real-world case studies?
- RQ5Is the approach generalizable across different programming languages and web frameworks?
Key findings
- The proposed approach successfully detected all seeded mass assignment vulnerabilities in the evaluated case studies with no false positives.
- The method achieved 100% detection accuracy, demonstrating high reliability in identifying exploitable fields.
- The use of clustering and heuristics enabled accurate identification of read-only fields based solely on the OpenAPI specification.
- The approach is effective across multiple programming languages and web frameworks, indicating broad applicability.
- The security oracle correctly flagged all successful mass assignment attempts, confirming the reliability of the detection mechanism.
- The evaluation confirms that the approach is the first fully automated black-box method for detecting mass assignment vulnerabilities in REST APIs.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.