Exploiting Library Vulnerability via Migration Based Automating Test Generation

Zirui Chen,Xing Hu,Xin Xia,Yi Gao,Tongtong Xu,David Lo,Xiaohu Yang
2023-12-15
Abstract:In software development, developers extensively utilize third-party libraries to avoid implementing existing functionalities. When a new third-party library vulnerability is disclosed, project maintainers need to determine whether their projects are affected by the vulnerability, which requires developers to invest substantial effort in assessment. However, existing tools face a series of issues: static analysis tools produce false alarms, dynamic analysis tools require existing tests and test generation tools have low success rates when facing complex vulnerabilities. Vulnerability exploits, as code snippets provided for reproducing vulnerabilities after disclosure, contain a wealth of vulnerability-related information. This study proposes a new method based on vulnerability exploits, called VESTA (Vulnerability Exploit-based Software Testing Auto-Generator), which provides vulnerability exploit tests as the basis for developers to decide whether to update dependencies. VESTA extends the search-based test generation methods by adding a migration step, ensuring the similarity between the generated test and the vulnerability exploit, which increases the likelihood of detecting potential library vulnerabilities in a project. We perform experiments on 30 vulnerabilities disclosed in the past five years, involving 60 vulnerability-project pairs, and compare the experimental results with the baseline method, TRANSFER. The success rate of VESTA is 71.7\% which is a 53.4\% improvement over TRANSFER in the effectiveness of verifying exploitable vulnerabilities.
Software Engineering
What problem does this paper attempt to address?
The paper proposes a solution to the problem of detecting and evaluating vulnerabilities in third-party libraries in software development. When new vulnerabilities in third-party libraries are disclosed, project maintainers need to determine if their project is affected, which often requires significant effort from developers. Existing tools face issues such as false positives in static analysis, dependency on existing tests in dynamic analysis, and low success rate in generating tests for complex vulnerabilities. The researchers propose a new method called Vesta, which is an exploit-based automated test generator. Vesta extends search-based test generation methods by adding migration steps to ensure that the generated tests are similar to exploit code, thereby increasing the likelihood of detecting potential library vulnerabilities in a project. Experimental results show that Vesta improves the success rate of verifying exploitable vulnerabilities by 53.4% compared to the baseline method Transfer. The workflow of Vesta includes preprocessing (collecting search targets and dynamic call graphs), test generation (generating test cases that include call graphs to vulnerable functions if suitable existing tests do not exist), and migration (modifying tests based on parameter values in exploit code to trigger vulnerabilities). With this approach, developers can decide whether to update dependency libraries based on the generated test cases, thereby reducing the risk of vulnerabilities being exploited.